Fix 1216 explicitly deprecate setuptools dynamic version when active#1219
Merged
RonnyPfannschmidt merged 9 commits intopypa:mainfrom Oct 12, 2025
Conversation
ff20cbb to
629f4f4
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds explicit warnings for misconfigurations where users have incorrectly combined setuptools-scm with setuptools dynamic version configurations, a common cargo-culted antipattern that sabotages setuptools-scm functionality.
- Detects and warns when
version = attr:is used in setup.cfg metadata - Detects and warns when
[tool.setuptools.dynamic]version configuration is present in pyproject.toml - Nullifies the problematic version configurations to prevent interference with setuptools-scm
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/setuptools_scm/_integration/setup_cfg.py | Adds warning detection for attr-based version in setup.cfg and nullifies it |
| src/setuptools_scm/_integration/pyproject_reading.py | Adds warning detection for setuptools dynamic version in pyproject.toml and supports test injection |
| testing/test_integration.py | Adds test coverage for setup.cfg dynamic version warning behavior |
| testing/test_pyproject_reading.py | Adds test coverage for pyproject.toml dynamic version warning and test utilities |
| src/setuptools_scm/_config.py | Minor whitespace cleanup |
| CHANGELOG.md | Documents the fix for issue #1216 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
pjonsson
reviewed
Aug 21, 2025
pjonsson
reviewed
Aug 26, 2025
pjonsson
reviewed
Aug 26, 2025
partial solution to pypa#1216
Convert docstring to reStructuredText format and document both test hooks (_given_result and _given_definition). Clarifies that _given_definition is ignored when _given_result is provided. Note: Python 3.10 pin removed from pre-commit configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix "removeit" → "remove it" (missing space) - Fix "its invalid" → "it's invalid" (missing apostrophe) - Remove extra closing brace from setup.cfg expression - Update test to match the actual implementation text 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Rename first v9.2.0 to v9.2.1 (unreleased) to distinguish from released v9.2.0 - Standardize section header capitalization (Fixed, Added, Changed, Removed) - Add missing # to issue reference in v9.0.3 (pypa#1184) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The griffe command was failing silently because griffe was not installed. This commit fixes the workflow to properly install griffe and improves error reporting. Changes: - Add explicit griffe installation step - Add continue-on-error to capture exit codes - Consolidate reporting into single step with if: always() - Handle three states: success, warning (breaking changes), and failure - Capture and report exit codes for better debugging - Add proper GitHub notices, warnings, and summaries for all states 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
b3de254 to
95eeede
Compare
Windows runners no longer ship with Mercurial pre-installed, causing test failures. This commit adds Mercurial installation using Chocolatey in the existing GnuPG setup step. Changes: - Add mercurial to the choco install command alongside gnupg - Update step name to reflect it now installs both GnuPG and Mercurial - Add explanatory comment about why Mercurial installation is needed This uses a modern, declarative approach via the Chocolatey package manager that's already in use for GnuPG installation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
95eeede to
14d85c0
Compare
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.
closes #1216
as enough users cargo culted layering dynamic version from version file into setuptools_scm usage, we explicitly warn about it + its use in setup.cfg/pyproject.toml