Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: stamp a canonical dev version instead of semver #1000

Open
Labels
confirmedPrevent from becoming stalefeatureA new feature or a feature requestneeds-updateNeeds status update from maintainers
@david-waterworth

Description

@david-waterworth

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.whl

Note 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedPrevent from becoming stalefeatureA new feature or a feature requestneeds-updateNeeds status update from maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp