Skip to content

Conversation

JeanChristopheMorinPerso
Copy link
Member

@JeanChristopheMorinPerso JeanChristopheMorinPerso commented Oct 19, 2021

Fixes #988 .

Take two of publishing to PyPI. This builds on #1099 .

This PR introduces a completely new workflow called publish (original isn't it?). This new workflow is triggered by a release. The python-package also has a separate job to build the sdist.

Compared to #1099 , the publishing is no more triggered by pushing tags.

The release process would look like this:

  1. Merge all PRs that needs to go into the release.
  2. Create a pull request for bumping the version to the one we want to use for the release, add changelog, etc.
  3. Merge PR from step 2 and wait for the build to finish.
  4. If we want to test the release, now it's time. We can use maintainers/download_gha_artifact.py to download the wheels locally and manually upload them in https://test.pypi.org if we want.
  5. Once the artifacts are confirmed to be working as expected, we can tag the commit that resulted from the merge at step 3.
  6. Push the tag.
  7. Create a release in Github.
  8. The new publish workflow will kick in. It will download the artifacts from the tag associated to the release and upload them to https://pypi.org.
  9. Now bump the version to the next version and a .dev... at the end.

I tested all this in my OpenTimelineIO fork. You can see the commit that I used for the tag (v0.14.0.dev5) here and the actual release here. The release can be seen here

This PR also introduces a script to download wheels from a build. Handy if you want to upload wheels in https://test.pypi.org for example. The script by default only requires to pass the commit hash (the full length one) and a GitHub Personal Access Token.

./maintainers/download_gha_artifact.py <commit hash> <your token>

Additional parameters can be used to set the workflow name from which to download the artifact., the artifact name and the directory where the artifact will be extracted to.

The output looks like:

Found workflow:
  Name:       OpenTimelineIO
  Branch:     pypi_upload
  Commit:     7c521b04a50df40596feae0c2802be7ff3198a16
  Committer:  {'name': 'Jean-Christophe Morin', 'email': '[email protected]'}
  Run Number: 87
  Status:     completed
  Conclusion: success
  URL:        https://github.com/JeanChristopheMorinPerso/OpenTimelineIO/actions/runs/1356958062
Getting list of artifacts
Downloading 'wheels' artifact and unzipping to 'dist'
Writing 'jcmorin_OpenTimelineIO-0.14.0.dev5-cp27-cp27m-macosx_10_9_x86_64.whl' to 'dist/jcmorin_OpenTimelineIO-0.14.0.dev5-cp27-cp27m-macosx_10_9_x86_64.whl'
... truncated for the purpose of the PR description

I hope this covers what we discussed in the last TSC meeting. If not let me know and I'll adjust.

@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2021

Codecov Report

Merging #1110 (2b4b261) into master (aada787) will increase coverage by 3.54%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1110      +/-   ##
==========================================
+ Coverage   82.78%   86.32%   +3.54%     
==========================================
  Files          75      191     +116     
  Lines        3306    19004   +15698     
  Branches        0     2105    +2105     
==========================================
+ Hits         2737    16406   +13669     
- Misses        569     2052    +1483     
- Partials        0      546     +546     
Flag Coverage Δ
unittests 86.32% <ø> (+3.54%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...py-opentimelineio/opentimelineio/adapters/otioz.py 81.39% <0.00%> (ø)
...-opentimelineio/opentimelineio/plugins/__init__.py 100.00% <0.00%> (ø)
tests/test_serializable_collection.py 94.11% <0.00%> (ø)
...opentimelineio/opentimelineio/schema/transition.py 100.00% <0.00%> (ø)
tests/test_composable.py 92.59% <0.00%> (ø)
...elineio/opentimelineio/algorithms/timeline_algo.py 100.00% <0.00%> (ø)
...ineio/opentimelineio/adapters/file_bundle_utils.py 73.52% <0.00%> (ø)
tests/test_marker.py 94.28% <0.00%> (ø)
src/py-opentimelineio/opentimelineio/schema/foo.py 0.00% <0.00%> (ø)
.../py-opentimelineio/opentimelineio/schema/marker.py 100.00% <0.00%> (ø)
... and 106 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aada787...2b4b261. Read the comment docs.

@meshula
Copy link
Collaborator

meshula commented Oct 19, 2021

I propose we get an hour on the calendar, go through the workflow once with the TSC, and commit this, ASAP.

I am very excited for this version.

@tin2tin
Copy link

tin2tin commented Oct 19, 2021

Great job. This one installs fine in Blender 2.93 on Windows:
python -m pip install -i https://test.pypi.org/simple/ jcmorin-OpenTimelineIO==0.14.0.dev5

@JeanChristopheMorinPerso
Copy link
Member Author

I propose we get an hour on the calendar, go through the workflow once with the TSC, and commit this, ASAP.

Makes sense. I'll let the TSC coordinate?

Also thanks @tin2tin for the time you took to test:)

@meshula meshula merged commit 64fcb60 into AcademySoftwareFoundation:master Oct 21, 2021
@JeanChristopheMorinPerso JeanChristopheMorinPerso deleted the pypi_upload_2 branch October 21, 2021 18:13
@ssteinbach ssteinbach added this to the Public Beta 14 milestone Oct 26, 2021
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.

PyPI Publish github action
5 participants