diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index ab5e4c6..f63eb78 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -43,6 +43,14 @@ jobs: poetry plugin add poetry-dynamic-versioning-plugin poetry show + - name: Fix up version string for TestPyPI + if: ${{ !startsWith(github.ref, 'refs/tags') }} + run: | + # Change poetry-dynamic-versioning to use metadata=false so that the + # local part of the version isn't included, making the version string + # compatible with PyPI. + sed --in-place "s/metadata = true/metadata = false/g" pyproject.toml + - name: Build a binary wheel and a source tarball run: | poetry build -vvv diff --git a/pyproject.toml b/pyproject.toml index f766a0e..a42ef99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,8 +38,10 @@ docs = [ ] [tool.poetry-dynamic-versioning] +bump = true enable = true -style = "semver" +metadata = true +style = "pep440" [build-system] requires = ["poetry>=1.2.0b1", "poetry-dynamic-versioning"]