-
-
Notifications
You must be signed in to change notification settings - Fork 547
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
Add CI jobs to upload nightly wheels to Anaconda #3945
base: develop
Are you sure you want to change the base?
Add CI jobs to upload nightly wheels to Anaconda #3945
Conversation
publish_anaconda: | ||
# This job is only of value to PyBaMM and would always be skipped in forks | ||
# It is meant to run on a schedule, when manually triggered, and does not | ||
# run on releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this job is configured differently and is isolated from the PyPI upload job for the reason that the latter uses the pypi
repository environment, which must not be accessed by other jobs (and also that GitHub Actions currently does not allow configuring an environment to a step inside a job).
- name: Move all package files to files/ | ||
run: | | ||
mkdir files | ||
mv windows_wheels/* linux_wheels/* macos_amd64_wheels/* macos_arm64_wheels/* files/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: the source distribution is not uploaded to Anaconda because it does not make sense to do so. The nightly uploads are supposed to be binary-only. It is therefore not copied into the files/
staging area for upload.
67360d3
to
6c031c8
Compare
mv windows_wheels/* linux_wheels/* macos_amd64_wheels/* macos_arm64_wheels/* files/ | ||
|
||
- name: Push to Anaconda PyPI index | ||
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's recommended to pin this action to a commit hash. I think we should do this for all of our other actions in other jobs too as a security measure (Dependabot will update both the hash and the version comment using regex).
This is still a draft because I need to add instructions for how to let people use these nightly wheels in the installation guide. I think I can prepare that locally, but it would make more sense to push those changes when we will have the repository secrets and the custom index configured for uploads (and subsequently downloads). I have shared the details for the procedure with Valentin. |
Do we have upload limits on anaconda? Nightly builds would make a lot of releases |
Yes, there is a 5 GB upload limit, but the action handles deleting releases older than N versions or M days automatically if one pushes multiple versions (N and M can be configured). I forgot to mention here that since we are not configuring any SCM-based versioning for the nightlies, they will be overwritten on each upload and we will not hit any limits. This is what I had sent to @tinosulzer the other day about the requirements here:
|
Ready for review now with a preliminary draft of the instructions, all we will need is to update the link when it is ready. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3945 +/- ##
========================================
Coverage 99.58% 99.58%
========================================
Files 257 257
Lines 21249 21249
========================================
Hits 21161 21161
Misses 88 88 ☔ View full report in Codecov by Sentry. |
Do we plan to configure any SCM-based versioning? |
Not for now until we migrate to a new build system. If we were to set up What I will suggest for this right now is to use local version identifiers as noted in PEP 440 to distinguish between PyPI releases and these nightlies, and therefore rename the wheel to add |
Bumping the version for built wheels would require a bit of restructuring in the workflow to update the version before building the nightlies and that means this should probably be done when we have some SCM-based versioning. I think we can go ahead with this workflow right now and (I merged the latest changes from The MO to test the nightlies is described in SPEC-0004, which means that PyBOP as a dependent will be implementing a weekly workflow which downloads the PyBOP and PyBaMM nightly wheels as such, something like: - name: Test nightly builds
run: |
pip install pybop pybamm --pre --extra-index-url https://pypi.anaconda.org/pybamm-and-friends/simple
pytest --pyargs pybop # or any other test invocation command (cc: @BradyPlanden), and a subsequent step/job can then open an issue for PyBOP about incoming failures due to changes in PyBaMM. It is to be noted that the use of Users should also look to use |
Co-authored-by: Eric G. Kratz <kratman@users.noreply.github.com>
Description
Note
For some of the follow-ups to and requirements for this PR, please read through the thread on #3251
This PR configures the
publish_pypi.yml
workflow (maybe we should rename it topublish_wheels.yml
now?) to add a job that uploads wheels to Anaconda. Currently, wheels will be uploaded on the same cadence as the workflow, so they are more like "fortnightlies" rather than nightlies.Fixes #3251
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ pre-commit run
(or$ nox -s pre-commit
) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python run-tests.py --all
(or$ nox -s tests
)$ python run-tests.py --doctest
(or$ nox -s doctests
)You can run integration tests, unit tests, and doctests together at once, using
$ python run-tests.py --quick
(or$ nox -s quick
).Further checks: