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
344 stars 145 forks source link

correctly set and pass mitiq `VERSION` env var #2428

Open natestemen opened 3 days ago

natestemen commented 3 days ago

Description

The upload to testpypi action is failing at the last stage where it compares the downloaded version against what's in VERSION.txt. This is because Mitiq is (rightfully) not checked out when downloading Mitiq from testpypi. Details here. To fix this I've set a VERSION variable when Mitiq is checked out and passed the data to the verify version portion of the action.

Documentation reference for setting output between jobs: https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs#example-defining-outputs-for-a-job

I have a concern that even though the first two stages passed, the uploaded version seems to be 0.38.0.dev0 (with an extra 0 on the end). Hence even if this works, we might still have a problem.

natestemen commented 3 days ago

Ah so it looks like when pypi sees a version number that ends in dev, it automatically assumes it is a pre-release. Hence when we download from testpypi after the successful upload, we will always get the latest stable version, which as of 06/27/2024 is 0.9.0.

This is the standard for versioning numbers/info: https://peps.python.org/pep-0440/

codecov[bot] commented 3 days ago

Codecov Report

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

Project coverage is 98.32%. Comparing base (d7c3578) to head (ae62b57).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2428 +/- ## ======================================= Coverage 98.32% 98.32% ======================================= Files 87 87 Lines 4048 4048 ======================================= Hits 3980 3980 Misses 68 68 ```

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