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
This logic is not quite right! We're passing just part of a version string into packaging.version.parse(), rather than the whole string. This is the cause of some of the failing tests.
Unfortunately, there are also some real discrepancies between PEP 440 and SemVer, and packaging==22.0 lands firmly on the side of PEP 440. This is the cause of the rest of the failing tests.
These versions are still supported by packaging==22.0. (Although PEP 440 says not to use a hyphen, and SemVer says to use a hyphen.) The failure is because we're trying to parse just the prerelease identifier (a1, b2) as if it's an entire version string:
'1.2.0a1'
'1.2.0-a1'
'1.2.0b2'
'1.2.0-b2'
These are valid per SemVer, but they are not valid per PEP 440, and so they fail on packaging.version.parse() starting with packaging==22.0:
The pre-release segment consists of an alphabetical identifier for the pre-release phase, along with a non-negative integer value. Pre-releases for a given release are ordered first by phase (alpha, beta, release candidate) and then by the numerical component within that phase.
A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-].
Originally posted by @jtcohen6 in #6463 (comment)
adapted from Slack: @jtcohen6 + @gshank on 6 Jan
dbt-core/core/dbt/semver.py
Lines 145 to 151 in 1a6e4a0
There are two things at play here, leading to failures in
test/unit/test_semver.py
:packaging.version.parse()
, rather than the whole string. This is the cause of some of the failing tests.packaging==22.0
lands firmly on the side of PEP 440. This is the cause of the rest of the failing tests.These versions are still supported by
packaging==22.0
. (Although PEP 440 says not to use a hyphen, and SemVer says to use a hyphen.) The failure is because we're trying to parse just the prerelease identifier (a1, b2) as if it's an entire version string:'1.2.0a1'
'1.2.0-a1'
'1.2.0b2'
'1.2.0-b2'
These are valid per SemVer, but they are not valid per PEP 440, and so they fail on
packaging.version.parse()
starting withpackaging==22.0
:'2.2.0-fishtown-beta'
'2.2.0asdf'
https://peps.python.org/pep-0440/#pre-releases
https://semver.org/#spec-item-9
@gshank
The text was updated successfully, but these errors were encountered: