poetry: Poetry 1.7 issues

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
https://github.com/python-poetry/poetry/issues/1132

2. Document https://github.com/python-poetry/poetry/issues/8623
This commit is contained in:
Ilya Grigoriev 2023-11-03 19:28:28 -07:00
parent 3fddc31da8
commit 745f5b7f0e
4 changed files with 13 additions and 9 deletions

View file

@ -9,9 +9,10 @@
set -ev set -ev
export "SITE_URL_FOR_MKDOCS=$1"; shift 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 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 # TODO(ilyagr): The new default "alias-type" is symlink, we should consider
# switching to it. # switching to it.
poetry run -- mike deploy --alias-type redirect "$@" poetry run -- mike deploy --alias-type redirect "$@"

View file

@ -75,7 +75,7 @@ jobs:
with: with:
poetry-version: latest poetry-version: latest
- name: Install dependencies - name: Install dependencies
run: poetry install run: poetry install --no-root
- name: Check that `mkdocs` can build the docs - name: Check that `mkdocs` can build the docs
run: poetry run -- mkdocs build --strict run: poetry run -- mkdocs build --strict

View file

@ -91,7 +91,7 @@ jobs:
poetry-version: latest poetry-version: latest
- name: Compile docs and zip them up - name: Compile docs and zip them up
run: | run: |
poetry install poetry install --no-root
poetry run -- mkdocs build -f mkdocs-offline.yml poetry run -- mkdocs build -f mkdocs-offline.yml
archive="jj-${{ github.event.release.tag_name }}-docs-html.tar.gz" archive="jj-${{ github.event.release.tag_name }}-docs-html.tar.gz"
tar czf "$archive" -C "rendered-docs" . tar czf "$archive" -C "rendered-docs" .

View file

@ -191,13 +191,16 @@ Once you have `poetry` installed, you should ask it to install the rest
of the required tools into a virtual environment as follows: of the required tools into a virtual environment as follows:
```shell ```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 You may get requests to "unlock a keyring", [an error messages about failing to
so, this is a [known `poetry` do so](https://github.com/python-poetry/poetry/issues/1917), or, in the case of
bug](https://github.com/python-poetry/poetry/issues/1917). The workaround is to Poetry 1.7, it may [simply hang
run the following and then to try `poetry install` again: 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 ```shell
# For sh-compatible shells or recent versions of `fish` # For sh-compatible shells or recent versions of `fish`