Skip to content

Add optional Distribution parameter to walk_revctrl file finder#5056

Draft
RonnyPfannschmidt wants to merge 1 commit intopypa:mainfrom
RonnyPfannschmidt:walk-revctl-pass-dist
Draft

Add optional Distribution parameter to walk_revctrl file finder#5056
RonnyPfannschmidt wants to merge 1 commit intopypa:mainfrom
RonnyPfannschmidt:walk-revctl-pass-dist

Conversation

@RonnyPfannschmidt
Copy link
Contributor

i made a first draft using claude - the tests need some simplification for the unit part and im looking for suggestions on a integration test thats not excessive


File finder entry points for SCM-based files can now optionally receive the Distribution object to make more informed decisions about which files to include. This maintains full backward compatibility with existing entry points that only accept dirname.

Changes:

  • Add optional distribution parameter to walk_revctrl function
  • Create _call_finder_with_distribution_support helper function with signature inspection to detect entry point capabilities
  • Update manifest_maker.add_defaults() to pass distribution object
  • Add comprehensive unit tests covering all scenarios including backward compatibility and error handling

🤖 Generated with Claude Code

Summary of changes

Closes

Pull Request Checklist

… points

File finder entry points for SCM-based files can now optionally receive
the Distribution object to make more informed decisions about which files
to include. This maintains full backward compatibility with existing
entry points that only accept dirname.

Changes:
- Add optional distribution parameter to walk_revctrl function
- Create _call_finder_with_distribution_support helper function with
  signature inspection to detect entry point capabilities
- Update manifest_maker.add_defaults() to pass distribution object
- Add comprehensive unit tests covering all scenarios including
  backward compatibility and error handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jaraco
Copy link
Member

jaraco commented Jan 19, 2026

On one hand, this change seems pretty innocuous and acceptable.

On the other hand, it opens up a new interface dependency. Now any plugin becomes dependent on the internal implementation details of the Distribution object (which is most of what Setuptools deals with). Do we want to constrain what things the plugin might do with the Distribution (such as preventing it mutating it or limiting how it can be mutated)? Would we want to mark any change to the Distribution object as a backward-incompatible change? I'd like to avoid the situation where any change to Setuptools could break any version of a SCM plugin.

I wonder if it would be better to have more limited actions/operations that the SCM plugin can do (e.g. filter files, extend files, inspect specific details about the dist object). Maybe something like a IDistributionFiles interface, which would specifically expose the functionality that's supported.

Do you have a link to an issue or discussion where you detail the motivation behind this change? (I wouldn't be surprised if I was the person who suggested just passing the distribution object)

@RonnyPfannschmidt
Copy link
Contributor Author

the key issue i have here is that i cant access any details about the configuration in the scm file finder - this prevents both opt-out and other integration in a sensible way

i don't even care about the distribution itself- but i do care about the setuptools_scm configuration and possible opt-out

pypa/setuptools-scm#516

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.

2 participants