Skip to content

Commit

Permalink
Merge pull request #738 from ClearcodeHQ/tbump
Browse files Browse the repository at this point in the history
Use tbump to manage releses and versions - closes #704
  • Loading branch information
fizyk authored May 15, 2023
2 parents 41e5b20 + 43f5d5d commit d4809f2
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 30 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 @@ -22,3 +22,4 @@ mccabe = "==0.7.0"
flake8 = "==5.0.4"
types-setuptools = "==67.7.0.2"
pycodestyle = "==2.9.0"
tbump = "==6.9.0"
73 changes: 72 additions & 1 deletion Pipfile.lock

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

8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,11 @@ Fast, clean and no dangling transactions, that could be accidentally rolled back

Same approach will work with noproces fixture, while connecting to already running postgresql instance whether
it'll be on a docker machine or running remotely or locally.
Release
=======

Install pipenv and --dev dependencies first, Then run:

.. code-block::
pipenv run tbump [NEW_VERSION]
1 change: 1 addition & 0 deletions newsfragments/703.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use tbump instead of bumpversion to manage versioning and releases.
59 changes: 57 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ requires-python = ">= 3.8"
"Changelog" = "https://github.com/ClearcodeHQ/pytest-postgresql/blob/v4.1.1/CHANGES.rst"

[project.entry-points."pytest11"]
pytest_redis = "pytest_postgresql.plugin"
pytest_postgresql = "pytest_postgresql.plugin"

[build-system]
requires = ["setuptools >= 61.0.0", "wheel"]
Expand Down Expand Up @@ -89,4 +89,59 @@ showcontent = true

[tool.towncrier.fragment.misc]
name = "Miscellaneus"
showcontent = true
showcontent = true

[tool.tbump.version]
current = "4.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_postgresql/__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-postgresql/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 d4809f2

Please sign in to comment.