hatch-vcs icon indicating copy to clipboard operation
hatch-vcs copied to clipboard

ENH: Determine build contents from VCS file listing

Open effigies opened this issue 1 year ago • 9 comments

This is a proof-of-concept. setuptools_scm provides both the version and file listing to setuptools, so this seems like an appropriate place to improve on hatchling's filtering of files based on VCS configuration. This should mean that we get both git and mercurial filtering.

This proposes adding a detect-files boolean flag to [tool.hatch.build.hooks.vcs]. The way this is set up is to accept the file listing from setuptools_scm, run it through the exclusion filters already in place, place the results in artifacts to exempt from exclusion filters, and then set the exclusion filters to universal.

If you have interest in supporting this use-case, I'm happy to update tests (some guidance would be appreciated but I can probably figure it out). I also would change version-file from mandatory to optional.

xref pypa/hatch#304

effigies avatar Apr 07 '23 02:04 effigies