- Notifications
You must be signed in to change notification settings - Fork261
Description
Question
I'm running into issues with python-semantic-release and poetry with my dev builds. I probably have some config set wrong, butpython-semantic-release has generatedversion = "0.8.0-dev.2" in mypyproject.toml and when I runpoetry build I end up with
Building my-project (0.8.0-dev.2) - Building sdist - Built my-project-0.8.0.dev2.tar.gz - Building wheel - Built my-project-0.8.0.dev2-py3-none-any.whlNote there's a. (period) between the dev token and the number 2 in the python-semantic-release generated version string but not in the filename. This is causing me grief because in my build script I'm usingpoetry version to find the file that was created, and I cannot because they don't match.
It looks to me likepython-semantic-release is generating a version that matches the longer regex fromhttps://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions but it doesn't match the "canonical" version (r'^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$')
https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers also states
The canonical public version identifiers MUST comply with the following scheme:[N!]N(.N)*[{a|b|rc}N][.postN][.devN]Which isn't true for0.8.0-dev.2 (should be0.8.0.dev2 if I'm reading this correctly).
I'm assuming thatpoetry build "canonicalizes" the version when creating the sdist/wheel files?
Is it possible to ensure thatpython-semantic-release only generates "canonical" version strings in the first place? Or am I missing something?
Configuration
[tool.semantic_release]upload_to_pypi = falseupload_to_vcs_release = falsebuild_command = "./scripts/build.sh && ./scripts/publish.sh"tag_format = "v{version}"version_toml = [ "pyproject.toml:tool.poetry.version"][tool.semantic_release.branches.main]match = "(main|master)"prerelease_token = "rc"prerelease = false[tool.semantic_release.branches.other]match = "^(feat|fix|perf)/.+"prerelease_token = "dev"prerelease = true