Skip to content

fix: tombstone build needs setuptools installed explicitly - #242

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/sub-312-tombstone-build-backend
Aug 19, 2026
Merged

fix: tombstone build needs setuptools installed explicitly#242
Jammy2211 merged 1 commit into
mainfrom
feature/sub-312-tombstone-build-backend

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Follow-up to #240, part of #238.

The TestPyPI rehearsal (run 32309423898) failed — which is what a rehearsal is for. It failed at build, before the upload step, so nothing was published and no version was burned (test.pypi.org has no autolens 2026.7.29.1.post1).

Cause

The sdist builds with --no-isolation — deliberate, so the build cannot silently reach the network for a backend. Python 3.12 dropped setuptools from the default environment, and the workflow installed only build and twine. The result:

ERROR Backend 'setuptools.build_meta:__legacy__' is not available.
pyproject_hooks._impl.BackendUnavailable: Cannot import 'setuptools.build_meta'

That message names neither the cause nor the fix. It did not reproduce locally because this machine's 3.12 happens to carry setuptools — a bare 3.12 venv does not, which is exactly the runner's condition.

Fix

  • publish_tombstone.yml installs setuptools explicitly.
  • build_sdist() checks for the backend first and raises a message saying what to install, so the next environment without it gets an answer rather than a stack trace.
  • test_missing_setuptools_is_reported_before_the_build pins the precondition.

Verification

Reproduced the runner's condition in a bare 3.12 venv (find_spec("setuptools") is None):

  • before installing setuptools → the new check fires with the actionable message;
  • after installing it → all five sdists build, each declaring Requires-Python <3.12, and twine check PASSED on every one.

That last step matters beyond this bug: it is the first confirmation that the tombstone metadata is acceptable to a package index at all.

Full suite: 330 passed.

API Changes

None. Build tooling only; no PyAuto* library API is touched.

🤖 Generated with Claude Code

The TestPyPI rehearsal (run 32309423898) failed before uploading anything: the
sdist builds with --no-isolation, and Python 3.12 dropped setuptools from the
default environment, so the runner had no build backend. It surfaced as
`BackendUnavailable: Cannot import 'setuptools.build_meta'` from inside
pyproject_hooks — naming neither the cause nor the fix.

It did not reproduce locally because this machine's 3.12 happens to carry
setuptools. A bare 3.12 venv does not, which is the runner's condition.

- publish_tombstone.yml installs setuptools explicitly.
- build_sdist() checks for the backend first and says what to install, so the
  next environment without it gets an answer instead of a stack trace.
- A test pins the precondition.

Verified in a bare 3.12 venv (the runner's condition): the check fires with the
clear message, and with setuptools installed all five sdists build and
`twine check` passes on every one.

Issue: #238

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant