You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My organization's CICD process automatically adds "+SNAPSHOT" to the version string for builds on the development branch. This is consistent across every language we use, Python included.
I discovered yesterday that if I use a Poetry v2 form of the pyproject.toml file, then that extra uppercase word prevents Poetry v2.0.1 from installing or building packages.
CICD logfile excerpt:
16:37:39 ci baseVersion from version.txt file: 1.0.0
16:37:39 [Pipeline] sh
16:37:40 + sed -r -i s/version = "1.0.0"/version = "1.0.0+SNAPSHOT"/ pyproject.toml
16:37:40 [Pipeline] sh
16:37:40 + cat pyproject.toml
16:37:40 + grep version
16:37:40 version = "1.0.0+SNAPSHOT"
16:37:40 [Pipeline] sh
16:37:41 + poetry install -v
16:37:41
16:37:41 RuntimeError
16:37:41
16:37:41 The Poetry configuration is invalid:
16:37:41 - project.version must match pattern ^v?((([0-9]+)!)?([0-9]+(\.[0-9]+)*)([-_\.]?(alpha|a|beta|b|preview|pre|c|rc)[-_\.]?([0-9]+)?)?((-([0-9]+))|([-_\.]?(post|rev|r)[-_\.]?([0-9]+)?))?([-_\.]?(dev)[-_\.]?([0-9]+)?)?)(\+([a-z0-9]+([-_\.][a-z0-9]+)*))?$
16:37:41
16:37:41
16:37:41 at /usr/local/lib/python3.10/dist-packages/poetry/core/factory.py:59 in create_poetry
16:37:41 55│ message = ""
16:37:41 56│ for error in check_result["errors"]:
16:37:41 57│ message += f" - {error}\n"
16:37:41 58│
16:37:41 → 59│ raise RuntimeError("The Poetry configuration is invalid:\n" + message)
16:37:41 60│
16:37:41 61│ for warning in check_result["warnings"]:
16:37:41 62│ logger.warning(warning)
When using Poetry v1.8.2 to build the package, that additional "+SNAPSHOT" did not prevent the package's dependencies being installed, and did not prevent the package from building.
When I changed the pyproject.toml to use the v1.8.x syntax
then Poetry v2.0.1 built the package correctly with the "+SNAPSHOT" in the input version string, and that was correctly translated in the build package name to be "-snapshot".
It's the standard Python3.10 built by Canonical for Ubuntu 22.04:
$ apt list --installed |grep python3.10
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libpython3.10-minimal/jammy-updates,jammy-security,now 3.10.12-1~22.04.8 amd64 [installed,automatic]
libpython3.10-stdlib/jammy-updates,jammy-security,now 3.10.12-1~22.04.8 amd64 [installed,automatic]
libpython3.10/jammy-updates,jammy-security,now 3.10.12-1~22.04.8 amd64 [installed,automatic]
python3.10-minimal/jammy-updates,jammy-security,now 3.10.12-1~22.04.8 amd64 [installed,automatic]
python3.10/jammy-updates,jammy-security,now 3.10.12-1~22.04.8 amd64 [installed]
Example pyproject.toml
See description
Poetry Runtime Logs
See description
The text was updated successfully, but these errors were encountered:
thanks for reporting this. For the validation of the [project] section we rely on the json schema provided by https://www.schemastore.org/json/ The given pattern there for the version field seems to be incorrect for the local version part.
We include the schema file directly in our code base so we could fix it there. But I guess it would be better to first raise an issue over here https://github.com/SchemaStore/schemastore/issues and once it is fixed there include the updated schema.
thanks for reporting this. For the validation of the [project] section we rely on the json schema provided by https://www.schemastore.org/json/ The given pattern there for the version field seems to be incorrect for the local version part.
We include the schema file directly in our code base so we could fix it there. But I guess it would be better to first raise an issue over here https://github.com/SchemaStore/schemastore/issues and once it is fixed there include the updated schema.
fin swimmer
Thanks for the pointer @finswimmer, I'll have a look at the upstream version and see what's going on there.
Description
My organization's CICD process automatically adds "+SNAPSHOT" to the version string for builds on the development branch. This is consistent across every language we use, Python included.
I discovered yesterday that if I use a Poetry v2 form of the
pyproject.toml
file, then that extra uppercase word prevents Poetry v2.0.1 from installing or building packages.CICD logfile excerpt:
When using Poetry v1.8.2 to build the package, that additional "+SNAPSHOT" did not prevent the package's dependencies being installed, and did not prevent the package from building.
When I changed the
pyproject.toml
to use the v1.8.x syntaxie, from
to
then Poetry v2.0.1 built the package correctly with the "+SNAPSHOT" in the input version string, and that was correctly translated in the build package name to be "-snapshot".
Workarounds
If you need to use the
local
part of the version string, per https://peps.python.org/pep-0440/#local-version-identifiers, then eitherpyproject.toml
Poetry Installation Method
pip
Operating System
Ubuntu 22.04.5 LTS
Poetry Version
Poetry (version 2.0.1)
Poetry Configuration
Python Sysconfig
It's the standard Python3.10 built by Canonical for Ubuntu 22.04:
Example pyproject.toml
See description
Poetry Runtime Logs
See description
The text was updated successfully, but these errors were encountered: