Skip to content
This repository was archived by the owner on Jun 2, 2022. It is now read-only.

Semver compliance is broken #5

@szymonrychu

Description

@szymonrychu

According to semver 2.0 specification (mentioned in official poetry docs), there is no special requirements for pre-release suffix- namely:

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-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes. Pre-release versions have a lower precedence than the associated normal version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92, 1.0.0-x-y-z.–.

https://semver.org/#spec-item-9

Therefore a version like:

0.2.4-1608127111-1a6ba6b

is valid and should be treated as pre-release one. In other words when semver range specified like this:

examplelib = "^0.2.4"

such pre-release should be ommited. That would suggest necessity of adding development flag to mix to also support such pre-release versions (for example the same way as helm charts do).

In my case I'm unable to send such library with exception as follows:

Building examplelib (0.2.4-1608127111-1a6ba6b)

  InvalidVersion

  Invalid version: '0.2.4-1608127111-1a6ba6b'

  at /opt/hostedtoolcache/Python/3.9.0/x64/lib/python3.9/site-packages/poetry/core/version/version.py:56 in __init__
       52│     def __init__(self, version):
       53│         # Validate the version and parse it into pieces
       54│         match = VERSION_PATTERN.match(version)
       55│         if not match:
    →  56│             raise InvalidVersion("Invalid version: '{0}'".format(version))
       57│ 
       58│         # Store the parsed out pieces of the version
       59│         self._version = _Version(
       60│             epoch=int(match.group("epoch")) if match.group("epoch") else 0,

And there is no mention of treating pre-release packages according to scheme I/semver docs describe above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions