Skip to content

Modernise upload to PyPI#1734

Merged
fcooper8472 merged 2 commits intomainfrom
1733-update-pypi-configuration
Mar 5, 2026
Merged

Modernise upload to PyPI#1734
fcooper8472 merged 2 commits intomainfrom
1733-update-pypi-configuration

Conversation

@fcooper8472
Copy link
Member

Switch to modern build directive

i.e. use:

python -m build

rather than

python setup.py sdist bdist_wheel

Switch to trusted publishing

I have added this specific workflow as a trusted publisher on PyPI, which means we no longer require the token. Once this is tested we should delete that from the repo secrets.

Following best practice, I have split the workflow into two jobs, one for building the distribution files. This can be run on all pushes and PRs to check the wheel and sdist build. The other does the upload.

@fcooper8472 fcooper8472 linked an issue Mar 5, 2026 that may be closed by this pull request
@fcooper8472 fcooper8472 marked this pull request as ready for review March 5, 2026 18:10
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.54%. Comparing base (1c825f9) to head (cf4cb7a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1734   +/-   ##
=======================================
  Coverage   99.54%   99.54%           
=======================================
  Files          97       97           
  Lines        9762     9762           
=======================================
  Hits         9718     9718           
  Misses         44       44           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Member

@MichaelClerx MichaelClerx left a comment

Choose a reason for hiding this comment

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

Looks good. Any idea if we can test it without doing a new release?

@fcooper8472
Copy link
Member Author

I've tested everything except the actual upload step, but there's no way to test that without a release.

Could always do a subminor release to test, without any code changes?

@fcooper8472 fcooper8472 merged commit 1af369a into main Mar 5, 2026
23 checks passed
@fcooper8472 fcooper8472 deleted the 1733-update-pypi-configuration branch March 5, 2026 18:51
@MichaelClerx
Copy link
Member

Yeah probably best to do an 0.6.1 immediately then, so we can delete the token etc before we forget about it

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.

Update PyPI configuration

2 participants