brash-student-40401
12/08/2022, 7:53 PMsrc
├── clients
│ ├── app
| ├── BUILD
│ └── app
| ├── BUILD
| ├── __init__.py
│ └── app.py
The first BUILD
contains the packaging target:
python_distribution(
name="app_dist",
dependencies=["src/clients/app/app"],
....
This successfully builds the distribution, but then when I import it, I have to import <http://clients.app.app|clients.app.app>
- how do I set it so that the generated packages ignore the top-level directories? Ultimately, I want users to be able to import app
.curved-television-6568
12/08/2022, 8:34 PMsource roots
: https://www.pantsbuild.org/docs/source-roots
You likely want to include src/clients/*
in your source roots in order to get import app
to work.brash-student-40401
12/08/2022, 8:35 PMsrc/clients/*
or src/clients
?curved-television-6568
12/08/2022, 8:36 PMsrc/clients
the import would be import <http://app.app|app.app>
as the first app
is not part of the root. If you have stuff in clients not to be a source root, you could list them explicitly, like ``"src/clients/app", "src/clients/other"` ..brash-student-40401
12/08/2022, 8:36 PMcurved-television-6568
12/08/2022, 8:37 PM