-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Avoid conflicts with multiple test pypi releases that have the same version #20
Comments
Personally, i think some kind of overwrite option would be desirable for test PyPi to avoid countless bumps. |
@vpetersson don't think you can overwrite on pypi it's a limitation on their side. But you can just use alpha/beta/release candidate releases no? 0.1 Etc etc |
Having said that, this answer is interesting https://stackoverflow.com/a/63944201/1965921 But TBH, I don't see how that's any easier than just incrementing an alpha / beta release. Or incrementing a micro number instead like 0.2.1, 0.2.2 etc etc Could use some automated versioning tool to do this without manual intervention also |
The reason why i don't like manually bumping is that it takes too many steps (tag, push tag, create release). When you just want to push a quick fix, that's too much effort. Maybe a quick-and-dirty solution is to simply run |
@vpetersson for test pypi you don't have to tag anything. You just update the version in setup.py |
FWIW my issues with the manual bump are less to do with the manual intervention required, but more-so:
|
@marvinmarnold maybe it's best to only build testpypi when tagging rather than automatically? |
Yea, that's prob the easiest thing to do now. @vpetersson I'm going to pull this into the current sprint because its small work but a big pain in the butt. |
or something similar to NebraLtd/hm-pktfwd#61 |
This is a partial fix for #20 which will avoid trying to upload the file to PyPI when version number hasn't changed in setup.py This means we can allow other tests to proceed and get a green tick in PRs without having to constantly bump version number. This will uploads build artifacts so the build is still available for testing, just not from PyPI
Currently looking into a way that we can avoid the conflicts and have a way to automatically bump the version number. I found this https://github.com/c4urself/bump2version/#installation which seems to handle all of it for you in one command. It will bump the version with options for major/minor/revision and handles the git tags as well! I'll try to look into it on a staging environment to see how well it works before I make the decision to implement it on prod |
I've created a pull request with the bump2version fix |
Closed by #48 |
IMO this isn't really fixed. The bump2version, whilst it sort of does what we want, it's very limited and feels to me more like a stop gap. Also, if we are going to be using this even for a short period of time, the auto version bumping should only be for patch level not minor. Otherwise we are going to be bumping minor versions even for things as basic as a typo fix. Which should at best be a patch. I feel like to be properly fixed this needs something more robust that takes into account the actual flow of PyPI (alpha, beta, RC releases) and that the major, minor, patch is automatically generated not arbitrarily but by actual human intervention/tagging... For example: In a commit message. Or something to that effect. |
@shawaj I can take a look and see if I can do something with a commit but I will change this to update it by patch version until then, I know bump2version supports the different channels of PyPI such as alpha, beta, and release so I can also include that in the commit message as well. I created a PR for having bump2version only run on the master branch here #51 |
From a purist perspective if this was a widely used library, I would agree. That is not the case here, as we are just using it internally. We need to be pragmatic. The goal right now is to increase velocity and be able to iterate fast. In six to twelve months when things are stable and we have a more regular release cadence with release notes etc, but this is very much premature optimization and will just add a lot more complexity. |
@SebastianMaj it looks like there was a regression. We've reintroduced test pypi conflicts, see: https://github.com/NebraLtd/hm-pyhelper/runs/4143321632?check_suite_focus=true |
I've got the workflow working in a local environment: https://github.com/SebastianMaj/hm-pytester The current issue we are facing now is master branch is a protected branch and it's preventing any pushes to it unless a review is done beforehand. This is preventing bump2version from pushing the change to setup.py (bumping the version number in the file) in the workflow, I am looking into possible solutions to unblock this: Solution 1 (Easiest implementation but least secure): Solution 2: Solution 3: Workflow for Solution 3:
Favored Versioning Action: Alternative Versioning Action: Both of these are great and allow control of the version release via commit message (Ex: major, minor, patch) which is exactly what we are looking for. Potential Blockers: |
- pull gateway_mfr build from upstream - update pypi and test-pypi actions - add action to check gateway-mfr-rs version weekly and auto-update if necessary - remove old unused backup action - bumping minor version as this is a fairly substantial change to the build process - update README to add more release info and update ROCK Pi hardware info Closes: #43 Closes: #36 Relates-to: #20
- pull gateway_mfr build from upstream - update pypi and test-pypi actions - add action to check gateway-mfr-rs version weekly and auto-update if necessary - remove old unused backup action - bumping minor version as this is a fairly substantial change to the build process - update README to add more release info and update ROCK Pi hardware info - move slack group ID to and environment variable across the whole GitHub org for Nebra Ltd Closes: #43 Closes: #36 Relates-to: #20
copying in from #78 @marvinmarnold FYI re your comment in #77 it actually works fairly well now, as long as you have updated the version in setup.py before merging to master from a PR, it will then upload to TestPyPI after that merge, and then to PyPI mainline when you publish the release. So perhaps not fully fixing #20 but not particularly cumbersome either |
Currently, only the first build after a version bump will pass
.github/workflows/publis-to-pypi-test.yml
. Example: https://github.com/NebraLtd/hm-pyhelper/pull/14/checks?check_run_id=3694402894. One solution the docs mention is to use setuptools_scm but the implications of the switch need to be better understood.The text was updated successfully, but these errors were encountered: