Skip to content

test: add pyproject.toml to card_via_* extension packages#3191

Open
talsperre wants to merge 1 commit into
masterfrom
ssrikanth/card-extensions-pep517
Open

test: add pyproject.toml to card_via_* extension packages#3191
talsperre wants to merge 1 commit into
masterfrom
ssrikanth/card-extensions-pep517

Conversation

@talsperre
Copy link
Copy Markdown
Collaborator

Summary

Add a minimal pyproject.toml with the standard [build-system] table to three test-fixture packages:

  • test/extensions/packages/card_via_extinit/
  • test/extensions/packages/card_via_init/
  • test/extensions/packages/card_via_ns_subpackage/

Each new file is 3 lines:

[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

setup.py is preserved unchanged; setuptools.build_meta uses it as the metadata source.

Motivation

These three packages currently ship setup.py only — no pyproject.toml. That forces pip onto the legacy non-PEP-517 build path, which writes build/bdist.linux-x86_64/wheel/... and *.egg-info/ inside the source directory.

When CI installs them concurrently from the same source tree (e.g. multiple tox environments running in parallel installing them all as deps), the concurrent pip processes race on those in-source directories and produce errors like:

[Errno 2]  No such file or directory: 'build/bdist.linux-x86_64/wheel/./metaflow_card_via_extinit-1.0.0-py3.10.egg-info/dependency_links.txt'
[Errno 17] File exists:    'build/bdist.linux-x86_64/wheel/metaflow_card_via_extinit-1.0.0.dist-info'
[Errno 39] Directory not empty: 'build/bdist.linux-x86_64/wheel'
[Errno 2]  No such file or directory: 'metaflow_card_via_nspackage.egg-info/tmp8cck71cx'

Adding the [build-system] table switches pip to the PEP 517 isolated-build path: pip copies the source tree to a unique /tmp/pip-build-env-*/ per install, and the wheel build runs there. Concurrent installs no longer share mutable state in the source directory, and the race goes away.

Test plan

  • Local build still works: pip wheel -w /tmp/wh ./test/extensions/packages/card_via_extinit/ produces metaflow_card_via_extinit-1.0.0-py3-none-any.whl
  • The legacy python setup.py bdist_wheel invocation still works (setuptools' build_meta backend is backed by setup.py)
  • No source-dir mutation after a PEP 517 install (verified build/ and *.egg-info/ do not appear in source after install)

These three test fixture packages have setup.py but no pyproject.toml,
so pip falls back to the legacy non-PEP-517 build path, which writes
`build/bdist.linux-x86_64/wheel/...` and `*.egg-info/` inside the
source directory. When CI installs them concurrently from the same
source tree (e.g. multiple tox environments running in parallel for
test/core), the concurrent pip processes race on those in-source
directories and produce ENOENT / EEXIST / "Directory not empty"
errors on the wheel build.

Adding the standard `[build-system]` table switches pip to the PEP 517
build path. Pip copies the source tree to an isolated `/tmp/pip-build-
env-*/` per install, so concurrent installs no longer share mutable
state in the source directory.

setup.py is preserved unchanged; setuptools.build_meta uses it as the
metadata source.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 11, 2026

Greptile Summary

This PR adds a minimal pyproject.toml to three test-fixture packages (card_via_extinit, card_via_init, card_via_ns_subpackage) to opt them into the PEP 517 isolated-build path, fixing a CI race condition that occurs when multiple pip processes install from the same source tree concurrently.

  • Each new file is identical: a [build-system] table declaring setuptools>=61 and setuptools.build_meta, which causes pip to copy the source to a unique temp directory before building rather than writing build/ and *.egg-info/ artifacts into the shared source tree.
  • The existing setup.py files are untouched and continue to serve as the metadata source under setuptools.build_meta; all three packages also have README.md present, so the open(\"README.md\") call in each setup.py will resolve correctly in the isolated build environment.

Confidence Score: 5/5

Safe to merge — the change is limited to three test-fixture packages and does not touch any production code or CI configuration.

Three identical, three-line TOML files are added to test-only packages. Each file is a well-established, standard [build-system] declaration. The existing setup.py files and README.md files are untouched and remain compatible with the new build path. There is no risk to production behaviour.

No files require special attention.

Important Files Changed

Filename Overview
test/extensions/packages/card_via_extinit/pyproject.toml New minimal pyproject.toml enabling PEP 517 isolated builds for the card_via_extinit test fixture package.
test/extensions/packages/card_via_init/pyproject.toml New minimal pyproject.toml enabling PEP 517 isolated builds for the card_via_init test fixture package.
test/extensions/packages/card_via_ns_subpackage/pyproject.toml New minimal pyproject.toml enabling PEP 517 isolated builds for the card_via_ns_subpackage test fixture package.

Reviews (1): Last reviewed commit: "test: add pyproject.toml to card_via_* e..." | Re-trigger Greptile

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