Skip to content

Fix tox -e build failing on Python 3.8–3.10 with "'2.5' is not a valid metadata version" - #386

Open
annahedstroem with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-failing-tests
Open

annahedstroem with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-failing-tests

Conversation

Copilot AI commented Oct 16, 2026

Copy link
Copy Markdown

On Python 3.8–3.10, CI passes the tests but fails at twine check --strict with InvalidDistribution: '2.5' is not a valid metadata version. The failure is unrelated to the docs-only change in #384. flit_core now writes metadata 2.5, which the older twine/packaging that tox installed on those Pythons cannot parse.

  • tox.ini ([testenv:build]): set minimum versions twine>=6.1.0 and packaging>=24.2, so metadata 2.5 validates.

Not verified locally or in CI. twine 6.1.0 may not install on Python 3.8, since it may require a newer Python. If the 3.8 job still fails, the alternative is to pin flit_core to a version that emits older metadata.

Co-authored-by: annahedstroem <29717021+annahedstroem@users.noreply.github.com>
@annahedstroem
annahedstroem marked this pull request as ready for review October 16, 2026 23:17
Copilot AI balanced review requested due to automatic review settings October 16, 2026 23:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The dependency bounds still permit validators that reject metadata 2.5, leaving older-Python compatibility unresolved.

1 open issue
What changed in this PR

Attempts to fix distribution validation failures on Python 3.8–3.10 by updating the tox build environment’s dependency requirements.

Changes:

  • Requires twine>=6.1.0.
  • Adds packaging>=24.2.
File Description
tox.ini Sets minimum validator dependency versions in the build environment.

Review effort: Balanced

Comment thread tox.ini
Comment on lines +37 to +38
twine>=6.1.0
packaging>=24.2

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Constrained the isolated build backend to flit-core <3.11 so builds retain metadata compatible with the older Twine validator. Commit: 6f276b6. The configured distribution build could not run here because tox, build, and twine are unavailable.

Co-authored-by: annahedstroem <29717021+annahedstroem@users.noreply.github.com>
@codecov-commenter

codecov-commenter commented Oct 21, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.35%. Comparing base (85bc29d) to head (c764312).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #386   +/-   ##
=======================================
  Coverage   89.35%   89.35%           
=======================================
  Files          67       67           
  Lines        4226     4226           
=======================================
  Hits         3776     3776           
  Misses        450      450           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@annahedstroem

Copy link
Copy Markdown
Member

@copilot can you make top-k tests deterministic by setting "k": 1500, instead of "k": 1250, in tests/metrics/test_localisation_metrics.py?

Co-authored-by: annahedstroem <29717021+annahedstroem@users.noreply.github.com>

Copilot AI commented Oct 23, 2026

Copy link
Copy Markdown
Author

@copilot can you make top-k tests deterministic by setting "k": 1500, instead of "k": 1250, in tests/metrics/test_localisation_metrics.py?

Changed the test_top_k_intersection case to use k: 1500. Commit: 9c3201e. git diff --check passed; I couldn’t run the focused pytest because pytest is unavailable in this environment.

Co-authored-by: annahedstroem <29717021+annahedstroem@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

4 participants