Title: feat: stamp a canonical dev version instead of semver · Issue #1000 · python-semantic-release/python-semantic-release · GitHub
Open Graph Title: feat: stamp a canonical dev version instead of semver · Issue #1000 · python-semantic-release/python-semantic-release
X Title: feat: stamp a canonical dev version instead of semver · Issue #1000 · python-semantic-release/python-semantic-release
Description: Question I'm running into issues with python-semantic-release and poetry with my dev builds. I probably have some config set wrong, but python-semantic-release has generated version = "0.8.0-dev.2" in my pyproject.toml and when I run poe...
Open Graph Description: Question I'm running into issues with python-semantic-release and poetry with my dev builds. I probably have some config set wrong, but python-semantic-release has generated version = "0.8.0-dev.2"...
X Description: Question I'm running into issues with python-semantic-release and poetry with my dev builds. I probably have some config set wrong, but python-semantic-release has generated version = "0.8...
Opengraph URL: https://github.com/python-semantic-release/python-semantic-release/issues/1000
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: stamp a canonical dev version instead of semver","articleBody":"## Question\r\n\r\nI'm running into issues with python-semantic-release and poetry with my dev builds. I probably have some config set wrong, but `python-semantic-release` has generated `version = \"0.8.0-dev.2\"` in my `pyproject.toml` and when I run `poetry build` I end up with\r\n\r\n```\r\nBuilding my-project (0.8.0-dev.2)\r\n - Building sdist\r\n - Built my-project-0.8.0.dev2.tar.gz\r\n - Building wheel\r\n - Built my-project-0.8.0.dev2-py3-none-any.whl\r\n``` \r\n\r\nNote 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 using `poetry version` to find the file that was created, and I cannot because they don't match.\r\n\r\nIt looks to me like `python-semantic-release` is generating a version that matches the longer regex from https://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]*))?$'`)\r\n\r\nhttps://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers also states\r\n\r\n```\r\nThe canonical public version identifiers MUST comply with the following scheme:\r\n\r\n[N!]N(.N)*[{a|b|rc}N][.postN][.devN]\r\n```\r\n\r\nWhich isn't true for `0.8.0-dev.2` (should be `0.8.0.dev2` if I'm reading this correctly).\r\n\r\nI'm assuming that `poetry build` \"canonicalizes\" the version when creating the sdist/wheel files?\r\n\r\nIs it possible to ensure that `python-semantic-release` only generates \"canonical\" version strings in the first place? Or am I missing something?\r\n\r\n### Configuration\r\n\r\n```\r\n[tool.semantic_release]\r\nupload_to_pypi = false\r\nupload_to_vcs_release = false\r\nbuild_command = \"./scripts/build.sh \u0026\u0026 ./scripts/publish.sh\"\r\ntag_format = \"v{version}\"\r\nversion_toml = [\r\n \"pyproject.toml:tool.poetry.version\"\r\n]\r\n\r\n[tool.semantic_release.branches.main]\r\nmatch = \"(main|master)\"\r\nprerelease_token = \"rc\"\r\nprerelease = false\r\n\r\n[tool.semantic_release.branches.other]\r\nmatch = \"^(feat|fix|perf)/.+\"\r\nprerelease_token = \"dev\"\r\nprerelease = true\r\n```","author":{"url":"https://github.com/david-waterworth","@type":"Person","name":"david-waterworth"},"datePublished":"2024-08-10T05:29:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/1000/python-semantic-release/issues/1000"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ec1db55a-3865-c20d-e785-0cbaa5de89a7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB98:1DF95C:264D27:303C62:6991F9B8 |
| html-safe-nonce | cda352cafd7e4bb716f7057d29bba8daedccb2f963219087f580d3ae9244f543 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjk4OjFERjk1QzoyNjREMjc6MzAzQzYyOjY5OTFGOUI4IiwidmlzaXRvcl9pZCI6Ijg0NjYxMTk2ODg4Nzg5NDY3NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4f5781651b72dc84b3f727010bb97d9a95bd8b54014347e043ea120af7c0cc4a |
| hovercard-subject-tag | issue:2458913546 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-semantic-release/python-semantic-release/1000/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f462a7bfb0bfcb2c84dfb1495c0fee35172f6eab54a0f09f00634324fc36fedf/python-semantic-release/python-semantic-release/issues/1000 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f462a7bfb0bfcb2c84dfb1495c0fee35172f6eab54a0f09f00634324fc36fedf/python-semantic-release/python-semantic-release/issues/1000 |
| og:image:alt | Question I'm running into issues with python-semantic-release and poetry with my dev builds. I probably have some config set wrong, but python-semantic-release has generated version = "0.8.0-dev.2"... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | david-waterworth |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/python-semantic-release/python-semantic-release git https://github.com/python-semantic-release/python-semantic-release.git |
| octolytics-dimension-user_id | 116517554 |
| octolytics-dimension-user_login | python-semantic-release |
| octolytics-dimension-repository_id | 39765732 |
| octolytics-dimension-repository_nwo | python-semantic-release/python-semantic-release |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 39765732 |
| octolytics-dimension-repository_network_root_nwo | python-semantic-release/python-semantic-release |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width