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

Commit c96a1d2

Browse files
author
David Robertson
authored
Relax poetry-core lower bound to 1.1.0 (#15571)
See #15566 (comment) Also check you can `pip install` in the old-deps CI job
1 parent 08297f2 commit c96a1d2

File tree

5 files changed

+17
-54
lines changed

5 files changed

+17
-54
lines changed

.ci/scripts/prepare_old_deps.sh

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,6 @@ sed -i \
3131
-e '/systemd/d' \
3232
pyproject.toml
3333

34-
# Use poetry to do the installation. This ensures that the versions are all mutually
35-
# compatible (as far the package metadata declares, anyway); pip's package resolver
36-
# is more lax.
37-
#
38-
# Rather than `poetry install --no-dev`, we drop all dev dependencies and the dev-docs
39-
# group from the toml file. This means we don't have to ensure compatibility between
40-
# old deps and dev tools.
41-
42-
pip install toml wheel
43-
44-
REMOVE_DEV_DEPENDENCIES="
45-
import toml
46-
with open('pyproject.toml', 'r') as f:
47-
data = toml.loads(f.read())
48-
49-
del data['tool']['poetry']['dev-dependencies']
50-
del data['tool']['poetry']['group']['dev-docs']
51-
52-
with open('pyproject.toml', 'w') as f:
53-
toml.dump(data, f)
54-
"
55-
python3 -c "$REMOVE_DEV_DEPENDENCIES"
56-
57-
pip install poetry==1.3.2
58-
poetry lock
59-
6034
echo "::group::Patched pyproject.toml"
6135
cat pyproject.toml
6236
echo "::endgroup::"
63-
echo "::group::Lockfile after patch"
64-
cat poetry.lock
65-
echo "::endgroup::"

.github/workflows/tests.yml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -321,34 +321,25 @@ jobs:
321321
with:
322322
python-version: '3.7'
323323

324-
# Calculating the old-deps actually takes a bunch of time, so we cache the
325-
# pyproject.toml / poetry.lock. We need to cache pyproject.toml as
326-
# otherwise the `poetry install` step will error due to the poetry.lock
327-
# file being outdated.
328-
#
329-
# This caches the output of `Prepare old deps`, which should generate the
330-
# same `pyproject.toml` and `poetry.lock` for a given `pyproject.toml` input.
331-
- uses: actions/cache@v3
332-
id: cache-poetry-old-deps
333-
name: Cache poetry.lock
334-
with:
335-
path: |
336-
poetry.lock
337-
pyproject.toml
338-
key: poetry-old-deps2-${{ hashFiles('pyproject.toml') }}
339324
- name: Prepare old deps
340325
if: steps.cache-poetry-old-deps.outputs.cache-hit != 'true'
341326
run: .ci/scripts/prepare_old_deps.sh
342327

343-
# We only now install poetry so that `setup-python-poetry` caches the
344-
# right poetry.lock's dependencies.
345-
- uses: matrix-org/setup-python-poetry@v1
346-
with:
347-
python-version: '3.7'
348-
poetry-version: "1.3.2"
349-
extras: "all test"
328+
# Note: we install using `pip` here, not poetry. `poetry install` ignores the
329+
# build-system section (https://github.com/python-poetry/poetry/issues/6154), but
330+
# we explicitly want to test that you can `pip install` using the oldest version
331+
# of poetry-core and setuptools-rust.
332+
- run: pip install .[all,test]
333+
334+
# We nuke the local copy, as we've installed synapse into the virtualenv
335+
# (rather than use an editable install, which we no longer support). If we
336+
# don't do this then python can't find the native lib.
337+
- run: rm -rf synapse/
338+
339+
# Sanity check we can import/run Synapse
340+
- run: python -m synapse.app.homeserver --help
350341

351-
- run: poetry run trial -j6 tests
342+
- run: python -m twisted.trial -j6 tests
352343
- name: Dump logs
353344
# Logs are most useful when the command fails, always include them.
354345
if: ${{ always() }}

changelog.d/15566.bugfix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Require at least poetry-core v1.2.0.
1+
Require at least poetry-core v1.1.0.

changelog.d/15571.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Require at least poetry-core v1.1.0.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ furo = ">=2022.12.7,<2024.0.0"
368368
# system changes.
369369
# We are happy to raise these upper bounds upon request,
370370
# provided we check that it's safe to do so (i.e. that CI passes).
371-
requires = ["poetry-core>=1.2.0,<=1.5.0", "setuptools_rust>=1.3,<=1.6.0"]
371+
requires = ["poetry-core>=1.1.0,<=1.5.0", "setuptools_rust>=1.3,<=1.6.0"]
372372
build-backend = "poetry.core.masonry.api"
373373

374374

0 commit comments

Comments
 (0)