Skip to content

Switch from Poetry to uv#452

Open
sandhose wants to merge 2 commits intoquenting/modern-tooling/python-3.10from
quenting/modern-tooling/uv
Open

Switch from Poetry to uv#452
sandhose wants to merge 2 commits intoquenting/modern-tooling/python-3.10from
quenting/modern-tooling/uv

Conversation

@sandhose
Copy link
Copy Markdown
Member

@sandhose sandhose commented Apr 2, 2026

Summary

  • Swap build backend from poetry-core to uv_build
  • Replace poetry.lock with uv.lock, delete MANIFEST.in
  • Rewrite Dockerfile: use ghcr.io/astral-sh/uv:python-* base image, upgrade to Debian trixie, add UV_PYTHON_DOWNLOADS=0, use docker.io/library/python for runtime
  • Update CI: replace matrix-org/setup-python-poetry with astral-sh/setup-uv
  • Update olddeps CI to use uv sync --resolution=lowest-direct
  • Remove TEST_ONLY_* Docker build args (that was never used and copied over Synapse)

Known limitations

Test plan

  • uv sync installs successfully
  • CI green: linting, type checking, unit tests, olddeps, Docker build + proxy check
  • docker build -f docker/Dockerfile . succeeds

Part 1 of 7 in the repository modernisation series. Builds on #459.

@sandhose sandhose force-pushed the quenting/modern-tooling/uv branch 12 times, most recently from 2aa588c to b63d6d9 Compare April 3, 2026 13:24
@sandhose sandhose changed the base branch from main to quenting/modern-tooling/python-3.10 April 3, 2026 13:25
@sandhose sandhose force-pushed the quenting/modern-tooling/uv branch from b63d6d9 to a094f02 Compare April 3, 2026 13:28
@sandhose sandhose force-pushed the quenting/modern-tooling/python-3.10 branch from 0a6e24f to 8fac562 Compare April 3, 2026 13:28
@sandhose sandhose force-pushed the quenting/modern-tooling/uv branch from a094f02 to a0ed884 Compare April 3, 2026 13:33
@sandhose sandhose force-pushed the quenting/modern-tooling/python-3.10 branch from 8fac562 to 1215718 Compare April 3, 2026 13:33
@sandhose sandhose force-pushed the quenting/modern-tooling/uv branch 2 times, most recently from 2ca957a to 9823327 Compare April 3, 2026 13:49
@sandhose sandhose force-pushed the quenting/modern-tooling/python-3.10 branch from 1215718 to 2ad3c6f Compare April 3, 2026 13:49
@sandhose sandhose force-pushed the quenting/modern-tooling/uv branch from 9823327 to ea1433a Compare April 3, 2026 14:00
sandhose added 2 commits April 3, 2026 16:01
Convert pyproject.toml from Poetry to PEP 621 + uv_build backend.
Replace poetry.lock with uv.lock. Update CI workflows to use
astral-sh/setup-uv. Rewrite Dockerfile as a clean multi-stage uv
build. Remove obsolete MANIFEST.in.
@sandhose sandhose force-pushed the quenting/modern-tooling/python-3.10 branch from 2ad3c6f to 21c4d93 Compare April 3, 2026 14:10
@sandhose sandhose force-pushed the quenting/modern-tooling/uv branch from ea1433a to 585d548 Compare April 3, 2026 14:20
@sandhose sandhose marked this pull request as ready for review April 3, 2026 14:47
@sandhose sandhose requested a review from a team as a code owner April 3, 2026 14:47
Copy link
Copy Markdown
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm otherwise, assuming it works and the sdist looks clean & comparable (& installs properly)

# Instead, we'll just install what a regular `pip install` would from PyPI.
ARG TEST_ONLY_IGNORE_POETRY_LOCKFILE
# Don't download Python — use the one from the base image.
ENV UV_PYTHON_DOWNLOADS=0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is cryptic and doesn't appear as a valid option in the docs https://docs.astral.sh/uv/reference/settings/#python-downloads
suspect never was meant

touch /sygnal/requirements.txt; \
fi
# Compile bytecode for faster startup in production.
ENV UV_COMPILE_BYTECODE=1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this better as true?

disallow_untyped_defs = False

[mypy-sygnal.helper.proxy.proxyagent_twisted]
ignore_errors = True
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm?


[testenv]

# As of twisted 16.4, trial tries to import the tests as a package (previously
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lost comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants