swift-river-73520
03/27/2023, 6:21 PM__init__.py
file
for example, given a project layout like this:
src/python/pylibrary/sub1/*.py. # also has BUILD
src/python/pylibrary/sub2/*.py. # also has BUILD
src/python/pylibrary/__init__.py # <- has some imports from sub2
src/python/BUILD
one way I thought I'd be able to force pants to include all the files in pylibrary
was to explicitly list the target dependencies
python_distribution(
dependencies=["pylibrary/sub1:src", "pylibrary/sub2:src"]
)
but this seems to still only include files referenced directly or transitively from src/python/pylibrary/___init___.py
so what's the canonical way to build a wheel distribution which includes all files in a subpackage, with the goal of being able to install this library in a consumer's environment? right now it feels like the only way would be to specify a public API in the src/python/pylibrary/__init__.py
(which maybe I should be doing anyway)enough-analyst-54434
03/27/2023, 6:42 PMpants filedeps <dependencies targets>
- that list of files goes in the dist. If that list of files does not go in dist , that's a bug. If the list is too small, you're failing to glob all the files you mean and need to fix `sources=...`globs.enough-analyst-54434
03/27/2023, 6:43 PMpants filedeps --transitive <dependencies targets>
swift-river-73520
03/27/2023, 8:17 PMpants filedeps --transitive
was helpful and I figured out my issue for wheel archives. still working through some seemingly related issues with building pex binaries so I might reach out again about that soon