pymc-labs / CausalPy

A Python package for causal inference in quasi-experimental settings
https://causalpy.readthedocs.io
Apache License 2.0
829 stars 53 forks source link

Enable manual triggering of the PyPI release workflow #317

Open drbenvincent opened 2 months ago

drbenvincent commented 2 months ago

When I released 0.2.3, the release.yml workflow (which uploads a new version to PyPI) failed. The cause of this was fixed in #316. I want to manually trigger this action so that 0.2.3 gets uploaded to PyPI without having to do another version bump.

It should be possible to manually trigger this workflow through the GitHub webpage https://github.com/pymc-labs/CausalPy/actions/workflows/release.yml but currently there is no "Run Workflow" button. I followed the instructions here https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow?tool=webui and have basically added workflow_dispatch as another trigger for this action. If I've done this correctly then this should enable manual triggering of this action through the GitHub webpage.

Though I'm not sure this alone will work, because there are additional requirements for some of the steps, e.g. if: github.event_name == 'release' && github.event.action == 'published' for the publish job.

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 77.10%. Comparing base (dbaa17b) to head (c721c66).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #317 +/- ## ======================================= Coverage 77.10% 77.10% ======================================= Files 21 21 Lines 1380 1380 ======================================= Hits 1064 1064 Misses 316 316 ```

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

drbenvincent commented 2 months ago

If this is tricky, it could be surplus to requirements. I am always able to manually upload to PyPI with my API tokens.

lucianopaz commented 2 months ago

Sorry that I missed the request for reviewing some days ago. If what you want is to be able to push a release to pypi if the release workflow failed, then you don’t need this. Pypi releases are different from GitHub releases. Pypi releases cannot be amended. If you make a mistake, you can remove a release number from pypi, but you’ll never be able to use that release number again. That’s why pypi forces you to have to push a new release number always. GitHub releases are completely different. You can amend their release notes, you can delete them and then push them again using the exact same number as before. The only limitation is that if your upload to pypi succeeded, then you shouldn’t try to change the contents of the GitHub release (you still can do it, but the changes won’t be pushed up to pypi). So you can remove the 0.2.3 release and tag from GitHub, and then start the 0.2.3 release again using the fixed commit. The workflow should run successfully and finally push to pypi.

drbenvincent commented 2 months ago

Thanks, and sorry for the delayed reply @lucianopaz. From what I recall, the PyPI workflow failed so the 0.2.3 never really got initiated on PyPI. So I just manually ran through the PyPI release workflow and now there is a CausalPy 0.2.3 on PyPI.

So if I understand correctly we can just close this PR?