Skip to content

Commit 6c18602

Browse files
shaneahmedJohn-P
andauthored
🧑‍💻 Use poetry for Version Updates (#638)
- Use [`poetry-bumpversion`](https://pypi.org/project/poetry-bumpversion/) for version number updates instead of bump2version as bump2version is no longer being maintained c4urself/bump2version#42 (comment). ------ Co-authored-by: Shan Raza <[email protected]> Co-authored-by: John Pocock <[email protected]>
1 parent 7bc2574 commit 6c18602

File tree

5 files changed

+29
-24
lines changed

5 files changed

+29
-24
lines changed

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ A reminder for the maintainers on how to deploy.
120120
Make sure all your changes are committed (including an entry in HISTORY.rst).
121121
Then run::
122122

123-
$ bump2version patch # possible: major / minor / patch
123+
$ poetry version patch # use: "poetry version --help" for other options
124124
$ git push
125125
$ git push --tags
126126

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,29 @@
5151

5252
[tool.distutils.bdist_wheel]
5353
universal = true
54+
55+
[tool.poetry]
56+
name = "TIA Centre"
57+
version = "1.4.0"
58+
description = "test"
59+
authors = ["TIA Centre <[email protected]>"]
60+
61+
[tool.poetry_bumpversion.file."tiatoolbox/__init__.py"]
62+
search = '__version__ = "{current_version}"'
63+
replace = '__version__ = "{new_version}"'
64+
65+
66+
[[tool.poetry_bumpversion.replacements]]
67+
files = ["setup.py"]
68+
search = 'version="{current_version}"'
69+
replace = 'version="{new_version}"'
70+
71+
[[tool.poetry_bumpversion.replacements]]
72+
files = ["CITATION.cff"]
73+
search = 'version: {current_version} # TIAToolbox version'
74+
replace = 'version: {new_version} # TIAToolbox version'
75+
76+
[[tool.poetry_bumpversion.replacements]]
77+
files = [".github/workflows/docker-publish.yml"]
78+
search = 'TOOLBOX_VER: {current_version}'
79+
replace = 'TOOLBOX_VER: {new_version}'

requirements/requirements_dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
-r requirements.txt
22
-r ../docs/requirements.txt
33
black>=23.3.0
4-
bump2version>=1.0.1
54
coverage>=7.0.0
65
docutils>=0.18.1
76
flake8>=5.0.4
87
flake8-bugbear>=22.10.27
98
isort==5.12.0
109
jinja2>=3.0.3, <3.1.0
1110
pip>=22.3
11+
poetry-bumpversion>=0.3.1
1212
pre-commit>=2.20.0
1313
pytest>=7.2.0
1414
pytest-cov>=4.0.0

setup.cfg

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
[bumpversion]
2-
current_version = 1.4.0
3-
commit = True
4-
tag = False
5-
6-
[bumpversion:file:setup.py]
7-
search = version="{current_version}"
8-
replace = version="{new_version}"
9-
10-
[bumpversion:file:tiatoolbox/__init__.py]
11-
search = __version__ = "{current_version}"
12-
replace = __version__ = "{new_version}"
13-
14-
[bumpversion:file:CITATION.cff]
15-
search = version: {current_version} # TIAToolbox version
16-
replace = version: {new_version} # TIAToolbox version
17-
18-
[bumpversion:file:.github/workflows/docker-publish.yml]
19-
search = TOOLBOX_VER: {current_version}
20-
replace = TOOLBOX_VER: {new_version}
21-
221
[flake8]
232
exclude = docs, *__init__*, setup.py
243
max-line-length = 88

tiatoolbox/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pkg_resources
99
import yaml
1010

11-
__author__ = """TIA Lab"""
11+
__author__ = """TIA Centre"""
1212
__email__ = "[email protected]"
1313
__version__ = "1.4.0"
1414

0 commit comments

Comments
 (0)