On Sat, Jul 15, 2017, at 12:54 PM, Paul Moore wrote:
Given that this is the case we're talking about, my experience is that working directories contain all sorts of clutter - small test files I knocked up, experimental changes I discarded, etc. That may simply reflect the way I work, but comments I've seen indicate that I'm not *completely* alone. So for me, the point here is about making sure that "pip install ." in a cluttered working directory results in "what the developer wants".
If those 'clutter' files are within the package directory (i.e. next to __init__.py), and we have to do a direct wheel build because VCS information is not available (not a VCS checkout, or VCS not on PATH), then I don't know how flit can avoid installing them, under any of the proposed isolation mechanisms. We can't extract a 'pristine' source tree from a non-pristine one without a list of what belongs in the pristine one - which flit gets from the VCS. distutils/setuptools mitigates this to some extent by having you explicitly specify package_data, but between globbing and the automatic inclusion of .py files, it's imprecise. And this is exactly the sort of developer annoyance I want to get away from. So I don't see a good way to avoid picking up existing clutter when you install from source. I think the main purpose of isolating the build is to avoid generating new clutter in the source directory.
[1] I don't know enough about flit to be sure, but if the developer forgets to check in a new source file, would it be possible for that source file be in the wheel but not in the sdist?
For now, flit's protection against this is that it will only build an sdist if all files in the cwd have either been added to the VCS or ignored. So it's possible to exclude a .py file from the sdist by vcs-ignoring it, but you can't get there just by forgetting to check in a file. Thomas