Skip to content

Conversation

@RonnyPfannschmidt
Copy link
Contributor

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

@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-1216-explicitly-deprecate-setuptools-dynamic-version-when-active branch from ff20cbb to 629f4f4 Compare August 19, 2025 21:26
Copy link

Copilot AI left a 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.

RonnyPfannschmidt and others added 8 commits October 12, 2025 11:33
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]>
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-1216-explicitly-deprecate-setuptools-dynamic-version-when-active branch 2 times, most recently from b3de254 to 95eeede Compare October 12, 2025 09:39
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]>
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the fix-1216-explicitly-deprecate-setuptools-dynamic-version-when-active branch from 95eeede to 14d85c0 Compare October 12, 2025 09:44
@RonnyPfannschmidt RonnyPfannschmidt merged commit 70f6942 into pypa:main Oct 12, 2025
22 checks passed
@RonnyPfannschmidt RonnyPfannschmidt deleted the fix-1216-explicitly-deprecate-setuptools-dynamic-version-when-active branch October 12, 2025 09:58
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.

9.2.0 broke package discovery in pytest-asyncio==1.1.0 and older

2 participants