-
Notifications
You must be signed in to change notification settings - Fork 85
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
Migrate from bump2version to tbump #1756
Comments
We probably can/should also use a a custom version template on some of the files to only bump things when they aren't a release candidate. |
I dislike having poetry or pipx to be required for this one package unfortunately. It seems like a weird ask. |
It isn't required as python -m pip show tbump | grep Requires
Requires: schema, cli-ui, tomlkit, docopt but if you put it into the $ docker run --rm -ti python:3.9 /bin/bash
root@22de092b52cc:/# pip install tbump
Collecting tbump
Downloading tbump-6.7.0-py3-none-any.whl (33 kB)
Collecting tomlkit>=0.5.8
Downloading tomlkit-0.9.0-py3-none-any.whl (32 kB)
Collecting docopt<0.7.0,>=0.6.2
Downloading docopt-0.6.2.tar.gz (25 kB)
Collecting schema<0.8.0,>=0.7.1
Downloading schema-0.7.5-py2.py3-none-any.whl (17 kB)
Collecting cli-ui>=0.10.3
Downloading cli_ui-0.16.0-py3-none-any.whl (12 kB)
Collecting unidecode<2.0.0,>=1.0.23
Downloading Unidecode-1.3.2-py3-none-any.whl (235 kB)
|████████████████████████████████| 235 kB 8.3 MB/s
Collecting tabulate<0.9.0,>=0.8.3
Downloading tabulate-0.8.9-py3-none-any.whl (25 kB)
Collecting colorama<0.5.0,>=0.4.1
Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting contextlib2>=0.5.5
Downloading contextlib2-21.6.0-py2.py3-none-any.whl (13 kB)
Building wheels for collected packages: docopt
Building wheel for docopt (setup.py) ... done
Created wheel for docopt: filename=docopt-0.6.2-py2.py3-none-any.whl size=13723 sha256=1856d71f7c528d95c7d5c2170eae45276ed659b929335deb0ab9f4e47c14bcee
Stored in directory: /root/.cache/pip/wheels/70/4a/46/1309fc853b8d395e60bafaf1b6df7845bdd82c95fd59dd8d2b
Successfully built docopt
Installing collected packages: unidecode, tabulate, contextlib2, colorama, tomlkit, schema, docopt, cli-ui, tbump
Successfully installed cli-ui-0.16.0 colorama-0.4.4 contextlib2-21.6.0 docopt-0.6.2 schema-0.7.5 tabulate-0.8.9 tbump-6.7.0 tomlkit-0.9.0 unidecode-1.3.2 so to avoid these restrictions entering into the CI and restricting things in strange ways when |
@kratsg Actually I think we can safely ignore my previous suggestion about not including in in Here's an example using the following that we both gotten from a clean $ diff --color -u bump2version_pip_list.txt tbump_pip_list.txt
--- bump2version_pip_list.txt 2022-02-07 22:24:43.812892541 -0600
+++ tbump_pip_list.txt 2022-02-07 22:29:12.883861655 -0600
@@ -12,18 +12,19 @@
black 22.1.0
bleach 4.1.0
build 0.7.0
-bump2version 1.0.1
cachetools 5.0.0
certifi 2021.10.8
cffi 1.15.0
cfgv 3.3.1
charset-normalizer 2.0.11
check-manifest 0.47
+cli-ui 0.16.0
click 8.0.3
click-completion 0.5.2
cloudpickle 2.0.0
CodeMetaPy 0.3.5
colorama 0.4.4
+contextlib2 21.6.0
coverage 6.3.1
cryptography 36.0.1
cycler 0.11.0
@@ -32,6 +33,7 @@
defusedxml 0.7.1
distlib 0.3.4
dm-tree 0.1.6
+docopt 0.6.2
docutils 0.17.1
entrypoints 0.4
executing 0.8.2
@@ -135,7 +137,7 @@
pygal 3.0.0
pygaljs 1.0.2
Pygments 2.11.2
-pyhf 0.6.4.dev83
+pyhf 0.6.4.dev85
pyparsing 3.0.7
pyrsistent 0.18.1
pytest 7.0.0
@@ -157,6 +159,7 @@
requests-toolbelt 0.9.1
rfc3986 2.0.0
rsa 4.8
+schema 0.7.5
scikit-hep-testdata 0.4.11
scipy 1.8.0
SecretStorage 3.3.1
@@ -180,6 +183,8 @@
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
stack-data 0.1.4
+tabulate 0.8.9
+tbump 6.7.0
tenacity 8.0.1
tensorboard 2.8.0
tensorboard-data-server 0.6.1
@@ -194,12 +199,14 @@
tf-estimator-nightly 2.8.0.dev2021122109
toml 0.10.2
tomli 2.0.0
+tomlkit 0.9.1
torch 1.10.2
tornado 6.1
tqdm 4.62.3
traitlets 5.1.1
twine 3.8.0
typing_extensions 4.0.1
+Unidecode 1.3.2
uproot 4.1.9
urllib3 1.26.8
virtualenv 20.13.1 |
In tests this should be sufficient to address Issue #1223 [[file]]
src = "src/pyhf/utils.py"
# This search is just identifying the line to restrict the
# regex to, but all matches in the line will get bumped
search = "pyhf: v{current_version}" |
@lukasheinrich @kratsg On my fork I now have a GitHub Actions workflow dispatch workflow setup that allows for:
I've checked it both with intentionally failing and passing workflows, and have used it to create a series of tags and releases with release candidates for patch, minor, and major releases on my fork: so if this sounds good I'll PR this after we get PR #1790 in. |
Probably still need a summary on the tag itself to annotate it. Release is a github functionality, but tags are a git functionality. |
Yeah, I see what you're saying to be able to keep the annotations of the history in the Git tag. We can probably just port most of what you have in pyhf/.github/workflows/tag.yml Lines 76 to 87 in 9fd99be
over to augment the current |
@kratsg Can you take a look at the following tags on my fork:
and let me know how you feel about the annotated tag as well as the reporting of them (especially the |
Summary
At the moment, trying to do more complicated things, like release candidates, with
bump2version
is difficult if not basically impossible in an automated way (Example: Thebump2version
docs Semantic versioning example requires that you create a release before you can create the release candidate for it — this is backwards.).The
bump2version
suggested alternatives liststbump
which seems to be a good fit. The main difference is that instead of providing the SemVer part (major, minor, patch) to bump, you provide the entire version (though you can verify the version is valid in advance).On my fork I have it working so that with a
tbump.toml
based workflow I can bump the version to any major, minor, patch, or release candidate from the command line, and with the addition of arecast-atlas
inspiredbump-version.yml
workflow we can create tags through GitHub Actions workflow dispatch events that will get pushed tomaster
, which will set off TestPyPI publication workflows. If those pass and behave as expected, we can then make a GitHub release that can also take a note fromrecast-atlas
and have the deployment to PyPI get triggered from there.This would effectively remove the need for the
tag.yml
workflow, which has served us well, making it a bit easier to step through things slower for testing (and to roll back tags before things get to PyPI) and to switch in the future to having release branches. I believe that @kratsg was okay with that idea given that he approved and merged PR #1632, but if not we can discuss this further.Additional Information
Example
Use Example:
Related Issues
This should also be able to address:
Notes on
<major>.<minor>.<patch>rc<candidate>
formatI chose to have the
<major>.<minor>.<patch>rc<candidate>
format (e.g.0.7.0rc1
) as opposed to using things like<major>.<minor>.<patch>-rc<candidate>
or something else as that seems to be what most of the other libraries in the SciPy ecosystem and Scikit-HEP ecosystem do for release candidates:Notes of caution
tbump
is packaged withpoetry
and so has a bad habit of putting unecessary upper bounds on dependencies. To avoid artificially capping things, don't addtbump
todev
dependencies but instruct people to install it withpipx
.tbump --non-interactive --no-push <version>
Code of Conduct
The text was updated successfully, but these errors were encountered: