Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] Switch from PEP-386 to PEP-440 for tag-name constraints #3429

Open
johnkerl opened this issue Dec 12, 2024 · 0 comments
Open

[python] Switch from PEP-386 to PEP-440 for tag-name constraints #3429

johnkerl opened this issue Dec 12, 2024 · 0 comments
Labels

Comments

@johnkerl
Copy link
Member

johnkerl commented Dec 12, 2024

Status quo

At https://github.com/single-cell-data/TileDB-SOMA/wiki/Branches-and-releases we currently have the guideline

GITHUB RC TAG: Same as next step, but, for i.j.0 releases, always do an i.j.0rc0 first (note: no - before rc0, for PEP386)

This is because of the following software requirement:

  • Calculates the current version number.
    If possible, uses output of “git describe” modified to conform to the
    versioning scheme that setuptools uses (see PEP 386). Releases must be
    labelled with annotated tags (signed tags are annotated) of the following
    format:
    v<num>(.<num>)+ [ {a|b|c|rc} <num> (.<num>)* ]
  • # http://www.python.org/dev/peps/pep-0386/
    _PEP386_SHORT_VERSION_RE = r"\d+(?:\.\d+)+(?:(?:[abc]|rc)\d+(?:\.\d+)*)?"
    _PEP386_VERSION_RE = r"^%s(?:\.post\d+)?(?:\.dev\d+)?$" % _PEP386_SHORT_VERSION_RE
    _GIT_DESCRIPTION_RE = (
    r"^(?P<ver>%s)-(?P<commits>\d+)-g(?P<sha>[\da-f]+)$" % _PEP386_SHORT_VERSION_RE
    )
  • def read_release_version() -> Optional[str]:
    try:
    with open(RELEASE_VERSION_FILE) as fd:
    ver = fd.readline().strip()
    if not re.search(_PEP386_VERSION_RE, ver):
    err(
    "version: release version (%s) is invalid, "
    "will use it anyway\n" % ver,
    )
    return ver
    except FileNotFoundError:
    return None

This is why we've consistently tagged like 1.15.0rc4: otherwise our softwtare generates an error.

Desired change

Work to do

  • Update the regex in version.py above
  • Update all related code comments there
  • Update the release-procedure wiki above

See also: [sc-60657]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant