Skip to content

Commit a4fec71

Browse files
authored
Merge pull request #89 from smkent/fix-pyproject-version
Enable poetry-dynamic-versioning in `pyproject.toml`
2 parents 429b0c8 + 62b1b68 commit a4fec71

5 files changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/actions/python-poetry/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ runs:
1616
run: |
1717
python3 -m pip install \
1818
"poetry==${{ inputs.poetry_version }}.*" \
19-
"poetry-dynamic-versioning<=0.17.1"
19+
"poetry-dynamic-versioning"
2020
python3 -m pip install --upgrade requests
2121
2222
- name: 🐍 Set up Python
@@ -35,6 +35,8 @@ runs:
3535
run: |
3636
poetry install
3737
poetry lock --check
38+
[ "$(poetry version -s)" != "0.0.0" ] \
39+
|| { echo "Versioning broken"; exit 1; }
3840
3941
- name: 🪝 Cache pre-commit hooks
4042
uses: actions/cache@v3

cookie_python/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .__version__ import __version__ as version
2+
3+
__all__ = ["version"]

cookie_python/__version__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.0.0"

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
22
requires = ["poetry-core>=1.2.0", "poetry-dynamic-versioning"]
3-
build-backend = "poetry.core.masonry.api"
3+
build-backend = "poetry_dynamic_versioning.backend"
44

55
[tool.poetry]
66
name = "cookie-python"
7-
version = "0.1.2-post.141+d24fca9"
7+
version = "0.0.0"
88
description = ""
99
license = "MIT"
1010
authors = ["Stephen Kent <smkent@smkent.net>"]
@@ -55,7 +55,7 @@ new-cookie = "cookie_python.new:main"
5555
manage-cookie = "cookie_python.manage.main:main"
5656

5757
[tool.poetry-dynamic-versioning]
58-
enable = false
58+
enable = true
5959
vcs = "git"
6060
style = "semver"
6161

{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = ["poetry-core>=1.2.0", "poetry-dynamic-versioning"]
3-
build-backend = "poetry.core.masonry.api"
3+
build-backend = "poetry_dynamic_versioning.backend"
44

55
[tool.poetry]
66
name = "{{ cookiecutter.project_name }}"

0 commit comments

Comments
 (0)