Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions FORK.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ strings upstream can publish at will.

The `quadbio-` tag prefix keeps our tags out of upstream's namespace. `tag_regex` in
`pyproject.toml` strips it while keeping the local segment, which setuptools_scm's default would
otherwise drop; `check_wheel.py` fails the build if `+quadbio.` ever goes missing. Off-tag builds
keep the marker too — one commit past a tag gives `1.1.62.dev1+quadbio.N.g<sha>`.
otherwise drop. The prefix is **optional** in that regex on purpose: upstream's own tags are
reachable from `main` too, and a regex matching only ours makes setuptools_scm raise
`Can't parse version from tag '1.1.61'` rather than fall back.

`check_wheel.py` fails a *release* build whose version has no `+quadbio.` segment. Builds off an
untagged `main` are `.devN` artifacts that are never published, so they are exempt. Once a
`quadbio-*` tag is reachable they carry the marker anyway — one commit past a tag gives
`1.1.62.dev1+quadbio.N.g<sha>`.

**Never delete a release tag.** For `quadbio-1.1.61.post1` and `.post2` this is literal: they were
cut from the old force-pushed `integration` and are reachable from no branch at all, so the tag is
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ source = 'vcs'
# e.g. quadbio-1.1.61+quadbio.4. setuptools_scm's default tag_regex captures [^\+]*
# and would silently drop the local part -- which is the half that makes the version
# unforgeable, since PyPI must not accept local versions.
#
# The `quadbio-` prefix is optional on purpose: upstream's own tags (1.1.61, 1.1.59.post1,
# ...) are reachable from main too, and a regex that only matched ours made setuptools_scm
# raise `Can't parse version from tag '1.1.61'` instead of falling back.
[tool.hatch.version.raw-options]
tag_regex = '^quadbio-(?P<version>.+)$'
tag_regex = '^(?:quadbio-)?(?P<version>.+)$'

[tool.ruff]
line-length = 88
Expand Down
6 changes: 5 additions & 1 deletion scripts/check_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ def main(path: str) -> int:
)
# Wheel filenames are name-version-pytag-abitag-platform.whl, and PEP 440 local
# separators are normalised to '.' in the filename, so '+quadbio.' survives intact.
#
# Only release builds are checked. A build off an untagged main is a `.devN` artifact
# that is never published, and before the first `quadbio-*` tag is reachable it has no
# local segment to carry.
version = os.path.basename(path).split("-")[1]
if LOCAL not in version:
if ".dev" not in version and LOCAL not in version:
sys.exit(
f"{path} is versioned {version!r}, which has no {LOCAL!r} local segment.\n"
"Either the tag was not `quadbio-<version>+quadbio.N`, or tag_regex in\n"
Expand Down
Loading