Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Use and recommend poetry 1.1.14, up from 1.1.12
Browse files Browse the repository at this point in the history
[1.1.14](https://github.com/python-poetry/poetry/releases/tag/1.1.14)
includes a critical bugfix needed to generate lockfiles when using PyPI
as the source of packages.
(python-poetry/poetry#5973, to accomodate
pypi/warehouse#11775)

[1.1.13](https://github.com/python-poetry/poetry/releases/tag/1.1.13)
includes bugfixes that shouldn't be relevant for us (`poetry self
update` and Windows fixes only).

We shouldn't need to use 1.1.14 in the Docker image as we never `lock`
nor `update`, but I have included it for consistency.

I've also added a quick troubleshooting guide to the dev docs.
  • Loading branch information
David Robertson committed Jul 15, 2022
1 parent 599c403 commit 2eedb34
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .ci/scripts/test_old_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ with open('pyproject.toml', 'w') as f:
"
python3 -c "$REMOVE_DEV_DEPENDENCIES"

pipx install poetry==1.1.12
pipx install poetry==1.1.14
~/.local/bin/poetry lock

echo "::group::Patched pyproject.toml"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/twisted_trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ jobs:
run: |
set -x
DEBIAN_FRONTEND=noninteractive sudo apt-get install -yqq python3 pipx
pipx install poetry==1.1.12
pipx install poetry==1.1.14
poetry remove -n twisted
poetry add -n --extras tls git+https://github.com/twisted/twisted.git#trunk
poetry lock --no-update
# NOT IN 1.1.12 poetry lock --check
# NOT IN 1.1.14 poetry lock --check
working-directory: synapse

- run: |
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUN \

# We install poetry in its own build stage to avoid its dependencies conflicting with
# synapse's dependencies.
# We use a specific commit from poetry's master branch instead of our usual 1.1.12,
# We use a specific commit from poetry's master branch instead of our usual 1.1.14,
# to incorporate fixes to some bugs in `poetry export`. This commit corresponds to
# https://github.com/python-poetry/poetry/pull/5156 and
# https://github.com/python-poetry/poetry/issues/5141 ;
Expand Down
25 changes: 25 additions & 0 deletions docs/development/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,28 @@ poetry run pip install build && poetry run python -m build
because [`build`](https://github.com/pypa/build) is a standardish tool which
doesn't require poetry. (It's what we use in CI too). However, you could try
`poetry build` too.


# Troubleshooting

## Check the version of poetry with `poetry --version`.

At the time of writing, the 1.2 series is beta only. We have seen some examples
where the lockfiles generated by 1.2 prereleasese aren't interpreted correctly
by poetry 1.1.x. For now, use poetry 1.1.14, which includes a critical
[change](https://github.com/python-poetry/poetry/pull/5973) needed to remain
[compatible with PyPI](https://github.com/pypi/warehouse/pull/11775).

It can also be useful to check the version of `poetry-core` in use. If you've
installed `poetry` with `pipx`, try `pipx runpip poetry list | grep poetry-core`.

## Clear caches: `poetry cache clear --all pypi`.

Poetry caches a bunch of information about packages that isn't readily available
from PyPI. (This is what makes poetry seem slow when doing the first
`poetry install`.) Try `poetry cache list` and `poetry cache clear --all
<name of cache>` to see if that fixes things.

## Try `--verbose` or `--dry-run` arguments.

Sometimes useful to see what poetry's internal logic is.

0 comments on commit 2eedb34

Please sign in to comment.