Skip to content

Skip non-package version files in wheels#1374

Closed
Sean-Kenneth-Doherty wants to merge 3 commits into
pypa:mainfrom
Sean-Kenneth-Doherty:codex/skip-nonpackage-version-file-build-output
Closed

Skip non-package version files in wheels#1374
Sean-Kenneth-Doherty wants to merge 3 commits into
pypa:mainfrom
Sean-Kenneth-Doherty:codex/skip-nonpackage-version-file-build-output

Conversation

@Sean-Kenneth-Doherty
Copy link
Copy Markdown

@Sean-Kenneth-Doherty Sean-Kenneth-Doherty commented May 17, 2026

Fixes #1364

build_py should still write package-local generated version files into build_lib, because those files are importable package artifacts. But paths like a top-level VERSION file are source-tree artifacts; writing them into build_lib manufactures an installed wheel file that was not installed before.

This keeps source-tree generation unchanged, including SETUPTOOLS_SCM_WRITE_TO_SOURCE=1, but skips build outputs whose transformed path is outside discovered packages or declared py_modules.

I also included the minimal docs-environment fix needed for this PR to pass Read the Docs: the current mkdocstrings/pymdownx/Pygments stack crashes unless highlight titles are normalized, and the docs group now includes Ruff for signature formatting.

Tests:

  • uv run --package setuptools-scm pytest setuptools-scm/testing_scm/test_integration.py::test_top_level_version_file_not_written_to_wheel setuptools-scm/testing_scm/test_integration.py::test_version_file_written_to_build_directory setuptools-scm/testing_scm/test_integration.py::test_version_file_src_layout_path_transformation -q
  • TMPDIR=$PWD/.tmp PIP_CACHE_DIR=$PWD/.tmp/pip-cache uv run --package setuptools-scm pytest setuptools-scm/testing_scm/test_integration.py -q
  • UV_PROJECT_ENVIRONMENT=$PWD/.tmp/rtd-venv uvx uv==0.11.14 sync --frozen --group docs && UV_PROJECT_ENVIRONMENT=$PWD/.tmp/rtd-venv uvx uv==0.11.14 run --no-sync --group docs python -m mkdocs build --clean --site-dir .tmp/rtd-site --config-file mkdocs.yml
  • uv run --package setuptools-scm ruff check setuptools-scm/src/setuptools_scm/_integration/build_py.py setuptools-scm/testing_scm/test_integration.py --config setuptools-scm/pyproject.toml
  • uv run --package setuptools-scm ruff format --check setuptools-scm/src/setuptools_scm/_integration/build_py.py setuptools-scm/testing_scm/test_integration.py --config setuptools-scm/pyproject.toml
  • git diff --check

Prepared with local Codex assistance and reviewed/validated before submission.

@Sean-Kenneth-Doherty

This comment was marked as low quality.

@Sean-Kenneth-Doherty

This comment was marked as low quality.

@RonnyPfannschmidt
Copy link
Copy Markdown
Contributor

closing as agentic abuse - the bot ignored prior discussion and prior work

the user was baned from pytest-dev for running unattended agents

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.

SETUPTOOLS_SCM_WRITE_TO_SOURCE=1 seesm to have no effect

2 participants