Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.

chore(release): update pypi packaging #604

Merged
merged 51 commits into from
Feb 6, 2025

Conversation

thomasrockhu-codecov
Copy link
Contributor

@thomasrockhu-codecov thomasrockhu-codecov commented Jan 26, 2025

  • splits build_assets and build_for_pypi into separate workflows that run on
  • they also run on new tags
  • adds pyproject.toml because its what should be used over setup.py
  • splits the build and deploy job for the build_for_pypi workflow
  • small opentelem thing to not run on tests

fixes #466

Copy link

codecov bot commented Jan 26, 2025

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
3560 5 3555 0
View the top 3 failed tests by shortest run time
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link

github-actions bot commented Jan 26, 2025

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

@thomasrockhu-codecov thomasrockhu-codecov changed the title feat: first pass at new packaging chore(release): update pypi packaging Jan 27, 2025
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Copy link
Contributor

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

Just realized that the environment isn't set. Here's a patch to fix this. Additionally, add required reviewers to the environment called pypi in the repo settings.

thomasrockhu-codecov and others added 2 commits February 5, 2025 18:18
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
@webknjaz
Copy link
Contributor

webknjaz commented Feb 6, 2025

@thomasrockhu-codecov additionally to that incorrect URL that I suggested initially, could you confirm you've enabled required reviewers in the environment called pypi? There's been discussions about this topic recently, when TP was being integrated into pip: pypa/pip#13048 (comment). I recommend having this gate just to be in control of the process.

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
@thomasrockhu-codecov
Copy link
Contributor Author

@webknjaz

image

Copy link
Contributor

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

LGTM

@thomasrockhu-codecov thomasrockhu-codecov merged commit 1bd492c into main Feb 6, 2025
27 of 28 checks passed
@thomasrockhu-codecov thomasrockhu-codecov deleted the th/rebuild-packaging branch February 6, 2025 17:21
@thomasrockhu-codecov
Copy link
Contributor Author

@thomasrockhu-codecov
Copy link
Contributor Author

just kidding, I think I got it

@webknjaz
Copy link
Contributor

webknjaz commented Feb 19, 2025

@thomasrockhu-codecov oh, #620 broke it. Trusted Publishing doesn't yet support auth from reusable workflows due to different security considerations that aren't yet worked out fully. It's a limitation of how PyPI implements trust currently. It sometimes works almost by accident but we treat that as unsupported. This is being designed slowly, but no ETA so far.

To combine it with testing, I usually have a top-level workflow with the conditional publishing jobs and that workflow calls a few reusable ones, while keeping pypi-publish in the top level one.

P.S. When testing out publishing automation updates, I tend to use pre-release versions (a0/b0/rc0 etc). They are not picked up by installers by default so there's not as much harmful impact in terms of confusing the end users.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GHA+PyPI+packaging shortcomings
3 participants