unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
359 stars 157 forks source link

Used trusted publishers for testpypi publishing #2320

Closed natestemen closed 3 months ago

natestemen commented 5 months ago

Description

This PR fixes the failing testpypi publishing action which runs nightly to ensure Mitiq can be uploaded to PyPI.

In addition it adds a check to ensure the version uploaded to testpypi is what is then later downloaded.

resolves https://github.com/unitaryfund/mitiq/issues/2150

⚠️ before merging ⚠️:

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.32%. Comparing base (e76ef08) to head (12b520f). Report is 88 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2320 +/- ## ========================================== + Coverage 98.29% 98.32% +0.02% ========================================== Files 90 87 -3 Lines 4274 4048 -226 ========================================== - Hits 4201 3980 -221 + Misses 73 68 -5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

natestemen commented 3 months ago

Reviewer Note: This change is still somewhat experimental and is hard to test thoroughly. We may want to merge these changes with the exception of https://github.com/unitaryfund/mitiq/pull/2320/commits/20aeef4d21287c53ee651c2bbb04787533b55683 which adds trusted publishing for (main) PyPI. This way we can ensure TestPyPI uploads work correctly before adding it to the main upload process. Also if there are issues, it gives us time to fix things before the 0.38 release goes out this Friday (June 28, 2024).

cosenal commented 3 months ago

Reviewer Note: This change is still somewhat experimental and is hard to test thoroughly. We may want to merge these changes with the exception of 20aeef4 which adds trusted publishing for (main) PyPI. This way we can ensure TestPyPI uploads work correctly before adding it to the main upload process. Also if there are issues, it gives us time to fix things before the 0.38 release goes out this Friday (June 28, 2024).

How do you plan to exclude that commit? Are you going to create a separate PR?

natestemen commented 3 months ago

How do you plan to exclude that commit? Are you going to create a separate PR?

Easiest thing to do (IMO) would be to add a new commit that is the anti-diff of https://github.com/unitaryfund/mitiq/pull/2320/commits/20aeef4d21287c53ee651c2bbb04787533b55683 (i.e. revert the commit), so that in a follow on PR the commit can be cherry-picked and applied.

cosenal commented 3 months ago

How do you plan to exclude that commit? Are you going to create a separate PR?

Easiest thing to do (IMO) would be to add a new commit that is the anti-diff of 20aeef4 (i.e. revert the commit), so that in a follow on PR the commit can be cherry-picked and applied.

OK, sounds good to me 👍

cosenal commented 3 months ago

@natestemen LGTM. Do you want to push the anti-diff commit before I approve?

natestemen commented 3 months ago

testpypi environment set up and testPyPI set up to know about this github action as a publisher. merging. will be tested tonight when this runs.