Skip to content

Commit 08b4f03

Browse files
committed
skill: add gotcha 299 from the pyfarmhash port
1 parent afa43ab commit 08b4f03

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

skills/python-project-porting/references/gotchas-index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Gotchas index — router for the themed gotcha files
22

3-
The porting gotchas (293 of them) live in [`references/gotchas/`](gotchas/), split by theme so only the relevant slice loads. Every gotcha keeps a **permanent number** cited elsewhere as "gotcha N" (and in workflow comments as "CLAUDE.md gotcha N"). Numbers are stable IDs — **not sequential**, and four are **reused** with different content (two each of 33, 55, 56, 57), disambiguated by theme below.
3+
The porting gotchas (294 of them) live in [`references/gotchas/`](gotchas/), split by theme so only the relevant slice loads. Every gotcha keeps a **permanent number** cited elsewhere as "gotcha N" (and in workflow comments as "CLAUDE.md gotcha N"). Numbers are stable IDs — **not sequential**, and four are **reused** with different content (two each of 33, 55, 56, 57), disambiguated by theme below.
44

55
## How to find the gotcha you need
66

@@ -86,6 +86,7 @@ The porting gotchas (293 of them) live in [`references/gotchas/`](gotchas/), spl
8686
- **268** — A vendored C-core git submodule can have its own `git describe`-based
8787
- **274** — A build-from-checkout package can tag releases in a format the version
8888
- **275** — A live, legitimate `project_urls` repo link is not proof it holds the released
89+
- **299** — Gotcha 103's "no tag, but a real commit does the bump" can be missing entirely —
8990

9091
### cibuildwheel mechanics, the matrix & abi3 — [`gotchas/cibuildwheel-matrix-and-abi3.md`](gotchas/cibuildwheel-matrix-and-abi3.md)
9192

skills/python-project-porting/references/gotchas/sdist-source-and-versioning.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,3 +489,29 @@ To pull up one entry: `grep -n '^N\. ' references/gotchas/sdist-source-and-versi
489489
released tag; always fetch file contents pinned `?ref=<tag>` (or `git show
490490
<tag>:<path>`), never the bare default-branch path, when a repo's own CI
491491
history suggests something is mid-flight.
492+
493+
299. **Gotcha 103's "no tag, but a real commit does the bump" can be missing
494+
entirely — the maintainer edits the version locally and never commits it
495+
(the pyfarmhash case).** `veelion/python-farmhash` has no tags and no
496+
releases; its `setup.py` has read `VERSION = (0, 4, 0)` on `master` since
497+
commit `954c61f3` (2024-05-02), yet PyPI has since shipped 0.5.0 and then
498+
0.5.1 sdists. Unlike gotcha 103 (dbt-extractor) and gotcha 213 (lru-dict),
499+
`gh api "repos/<o>/<r>/commits?path=setup.py"` here shows **no candidate
500+
commit at all** whose diff touches `VERSION` to `0.5.1` — the maintainer
501+
bumps the tuple locally before running the release build and uploading,
502+
then discards the change instead of pushing it.
503+
- **Prove the rest first, same discipline as 103/213**: download the
504+
released sdist and diff every file against the HEAD commit's tree
505+
(`gh api repos/<o>/<r>/tarball/<sha>`). If everything but the version
506+
string is byte-identical, the port is otherwise a plain build-from-HEAD
507+
case — the only gap is the one line git never got.
508+
- **Patch it yourself rather than searching harder for a commit that does
509+
not exist.** Pin the checkout to HEAD (or whatever commit the diff
510+
proved identical) as `<PKG>_REF`, and add a one-line
511+
`patches/<pkg>/<version>/` patch bumping the `VERSION`
512+
tuple/`version = "..."` string to match, tagged `Upstream-Status:
513+
Inappropriate [...]` (there is no upstream commit to backport and
514+
nothing to submit — the maintainer's own workflow is "edit locally,
515+
never commit"). Verify the patched checkout actually builds a wheel
516+
reporting the target version before pushing (`python setup.py
517+
bdist_wheel` / `python -m build --sdist` locally is enough — gotcha 9).

0 commit comments

Comments
 (0)