-
-
Notifications
You must be signed in to change notification settings - Fork 228
Fix 1216 explicitly deprecate setuptools dynamic version when active #1219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 1216 explicitly deprecate setuptools dynamic version when active #1219
Conversation
ff20cbb to
629f4f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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 <[email protected]>
- 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 <[email protected]>
- 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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
95eeede to
14d85c0
Compare
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