Skip to content

Commit b8ce771

Browse files
authored
Merge pull request #195 from NLeSC/192-bumpversion
added bump2version dep and config
2 parents 2201bd5 + e06208b commit b8ce771

3 files changed

Lines changed: 23 additions & 9 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[bumpversion]
2+
current_version = {{ cookiecutter.version }}
3+
4+
[comment]
5+
comment = The contents of this file cannot be merged with that of setup.cfg until https://github.com/c4urself/bump2version/issues/185 is resolved
6+
7+
[bumpversion:file:{{ cookiecutter.package_name }}/__version__.py]
8+
search = __version__ = "{current_version}"
9+
replace = __version__ = "{new_version}"
10+
11+
[bumpversion:file:setup.cfg]
12+
search = version = {current_version}
13+
replace = version = {new_version}
14+
15+
[bumpversion:file:CITATION.cff]
16+
search = version: "{current_version}"
17+
replace = version: "{new_version}"

{{cookiecutter.project_name}}/project_setup.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ help you decide which tool to use for packaging.
105105
## Package version number
106106

107107
- We recommend using [semantic versioning](https://guide.esciencecenter.nl/#/best_practices/releases?id=semantic-versioning).
108-
- For convenience, the package version is stored in a single place: `{{ cookiecutter.package_name }}/__version__.py`.
109-
For updating the version number, you only have to change this file.
108+
- For convenience, the package version is stored in a single place: `{{ cookiecutter.project_name }}/.bumpversion.cfg`.
109+
For updating the version number, make sure the dev dependencies are installed and run `bumpversion patch`,
110+
`bumpversion minor`, or `bumpversion major` as appropriate.
110111
- Don't forget to update the version number before [making a release](https://guide.esciencecenter.nl/#/best_practices/releases)!
111112

112113
## Publish on Python Package Index (PyPI)

{{cookiecutter.project_name}}/setup.cfg

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# - https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html
44
# - https://www.python.org/dev/peps/pep-0314/
55

6-
76
[metadata]
87
author = {{ cookiecutter.full_name }}
98
author_email = {{ cookiecutter.email }}
@@ -32,23 +31,21 @@ project_urls =
3231
url = {{ cookiecutter.repository }}
3332
version = {{ cookiecutter.version }}
3433

35-
3634
[options]
3735
zip_safe = False
3836
include_package_data = True
3937
packages =
4038
{{ cookiecutter.package_name }}
4139
install_requires =
4240

43-
4441
[options.data_files]
4542
# This section requires setuptools>=40.6.0
4643
# It remains empty for now
4744
# Check if MANIFEST.in works for your purposes
4845

49-
5046
[options.extras_require]
5147
dev =
48+
bump2version
5249
prospector[with_pyroma]
5350
yapf
5451
isort
@@ -61,12 +58,10 @@ dev =
6158
sphinx_rtd_theme
6259
recommonmark
6360

64-
6561
[coverage:run]
6662
branch = True
6763
source = {{ cookiecutter.package_name }}
6864

69-
7065
[tool:isort]
7166
lines_after_imports = 2
7267
force_single_line = 1
@@ -75,7 +70,8 @@ known_first_party = {{ cookiecutter.package_name }}
7570
src_paths = {{ cookiecutter.package_name }},tests
7671
line_length = 120
7772

78-
7973
[tool:pytest]
8074
testpaths = tests
75+
# Note that visual debugger in some editors like pycharm gets confused by coverage calculation.
76+
# As a workaround, configure the test configuration in pycharm et al with a --no-cov argument
8177
addopts = --cov --cov-report xml --cov-report term --cov-report html

0 commit comments

Comments
 (0)