Open jherland opened 1 month ago
An excellent resource for comparing Poetry and similar Python development and packaging-related tools: https://alpopkes.com/posts/python/packaging_tools/#tools-that-do-not-fit-the-categories
(found via the Talk Python to Me podcast: https://www.youtube.com/watch?v=sxN-Iu-okdo)
The Python community seems to be adopting PEP621 for storing project metadata in
pyproject.toml
. We have been using Poetry from the start of FawltyDeps, which uses a different Poetry-specific format. Although it's not vitally important for us to follow PEP621, it would be nice to follow best practices in the Python community here.There is some movement in Poetry to allow support for PEP621 metadata, but we don't know if or when this would be merged:
What are we using Poetry for?
CONTRIBUTING.md
:shell.nix
perform similar commands to create/enter the Poetry dev shell..github/workflows/
follow the same pattern):Gr1N/setup-poetry@v8
~/.cache/pypoetry/virtualenvs
, the cache key includes a hash of thepoetry.lock
file.poetry install --no-interaction --sync --with=$DEPENDENCY_GROUPS
or similar to setup environment (this is instead of Nox' setup).poetry run nox --no-venv --no-install --non-interactive -s ...
to run the Nox action.requirements.txt
file that can be consumed by Nox'ssession.install()
:poetry export --format=requirements.txt --output=.../reqs_from_poetry.txt --with=...
or similarreqs_from_poetry.txt
file is passed to Nox'session.install("-r", ...)
poetry config pypi-token.pypi <token>
[tool.poetry]
section inpyproject.toml
.poetry build
andpoetry publish
accomplishes the actual release.publish
CI action performs similar steps to publish a test release to https://test.pypi.org/project/fawltydeps/Problems with Poetry?
poetry.lock
file is sometimes really slow. Have to run with--no-update
to prevent unrelated updates to dependencies.uv
: https://github.com/astral-sh/uv?tab=readme-ov-file#resolution-strategyAlternatives?
uv
can be used to create/install venvs very quickly.uv
only produces resolutions for a single platform and Python version at a time. Unlike Poetry (and PDM),uv
does not yet produce a machine-agnostic lockfile. What changes does this mean for our workflow?Remaining Questions?
uv
to recreate virtualenvs really quickly?