Skip to content

Switch packaging from poetry to setuptools and build - #31

Open
Thorsrud22 wants to merge 2 commits into
click-contrib:masterfrom
Thorsrud22:setuptools-build
Open

Thorsrud22 wants to merge 2 commits into
click-contrib:masterfrom
Thorsrud22:setuptools-build

Conversation

@Thorsrud22

@Thorsrud22 Thorsrud22 commented Sep 11, 2026 •

Copy link
Copy Markdown

Closes #21.

Replaces the poetry configuration with standard PEP 621 metadata and the setuptools build backend, as the issue proposes.

What changes

  • pyproject.toml: [tool.poetry] becomes [project]; poetry-core becomes setuptools>=61. Runtime dependency (click>=7), Python floor (>=3.8), README, license, author and URLs are carried over unchanged. Classifiers are added since poetry used to derive them.
  • Dev tools move to an optional extra, so a working checkout is now pip install -e .[dev] on any interpreter. pytest and mypy floors are raised to maintained versions (pytest>=7, mypy>=1.0). ruff stays pinned at 0.3.4 so the select = ["ALL"] rule set is unchanged.
  • src layout and py.typed are declared explicitly via [tool.setuptools].
  • CI installs with pip and runs ruff, mypy and pytest directly. The tag release job builds with python -m build and uploads with twine using the existing PYPI_TOKEN secret, so no new secrets or trusted-publisher setup is needed.
  • .gitignore drops the poetry.lock entry.

Verified locally on Python 3.8, 3.12 and 3.14: ruff check, ruff format --check, mypy src/ tests/ and pytest all pass, and python -m build produces a wheel containing __init__.py, py.typed and the license, with the same name, version and metadata as before.

Not in this PR

  • No lock file is added. None was committed before either (poetry.lock was gitignored), so this keeps the status quo. Happy to add a uv or pip-tools lock in a follow-up if wanted.
  • Version still lives in pyproject.toml. Integrate scm into package versioning #20 (versioning from git tags) is a natural next step now that the backend is setuptools, e.g. via setuptools-scm.

The build badge still linked to Travis CI, which the project no longer
uses; CI has run on GitHub Actions (cicd.yml) since 2024. Also fix
"Or you it in" -> "Or use it in".

Closes click-contrib#22
Replace the poetry-specific pyproject sections with PEP 621 [project]
metadata and the setuptools build backend. Dev tools move to a
`dev` extra so `pip install -e .[dev]` sets up a working checkout on
any interpreter without a separate tool.

CI installs with pip and runs ruff, mypy and pytest directly; the tag
release job builds with `python -m build` and uploads with twine using
the existing PYPI_TOKEN secret.

pytest and mypy floors are raised to currently maintained versions
(pytest>=7, mypy>=1.0). ruff stays pinned to 0.3.4 so the lint rule set
under select = ["ALL"] is unchanged.

Closes click-contrib#21
@Thorsrud22
Thorsrud22 force-pushed the setuptools-build branch 2 times, most recently from 41555ab to 51866db Compare September 16, 2026 18:25
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.

Switch from poetry to plain setuptools and build

1 participant