-
Notifications
You must be signed in to change notification settings - Fork 3
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
Automated publishing to PyPI and GitHub Releases on PR to release branch #26
Conversation
…ears on the PyPI website.
Hey Adam, This looks good. A few thoughts:
|
What you your thoughts on the release branch? Is it the case they every time something is pushed/merged into release, PyPI should be updated and use the development branch as the place for intermediate changes? Or will there be time that things are pushed to the release branch but PyPI doesn't need to be updated? If we want PyPI to be the same as the release branch then building on every push seems reasonable. We could also just move the build call into the block that handles the tag/PyPI stuff. In case you were wondering I got the original action from: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ at the bottom there is an arrow to "... display the entire GitHub Actions CI/CD workflow definition." I think the idea of automatic versioning based on the tag is a great idea. No idea how to do that currently, but that could save us a decent amount of time and many errors with the version number. Why are we using the date as a version number? Do you like it because you immediately know when the code was written vs a seemingly random set of numbers that other projects use: 1.4.21.15? Edit: |
I meant to also link to our item that automatically creates a build and publishes it as a GitHub release too: https://github.com/Water-Systems-Management-UCM/Stormchaser/blob/release/.github/workflows/build_to_release.yml - not perfect, but in case it's useful. One other item we should consider is if we can make this action wait to run until after all the tests have completed. Theoretically nothing gets to the release branch unless tests pass, but just in case? We could also just strengthen branch protections if there's no way to make this action only run after the others complete. So, I'm wondering if maybe rather than having it based on manual tagging of releases, we instead have something as part of our pull request actions that checks to make sure the version is greater than the version available on PyPI? I don't know - I'm going around in circles on this. To answer your question. I like date based because it's simple and it makes clear to people that it doesn't mean anything other than the date it was published. We should probably prefix it with a leading And I wondered about that same thing you mentioned about builds running regardless. I think that's sensible. |
Also, please add me as an Owner on PyPI when you get a chance: https://pypi.org/manage/project/eedl/collaboration/ - my PyPI username is nicksan (not the same as my GitHub) |
Thanks for the quick action on that. I just deleted the existing release so that we don't get version issues if we change version schemes. I'm going to prefix the versions with a 0 right now so that we can always opt for another versioning scheme later by going to version 1.0. |
I'm thinking more and more that we shouldn't do the method I discussed about only releasing when a specific tag is added. That seems more complicated and brittle. I think we should release whenever a commit is merged to the release branch - that should then upload a build/release to GitHub, a build/release to PyPI, and a build/release to conda-forge (when we get there - I don't see that as a blocker for this PR). Does that sound good to you? Then, we can strengthen any checks we need for what gets released by ensuring it's all run as an action, and we prevent committing directly to release (big no-no - and maybe the upload script only runs on PRs to release to ensure that code committed directly doesn't make it) |
We've settled on a strategy:
We agree to keep using date-based version strings for now. We want to publish released packages whenever merging to the release branch, but not when we make changes to t |
Hey Adam - this looks good overall so far. My only comment is to ask whether you can turn off the part of your code reformatting that is automatically capitalizing the first letter of comments. I don't think it adds to clarity, and it's going to make any tracing of bugs a pain by messing up git blames. If you think it is helpful, then we can set a style guide and I can add that to my own, but I don't think that's necessary unless you do. |
No description provided.