Skip to content

Conversation

@sirosen
Copy link
Member

@sirosen sirosen commented Dec 23, 2025

Switching to flit-core moves us to a more modern but very minimal backend (flit-core is considered the simplest production-ready PEP 517 backend and has no dependencies).
This change allows us to establish some tighter control over our build process, but driven by check-sdist, which is configured to verify our includes/excludes.

Although debatable, this change makes the decision to strip out the various testing and linting tools from the builds. (tox.ini, tests/*, etc)
The rationale is that slimmer builds install faster (good) and that redistributors should always be working from the source repo anyway (so that they are not trusting our builds, Trusted Publishing notwithstanding).

Changes:

  • Switch from setuptools to flit-core as a build backend
  • Setup check-sdist config + flit config to control and audit build contents
  • Update the 'twine-check' job to a 'check-package-data' job instead, which runs check-sdist (this could be moved to a separate tox env if preferable)

I hesitated about not including a changelog for this, but for 99% of users the impact is nil.
Therefore, there is no changelog entry. One can be added on request during review.

Not included: this does not yet configure reproducible builds, but flit-core does support this as long as SOURCE_DATE_EPOCH is set. That is intended as a small fast-follow.

@sirosen sirosen added the no-news-is-good-news This change does not require a news file label Dec 23, 2025
sirosen and others added 2 commits December 29, 2025 09:48
- Switch from setuptools to flit-core as a build backend
- Setup check-sdist to ensure that build contents are well controlled
- Explicitly exclude tests and dev tooling from builds (ensuring we
  build a minimal package; redistributors should use the source repo)
- Update the 'twine-check' job to a 'check-package-data' job instead
- Set the interpreter version for the check-package-data tox env to 3.10
  (3.9 would be ideal but conflicts with some deps)

- Set `--strict` in `twine check`

- Build in the tox envdir and use `recreate = true` to ensure it's always
  a clean build with no cached dependencies

- Implement a "minimum" factor which pins the build backend version
  (`flit-core==3.11`) via a constraints file, which is created
  ephemerally inside of the tox env

Co-authored-by: Kurt McKee <[email protected]>
@sirosen sirosen force-pushed the switch-to-flit-core-and-check-sdist branch from 3017c96 to c00d3e5 Compare December 29, 2025 16:10
Rather than using `PIP_CONSTRAINT`, do the builds with `--no-isolation`
to guarantee that we are controlling the environment. Because under
`tox-uv` it is possible to have a test environment where `pip` is not
available, the `PIP_CONSTRAINT` technique is not guaranteed to be
effective.
commands = python scripts/ensure_min_python_is_tested.py

[testenv:twine-check]
[testenv:check-package-data{,-minimum}]
Copy link
Member

Choose a reason for hiding this comment

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

One thing that occurs to me is that it would be nice for this to be added to the env_list so that it runs locally as well, but my approval for this PR still stands.

@sirosen sirosen merged commit f897f5f into globus:main Dec 29, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-news-is-good-news This change does not require a news file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants