Skip to content

Commit

Permalink
poetry: Poetry 1.7 issues
Browse files Browse the repository at this point in the history
1. Add --no-root to poetry invocations. Poetry 1.7 displays an error otherwise
(though things still work)

https://github.com/orgs/python-poetry/discussions/8622
python-poetry/poetry#1132

2. Document python-poetry/poetry#8623
  • Loading branch information
ilyagr committed Nov 5, 2023
1 parent 2401bf9 commit c41e799
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .github/scripts/docs-build-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
set -ev

export "SITE_URL_FOR_MKDOCS=$1"; shift
# https://github.com/python-poetry/poetry/issues/1917
# https://github.com/python-poetry/poetry/issues/1917 and
# https://github.com/python-poetry/poetry/issues/8623
export PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring
poetry install # Only really needed once per environment unless there are updates
poetry install --no-root # Only really needed once per environment unless there are updates
# TODO(ilyagr): The new default "alias-type" is symlink, we should consider
# switching to it.
poetry run -- mike deploy --alias-type redirect "$@"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
with:
poetry-version: latest
- name: Install dependencies
run: poetry install
run: poetry install --no-root
- name: Check that `mkdocs` can build the docs
run: poetry run -- mkdocs build --strict

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
poetry-version: latest
- name: Compile docs and zip them up
run: |
poetry install
poetry install --no-root
poetry run -- mkdocs build -f mkdocs-offline.yml
archive="jj-${{ github.event.release.tag_name }}-docs-html.tar.gz"
tar czf "$archive" -C "rendered-docs" .
Expand Down
13 changes: 8 additions & 5 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,16 @@ Once you have `poetry` installed, you should ask it to install the rest
of the required tools into a virtual environment as follows:

```shell
poetry install
# --no-root avoids a harmless error message starting with Poetry 1.7
poetry install --no-root
```

If you get requests to "unlock a keyring" or error messages about failing to do
so, this is a [known `poetry`
bug](https://github.com/python-poetry/poetry/issues/1917). The workaround is to
run the following and then to try `poetry install` again:
You may get requests to "unlock a keyring", [an error messages about failing to
do so](https://github.com/python-poetry/poetry/issues/1917), or, in the case of
Poetry 1.7, it may [simply hang
indefinitely](https://github.com/python-poetry/poetry/issues/8623). The
workaround is to either to unlock the keyring or to run the following, and then
to try `poetry install --no-root` again:

```shell
# For sh-compatible shells or recent versions of `fish`
Expand Down

0 comments on commit c41e799

Please sign in to comment.