-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated files must be present before invocation to be included in package_data #1064
Comments
Sigh, it turns out setting (again copied from my example project) SolutionSetting Note that the setuptools documentation
Nothing in this documentation describes the behavior I was seeing, however. For whatever reason, specifying |
def analyze_manifest(self):
self.manifest_files = mf = {}
if not self.distribution.include_package_data:
return
src_dirs = {}
for package in self.packages or ():
# Locate package source directory
src_dirs[assert_relative(self.get_package_dir(package))] = package
self.run_command('egg_info')
ei_cmd = self.get_finalized_command('egg_info')
for path in ei_cmd.filelist.files:
# ... It seems that even though this is named Ugh. This is so complicated. |
In 422546f, we worked around issue #77 where scubainit was not being included in bdist_wheels. The actual fix however, was to simply set include_package_data = True. See pypa/setuptools#1064
In 422546f, we worked around issue #77 where scubainit was not being included in bdist_wheels. The actual fix however, was to simply set include_package_data = True. See pypa/setuptools#1064
There are no less than three places where a generated file gets kicked out of SOURCES.txt (not the sdist itself, but still required): All ultimately chain up to |
Huh. Actually, SOURCES.txt is what matters — if a file gets there, it’ll get into the sdist if The |
I've created the following repository to demonstrate the problem:
https://github.com/JonathonReinhart/setuptools-package_data-issue
Copying what I've shown there:
This repository is an MCVE for the following issues:
Problem statement
When
python setup.py sdist bdist_wheel
is invoked from a clean starting point, data files (identified inpackage_data
), which are generated during setup.py hooks, will not be included in the wheel.git clean -fdx
) (primarily removesmkpkg/generated_data
):python setup.py bdist_wheel
- OKpython setup.py sdist
thenpython setup.py bdist_wheel
- OKpython setup.py sdist bdist_wheel
- BROKENSteps to reproduce
First:
git clean -fdx
-- remove any generated filespython setup.py sdist bdist_wheel
copying build/lib/mypkg/__init__.py -> build/bdist.linux-x86_64/wheel/mypkg
unzip -l dist/mypkg-1.2.3-py2-none-any.whl
mypkg/generated_data
is missing from the wheelNow that
mypkg/generated_data
is present:python setup.py sdist bdist_wheel
againcopying build/lib/mypkg/generated_data -> build/bdist.linux-x86_64/wheel/mypkg
copying build/lib/mypkg/__init__.py -> build/bdist.linux-x86_64/wheel/mypkg
unzip -l dist/mypkg-1.2.3-py2-none-any.whl
mypkg/generated_data
is now present in the wheelClean the directory, and run other variations of
sdist
andbdist_wheel
(as mentioned above) and observe that the problem does not manifest.Workarounds that do not work
build_py
instead ofbuild
The text was updated successfully, but these errors were encountered: