docs: clarify setup.py usage and activation#1344
Merged
RonnyPfannschmidt merged 2 commits intoMar 28, 2026
Merged
Conversation
Rewrite the setup.py section to make clear that setup.py should only be used for passing Python callables (custom version/local schemes). All non-code configuration belongs in pyproject.toml. - Rename section to "Using setup.py to pass code" - Add warning that string-based config belongs in pyproject.toml - Show complete example: pyproject.toml for config + setup.py for callable - Explain how use_scm_version works (entry point, build isolation) - Remove setup_requires references (deprecated) - Improve legacy simplified activation note with actionable remediation - Add setup.py quick-start example to index.md Closes pypa#1236 Co-authored-by: Cursor AI <ai@cursor.sh> Co-authored-by: Anthropic Claude <claude@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the documentation to clarify the intended, modern way to use setup.py with setuptools-scm: only as a vehicle for passing Python callables (custom schemes), while keeping all non-code configuration and build requirements in pyproject.toml. This directly addresses confusion reported in #1236 around use_scm_version activation in isolated builds.
Changes:
- Rewrites the
setup.pysection indocs/usage.mdto emphasize callable-only usage and add an end-to-endpyproject.toml+setup.pyexample. - Adds an explanatory note on how
use_scm_versionis activated (entry point + build env dependency installation viabuild-system.requires). - Adds a
setup.py“callable-only” quick-start snippet todocs/index.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/usage.md | Reframes setup.py guidance, adds complete example + activation explanation, and updates legacy activation remediation text. |
| docs/index.md | Adds a short setup.py snippet and links to the expanded usage section for the full pattern. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1236
setup.pysection indocs/usage.mdto make clear thatsetup.pyshould only be used for passing Python callables (custom version/local schemes) — all non-code configuration belongs inpyproject.tomlpyproject.tomlfor build requirements and config,setup.pyonly for the callablesetup_requiresmechanismsetup.pyquick-start example todocs/index.mdChanges
docs/usage.mdsetup.pyto pass code"pyproject.tomlhas[tool.setuptools_scm]for non-code config,setup.pypasses only the callableuse_scm_versionentry point mechanism and thatbuild-system.requiresis the only supported approachsetup_requiresmention (deprecated)docs/index.mdTest plan
mkdocs build --clean --strictpasses with no new warningsMade with Cursor