Open ghost opened 10 years ago
Original comment by dwt (Bitbucket: dwt, GitHub: dwt):
I have to say that I quite like that. I really do not like it if packages have a different layout on disk than they have when installed.
That being said: does this mean that package source trees cannot have their packages in a src directory or something similar anymore?
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):
I suspect this comment is relevant: https://bitbucket.org/pypa/setuptools/src/8fcfefbe42a5e1c758a1406d916dd1b6268b3296/setuptools/command/sdist.py?at=default#cl-175
If one trusts that comment, the include_package_data is incompatible with inclusion of build_py.data_files
.
I invite someone to investigate and determine if that comment still holds. If it does, this issue won't have an easy fix. In any case, there is only one mention of 'package_dir' in setuptools and it's not relevant, so any investigation is going to have to involve distutils as well.
I'm slightly tempted to deprecate package_dir
altogether.
Originally reported by: dwt (Bitbucket: dwt, GitHub: dwt)
Hi all,
debugging our installer has brought to my attention that setuptools might have a bug where include_package_data=True is ignored if a directive like
package_dir = {'demonstrator': '.'},
is used to mark the root folder of the repository as being the root package of the repository.Please see https://github.com/dwt/sdist_ignores_include_package_data/ for a demonstration of this problem.
To reproduce try:
As far as I understand setup tools this should result in data/data.txt being inside the demonstrator package - but it is not.
From fiddling with this, it seems that this might be caused by an interact of the package_dir = {'demonstrator': '.'}, rule, as changing the repo layout to have a real demonstrator package (i.e. moving init.py and data into a demonstrator folder and leaving out that setup directive) it the data directory gets installed correctly.
One workaround that I found is to generate a package_data rule that forces inclusion of the data files in question - but that defeats the whole purpose of include_package_data.
Is package_dir the culprit here? Or is this caused by something else?
Companion pip bug: https://github.com/pypa/pip/issues/2127