quaint-telephone-89068
10/26/2022, 5:13 PMdependencies
shows relevant package data in the graph. Upon building the distribution, one will find that those data files have been (silently) omitted from the built distribution. They are left to discover these missing files likely at run time. This issue has been reproduced in https://github.com/engnatha/pants-distribution-bug. The steps to reproduce are
• Verify secret_data.txt
is a dependency with ./pants dependencies --transitive //:test_distribution
• Build the distribution with ./pants package //:test_distribution
• Confirm the file is not present in the packaged distribution unzip -l dist/test_dist-0-py3-none-any.whl
The silent dropping is coming from this line. The data file cannot be associated with a package and is dropped from package_data
in the constructed setup.py
. If one places a dummy file in helloworld/
, sets up a BUILD
file, and associates that module with the distribution target, then the data file is included again. Note that the "dummy" file can't be just __init__.py
since tailor
was not picking that up to make a new BUILD
file (though that's likely a separate issue).
This does not seem to conform to pep-420 standards for namespace packages that intend to remove the need for python modules within every directory.
Pants version
2.14.0rc5 (though this was also the case on 2.13.0 and likely earlier versions)
OS
Ubuntu 20.04
Additional info
To be fair, sphinx also doesn't gracefully handle namespace packages (at least for the version we use). We have had to put __init__.py
files around our repo to make documentation building work properly.
pantsbuild/pants