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

Generate nightly releases on TestPyPI #6010

Merged
merged 7 commits into from
Jul 26, 2024
Merged

Generate nightly releases on TestPyPI #6010

merged 7 commits into from
Jul 26, 2024

Conversation

dime10
Copy link
Contributor

@dime10 dime10 commented Jul 17, 2024

As part of our ongoing effort to make development across the PennyLane ecosystem easier, this PR introduces nightly releases of the PennyLane package to TestPyPI.

For some context, there has been a strong need for Catalyst development builds to made accessible to PennyLane (and other developers), similar to how PennyLane already depends on Lightning development builds. Beyond helping developers, they are typically needed in order to run CI tasks such as pennylaneAI/qml builds or the compiler tests in this repo.

A complication of this process is that Catalyst itself will usually depend on the development version of PennyLane in order to stay compatible with PL or to get access to recent modifications.
Previously, this has been handled by pointing pip directly to the github repository, e.g. with pip install git+https://github.com/pennylaneai/pennylane@{tag} or pennylane @ git+https://github.com/pennylaneai/pennylane@{tag} in requirement specifications such as setup.py. The latter form is particularly useful because it means a build of catalyst (as a wheel) can automatically fetch the right version of pennylane upon installation (where {tag} is a specific commit on the master branch), providing reproducible builds that will continue to work in the future.
The only problem is that uploading to PyPI is not possible with package dependencies that don't come from PyPI (i.e. GitHub in this case). The proposed solution is to make regular development builds of all PennyLane ecosystem packages available on TestPyPI.


This PR introduces a GitHub action that:

  • runs every weekday morning on the master branch
  • bumps the pennylane package version (e.g. from 0.38.0-dev0 to 0.38.0-dev1)
  • builds and uploads a pennylane wheel to TestPyPI

In order to function, we will need to setup trusted publishing on testpypi for this workflow (very easy), a recent feature which bypasses the need for token authentication.

[sc-69108]

@dime10 dime10 requested a review from albi3ro July 17, 2024 16:23
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@dime10 dime10 requested a review from mudit2812 July 17, 2024 18:05
Copy link
Contributor

@mudit2812 mudit2812 left a comment

Choose a reason for hiding this comment

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

Thanks @dime10 ! Looks good to me. Is there a way to check if the action actually works other than just merging and checking? I guess we could add an "on push" trigger to the action to see if an upload works. If not, we could just merge and pray 😅 .

.github/workflows/upload-nightly-release.yaml Outdated Show resolved Hide resolved
@dime10
Copy link
Contributor Author

dime10 commented Jul 18, 2024

Thanks @dime10 ! Looks good to me. Is there a way to check if the action actually works other than just merging and checking? I guess we could add an "on push" trigger to the action to see if an upload works. If not, we could just merge and pray 😅 .

Yes we can definitely test it by adding a temporary trigger, which is what I did for the catalyst equivalent. It's a good idea to test once before merging :)
The only problem is that PR actions do not run on a branch (they actually run on a temporary ref that is the merge of the base branch with the pr branch), so the push would fail. But we can comment it out and test the remainder of the action once we have set up trusted publishing on the TestPyPI website. For this we need someone with admin permissions for PennyLane over on PyPI.

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.65%. Comparing base (a456fce) to head (d7920df).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6010      +/-   ##
==========================================
- Coverage   99.65%   99.65%   -0.01%     
==========================================
  Files         428      430       +2     
  Lines       41160    41146      -14     
==========================================
- Hits        41020    41005      -15     
- Misses        140      141       +1     

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

Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Thanks @dime10
One quick change, and then I'm happy to approve

.github/workflows/upload-nightly-release.yml Outdated Show resolved Hide resolved
@mlxd mlxd merged commit 30d5953 into master Jul 26, 2024
40 checks passed
@mlxd mlxd deleted the dime10/nightly-wheels branch July 26, 2024 18:10
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.

4 participants