Skip to content

Commit

Permalink
Merge pull request #1137 from ClearcodeHQ/tbump
Browse files Browse the repository at this point in the history
Use tbump to manage releses and versions - closes #1119
  • Loading branch information
fizyk committed Feb 27, 2023
2 parents f7cc487 + 3353f42 commit b3572ce
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 30 deletions.
16 changes: 0 additions & 16 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
[bumpversion]
current_version = 2.1.0
commit = True
tag = True
message = "Release {new_version}"

[bumpversion:file:setup.cfg]
search = version = {current_version}
replace = version = {new_version}

[bumpversion:file:src/pytest_dynamodb/__init__.py]

[bumpversion:file:README.rst]

[bumpversion:file:CHANGES.rst]
search = unreleased
----------
replace = {new_version}
----------
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/pipenv@v1.6.4
# 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/pipenv@v1.6.4
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 @@ -18,3 +18,4 @@ pycodestyle = "==2.10.0"
pydocstyle = {version = "==6.3.0", extras = ["toml"]}
black = "==23.1.0"
mypy = "==1.0.1"
tbump = "==6.9.0"
76 changes: 73 additions & 3 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/1119.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use tbump to manage package versioning
65 changes: 64 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,67 @@ name = "Miscellaneus"
showcontent = true

[tool.pydocstyle]
ignore = "D203,D212"
ignore = "D203,D212"

[tool.tbump]
# Uncomment this if your project is hosted on GitHub:
github_url = "https://github.com/ClearcodeHQ/pytest-dynamodb/"

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

# 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_dynamodb/__init__.py"

[[tool.tbump.file]]
src = "README.rst"

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

[[tool.tbump.file]]
src = "pyproject.toml"
search = '"Changelog" = "https://github.com/ClearcodeHQ/pytest-dynamodb/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 b3572ce

Please sign in to comment.