Skip to content

Commit

Permalink
Replace deprecated bump2version with bump-my-version
Browse files Browse the repository at this point in the history
  • Loading branch information
openvmp committed Dec 29, 2023
1 parent 02ab72d commit 1e0970b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
8 changes: 0 additions & 8 deletions .bumpversion.cfg

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
- name: Install Python 3
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.10
- name: Setup env variables
run: |
echo "SKIPBUMP=FALSE" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bump2version setuptools wheel twine
pip install bump-my-version setuptools wheel twine
# If a commit starts with [MAJOR] a new major verion upgrade will be
# triggered. Use with caution as Major upgrades denote backwards
Expand All @@ -30,15 +30,15 @@ jobs:
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
bump2version major
bump-my-version bump major
echo "SKIPBUMP=TRUE" >> $GITHUB_ENV
if: startsWith(github.event.head_commit.message, '[MAJOR]')

- name: Bump Minor Version
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
bump2version minor
bump-my-version bump minor
echo "SKIPBUMP=TRUE" >> $GITHUB_ENV
if: startsWith(github.event.head_commit.message, '[FEATURE]')

Expand All @@ -47,7 +47,7 @@ jobs:
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
bump2version patch
bump-my-version bump patch
if: env.SKIPBUMP == 'FALSE'

- name: Commit version change to master
Expand Down
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[project]
name = "partcad"
version = "0.1.1"
description = "Framework for packaging CAD models"
readme = "README.md"
keywords = ["cadquery", "build123d"]
Expand All @@ -12,7 +11,7 @@ authors = [
maintainers = [
{name = "Roman Kuzmenko", email = "openvmp@proton.me" }
]
dynamic = ["dependencies"]
dynamic = ["version", "dependencies"]

[project.scripts]
pc = "partcad:main_cli"
Expand All @@ -21,8 +20,15 @@ pc = "partcad:main_cli"
"partcad.template" = ["*.yaml"]

[tool.setuptools.dynamic]
version = {attr = "partcad.__version__"}
dependencies = {file = ["requirements.txt"]}

[tool.pytest.ini_options]
# addopts = -ra -s -rx
pythonpath = "src"

[tool.bumpversion]
current_version = "0.1.1"

[[tool.bumpversion.files]]
filename = "src/partcad/__init__.py"
2 changes: 2 additions & 0 deletions src/partcad/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@
"scene",
"main_cli",
]

__version__: str = "0.1.1"

0 comments on commit 1e0970b

Please sign in to comment.