Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used trusted publishers for testpypi publishing #2320

Merged
merged 8 commits into from
Jun 27, 2024
Merged

Conversation

natestemen
Copy link
Member

@natestemen natestemen commented Apr 25, 2024

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 #2150

⚠️ before merging ⚠️:

  • create an environment (through GitHub) called testpypi [docs]
  • create an environment (through GitHub) called pypi (this will be done in a follow on PR when this change takes effect for the main release workflow)
  • ensure testpypi is set up properly to accept trusted publishing [docs]

`make install requirements` actually runs `make install`
@natestemen natestemen added the infrastructure For issues related to building, packaging, and continuous integration. label Apr 25, 2024
@natestemen natestemen self-assigned this Apr 25, 2024
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@            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     

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

.github/workflows/publish-testpypi.yml Outdated Show resolved Hide resolved
.github/workflows/publish-testpypi.yml Outdated Show resolved Hide resolved
.github/workflows/publish-testpypi.yml Outdated Show resolved Hide resolved
@natestemen natestemen marked this pull request as ready for review June 26, 2024 14:27
@natestemen
Copy link
Member Author

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).

@natestemen natestemen requested a review from cosenal June 26, 2024 14:31
@cosenal
Copy link
Contributor

cosenal commented Jun 26, 2024

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
Copy link
Member Author

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.

@cosenal
Copy link
Contributor

cosenal commented Jun 26, 2024

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
Copy link
Contributor

cosenal commented Jun 26, 2024

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

@natestemen natestemen changed the title Used trusted publishers for publishing Used trusted publishers for testpypi publishing Jun 26, 2024
@natestemen
Copy link
Member Author

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.

@natestemen natestemen merged commit c0e68a4 into main Jun 27, 2024
18 checks passed
@natestemen natestemen deleted the nts-trusted-pubs branch June 27, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure For issues related to building, packaging, and continuous integration.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up release workflow with PyPI Trusted Publishers
2 participants