Skip to content

setuptools → flit - #4075

Open
DimitriPapadopoulos wants to merge 1 commit into
codespell-project:mainfrom
DimitriPapadopoulos:flit
Open

DimitriPapadopoulos wants to merge 1 commit into
codespell-project:mainfrom
DimitriPapadopoulos:flit

Conversation

@DimitriPapadopoulos

@DimitriPapadopoulos DimitriPapadopoulos commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

The switch removes lines from configuration files:

  • pyproject.toml: use flit_scm:buildapi (flit_core + flit_scm) as the PEP 517 build backend; replace [tool.setuptools.*] with [tool.flit.module] (package data inside codespell_lib/ is included in sdist and wheel automatically); keep [tool.setuptools_scm] so the SCM version is written to codespell_lib/_version.py at build time, which flit needs to resolve the dynamic version in isolated builds
  • codespell_lib: resolve version at runtime via importlib.metadata instead of importing the generated _version.py
  • drop twine from the dev dependency group, Makefile check-dist, and the release workflow: twine was only used for twine check --strict (publishing goes through pypa/gh-action-pypi-publish with trusted publishing), and flit validates the core metadata at build time (SPDX license expression, PEP 440 version, project name, entry points), refusing to build invalid artifacts. The check we lose is twine check's rendering of README.rst through readme_renderer, which was the only reason docutils was installed in tests.yml; flit only verifies the readme file exists and its content type
  • tests.yml, README.rst, .devcontainer: no longer install setuptools, setuptools_scm, docutils, or twine explicitly

- pyproject.toml: use flit_scm:buildapi (flit_core + flit_scm) as the
  PEP 517 build backend; replace [tool.setuptools.*] with
  [tool.flit.module] (package data inside codespell_lib/ is included
  in sdist and wheel automatically); keep [tool.setuptools_scm]
  so the SCM version is written to codespell_lib/_version.py at
  build time, which flit needs to resolve the dynamic version in
  isolated builds
- codespell_lib: resolve __version__ at runtime via importlib.metadata
  instead of importing the generated _version.py
- drop twine from the dev dependency group, Makefile check-dist, and
  the release workflow: twine was only used for `twine check --strict`
  (publishing goes through pypa/gh-action-pypi-publish with trusted
  publishing), and flit validates the core metadata at build time
  (SPDX license expression, PEP 440 version, project name, entry
  points), refusing to build invalid artifacts. The check we lose is
  `twine check`'s rendering of README.rst through readme_renderer,
  which was the only reason docutils was installed in tests.yml;
  flit only verifies the readme file exists and its content type
- tests.yml, README.rst, .devcontainer: no longer install setuptools,
  setuptools_scm, docutils, or twine explicitly

Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
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.

1 participant