diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 333070e..0000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[bumpversion:file:pyproject.toml] -search = version = "{current_version}" -replace = version = "{new_version}" - -[bumpversion:file:CHANGELOG.md] -search = **unreleased** -replace = **unreleased** - **v{new_version}** diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 487f856..50500d7 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -13,7 +13,7 @@ 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 @@ -21,7 +21,7 @@ jobs: - 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 @@ -30,7 +30,7 @@ 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]') @@ -38,7 +38,7 @@ jobs: 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]') @@ -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 diff --git a/pyproject.toml b/pyproject.toml index a5d707c..33406e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,5 @@ [project] name = "partcad" -version = "0.1.1" description = "Framework for packaging CAD models" readme = "README.md" keywords = ["cadquery", "build123d"] @@ -12,7 +11,7 @@ authors = [ maintainers = [ {name = "Roman Kuzmenko", email = "openvmp@proton.me" } ] -dynamic = ["dependencies"] +dynamic = ["version", "dependencies"] [project.scripts] pc = "partcad:main_cli" @@ -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" diff --git a/src/partcad/__init__.py b/src/partcad/__init__.py index 9af737e..5125098 100644 --- a/src/partcad/__init__.py +++ b/src/partcad/__init__.py @@ -38,3 +38,5 @@ "scene", "main_cli", ] + +__version__: str = "0.1.1"