New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Poetry #4912
Comments
What would be the poetry workflow in read the docs? Pipfile support will be out soon btw. If this gets implemented, it would live as an option in the configuration file. |
locally i run although if there is a virtualenv already active then poetry will install the dependencies into that instead, which means it should work the same as for requirements.txt or Pipfile? |
My workflow is pretty similar:
Real project example that uses both |
So, replacing the |
@humitos yes, I think so. Mind, that we also have to work with |
if you have the venv active, you can run
|
Is there a use case where users only want to install dev/prod deps? There are any other configurations that users may want to set? |
the latter is more along the lines of you can also use full docs are at https://poetry.eustace.io/docs/cli/#install |
I think this problem will resolve itself once the next version of
to the |
except the build script runs |
@danielknell we do support installing the project using pip. @uSpike I have read the pip issue and pep, but I wasn't able to understand it very well yet :/ will this replace pipenv too? |
@stsewd pip might be able to install from a |
@danielknell - yeah, check here: https://docs.readthedocs.io/en/latest/yaml-config.html#python-pip-install, might be able to do it through the web config too. So, guess we're just waiting on pypa/pip#6106. @stsewd : once pip 0.19.0 is out, how long before it makes it into a readthedocs image that we can use? |
We install the latest version of pip before each build #4938, so it should be available after they release it :) |
I'm not very familiar with Python virtual environments, but there may be another issue there. I run poetry from a
|
Since new
ApplicationTrying:
LibraryTrying: |
does it work within rtfd? i keep meaning to try but have not found time to update my projects yet with the config to install via pip. |
@sobolevn I wouldn't expect https://github.com/wemake-services/wemake-django-template to install since it is a template (cookiecutter) project. |
@uSpike |
the fact it does not install dev dependencies is concerning and maybe pep 517 isn't enough to fully support poetry projects? |
I have also tried to research this |
that means |
Can anyone try a project in rtd? We have the latest pip installed, let us know if there is anything else to do from our side to support poetry. |
@sobolevn that project (https://github.com/wemake-services/wemake-django-template) is a template, you're not supposed to @danielknell aah I forgot about that... there might be a way to pass flags to poetry via pip? |
Ah I thought you were referencing something like
And thanks again for another helpful overview. I might be the only core team member that uses Poetry consistently, but even my usage is mostly experimentation. So I'm certainly not up to speed on new features. This is where I think most of the team has less appetite to support a new packaging tooling. We did go through this with Pip -- there are seemingly endless ways users use Pip. Coupled with the fact that we're not skilled with Poetry, it might be hard for us to support all of the usage patterns natively. It's definitely a complex problem at our scale. We can't expect any specific version of Poetry, but that limits us from supporting features like dependency groups -- our implementation can't assume the user is using a modern Poetry. |
when its released, poetry 1.2 should be able to support any older setups, it will treat the existing my experience over the years has been pretty good backwards compatibility wise. tbh, the easy route is probably only supporting the latest stable version only, and then doing a vanilla it's not the perfect ideal setup but it would work for pretty much everything using a stable version, and early adopters of 1.2 would just have to wait (I mean that's par for the course when you go out on the bleeding edge right?), or use |
that would give you something like:
translating into something like |
would an extension of the following with the snippet below work? readthedocs.org/readthedocs/doc_builder/python_environments.py Lines 190 to 224 in 4ad6da0
elif install.method == POETRY:
local_path = (
os.path.join('.', install.path) if install.path != '.' else install.path
)
extra_req_param = ''
if install.extra_requirements:
extra_req_param = ["-E {}".format(v) for install.extra_requirements if v]
self.build_env.run(
'poetry',
'install',
*extra_req_param,
cwd=os.path.join(self.checkout_path, local_path),
bin_path="~/.local/bin",
environment={
"VIRTUAL_ENV": self.venv_path(),
"PIP_NO_CACHE_DIR": "on",
}
) I am probably missing something as I don't really know what I'm doing in this codebase, but it should be close enough for someone to help tidy up? it assumes a |
…to follow readthedocs/readthedocs.org#4912 (comment) which seems to be the recommended way. Previous method was using mkdocs version 1.1 for some reason. mkdocs version 1.1 doesn't work with the latest version of jinja2 (https://twitter.com/readthedocs/status/1507388916013314048).
…to follow readthedocs/readthedocs.org#4912 (comment) which seems to be the recommended way. Previous method was using mkdocs version 1.1 for some reason. mkdocs version 1.1 doesn't work with the latest version of jinja2 (https://twitter.com/readthedocs/status/1507388916013314048).
you may need to use this: version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.10"
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- python -m pip install poetry
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs
sphinx:
configuration: docs/conf.py |
More fonts Update .readthedocs.yml readthedocs/readthedocs.org#4912 (comment)
It would be nice to be able to build docs for libraries managed with poetry.
maybe by checking for a
[tool.poetry]
section inpyproject.toml
, having to keep a separate requirements.txt file in sync feels a bit fragile.The text was updated successfully, but these errors were encountered: