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

Require poetry>=1.3.2 #14860

Merged
merged 12 commits into from
Jan 17, 2023
Prev Previous commit
Next Next commit
Check the lockfile is version 2.0
Might one day incorporate other checks like #14742
  • Loading branch information
David Robertson committed Jan 17, 2023
commit 9382733c224edb4963196c9f262ed714bc37e61c
23 changes: 23 additions & 0 deletions .ci/scripts/check_lockfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#! /usr/bin/env python
import sys

if sys.version_info < (3, 11):
raise RuntimeError("Requires at least Python 3.11, to import tomllib")

import tomllib

with open("poetry.lock", "rb") as f:
lockfile = tomllib.load(f)

try:
lock_version = lockfile["metadata"]["lock-version"]
assert lock_version == "2.0"
except Exception:
print(
"""\
Lockfile is not version 2.0. You probably need to upgrade poetry on your local box
and re-run `poetry lock --no-update`. See the Poetry cheat sheet at
https://matrix-org.github.io/synapse/develop/development/dependencies.html
"""
)
raise
9 changes: 9 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ jobs:
- run: "pip install 'click==8.1.1' 'GitPython>=3.1.20'"
- run: scripts-dev/check_schema_delta.py --force-colors

check-lockfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- run: .ci/scripts/check_lockfile.py
DMRobertson marked this conversation as resolved.
Show resolved Hide resolved
lint:
uses: "matrix-org/backend-meta/.github/workflows/python-poetry-ci.yml@v2"
with:
Expand Down Expand Up @@ -163,6 +171,7 @@ jobs:
- lint-pydantic
- check-sampleconfig
- check-schema-delta
- check-lockfile
- lint-clippy
- lint-rustfmt
runs-on: ubuntu-latest
Expand Down