Skip to content

Commit

Permalink
Replace bumpversion with tbump - closes #386
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk committed Jul 20, 2023
1 parent dd5e522 commit a4a1798
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 40 deletions.
17 changes: 0 additions & 17 deletions .bumpversion.cfg

This file was deleted.

20 changes: 10 additions & 10 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ on:
branches: [ main ]

jobs:
# bump:
# runs-on: ubuntu-latest
# steps:
# - name: Check out repository
# uses: actions/checkout@v3
# - uses: fizyk/actions-reuse/.github/actions/[email protected]
# with:
# python-version: "3.11"
# pipenv-install-options: "--skip-lock"
# command: tbump --dry-run --only-patch $(pipenv run tbump current-version)"-x"
bump:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- uses: fizyk/actions-reuse/.github/actions/[email protected]
with:
python-version: "3.11"
pipenv-install-options: "--skip-lock"
command: tbump --dry-run --only-patch $(pipenv run tbump current-version)"-x"
towncrier:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ pytest-cov = "==4.1.0"
pytest-xdist = "==3.3.1"
ruff = "==0.0.278"
mypy = "==1.4.1"
tbump = "==6.10.0"
140 changes: 129 additions & 11 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions newsfragments/386.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace bumpversion with tbump to manage versioning and releases
56 changes: 54 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ select = [
directory = "newsfragments"
single_file=true
filename="CHANGES.rst"
issue_format="`#{issue} <https://github.com/ClearcodeHQ/pytest-mongo/issues/{issue}>`_"
issue_format="`#{issue} <https://github.com/ClearcodeHQ/pytest-mongo/issues/{issue}>`__"

[tool.towncrier.fragment.feature]
name = "Features"
Expand All @@ -100,4 +100,56 @@ name = "Miscellaneus"
showcontent = false

[tool.tbump.version]
current = "2.1.1"
current = "2.1.1"

# Example of a semver regexp.
# Make sure this matches current_version before
# using tbump
regex = '''
(?P<major>\d+)
\.
(?P<minor>\d+)
\.
(?P<patch>\d+)
(\-
(?P<extra>.+)
)?
'''

[tool.tbump.git]
message_template = "Release {new_version}"
tag_template = "v{new_version}"

[[tool.tbump.field]]
# the name of the field
name = "extra"
# the default value to use, if there is no match
default = ""
# For each file to patch, add a [[file]] config
# section containing the path of the file, relative to the
# tbump.toml location.

[[tool.tbump.file]]
src = "pytest_mongo/__init__.py"

[[tool.tbump.file]]
src = "pyproject.toml"
search = 'version = "{current_version}"'

[[tool.tbump.file]]
src = "pyproject.toml"
search = '"Changelog" = "https://github.com/ClearcodeHQ/pytest-mongo/blob/v{current_version}/CHANGES.rst"'

# You can specify a list of commands to
# run after the files have been patched
# and before the git commit is made

[[tool.tbump.before_commit]]
name = "Build changelog"
cmd = "pipenv run towncrier build --version {new_version} --yes"

# Or run some commands after the git tag and the branch
# have been pushed:
# [[tool.tbump.after_push]]
# name = "publish"
# cmd = "./publish.sh"

0 comments on commit a4a1798

Please sign in to comment.