Skip to content

Docs: update instructions to install deps with Poetry #9743

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

Merged
merged 4 commits into from
Nov 23, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions docs/user/build-customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ Install dependencies with Poetry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Projects managed with `Poetry <https://python-poetry.org/>`__,
can use the ``post_create_environment`` user-defined job to use Poetry for installing Python dependencies.
can use the ``post_create_environment`` user-defined job to install Poetry and ``post_install`` to install Python dependencies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not using post_install anymore, so we should revert this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated 😄

Take a look at the following example:


Expand All @@ -326,12 +326,13 @@ Take a look at the following example:
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
- pip install poetry
# Tell poetry to not use a virtual environment
- $HOME/.poetry/bin/poetry config virtualenvs.create false
# Install project's dependencies
- $HOME/.poetry/bin/poetry install
- poetry config virtualenvs.create false
post_install:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this post_install here to simplify the config a little since it's not required for the most common use case. I tried this in test-builds project and it worked properly https://readthedocs.org/projects/test-builds/builds/18704586/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was best to cover more edge cases, in the hope that it would avoid potential issues for old projects and therefore support requests/GitHub issues.

That being said, I don't mind either way & I'll remove this section 👍🏻

# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- poetry install --with docs

sphinx:
configuration: docs/conf.py
Expand Down