fancy-daybreak-62348
01/11/2023, 7:45 PMfancy-daybreak-62348
01/11/2023, 11:52 PMaloof-appointment-30987
01/12/2023, 3:17 PM├── helloworld
│ ├── BUILD
│ ├── __init__.py
│ ├── greet
│ │ ├── BUILD
│ │ ├── __init__.py
│ │ ├── greeting.py
│ │ ├── greeting_test.py
│ │ └── translations.json
│ ├── main.py
│ └── translator
│ ├── BUILD
│ ├── __init__.py
│ ├── translator.py
│ └── translator_test.py
├── BUILD
├── LICENSE
├── README.md
├── mypy.ini
├── pants
├── pants.ci.toml
├── pants.toml
├── pants_from_sources
├── python-default.lock
└── requirements.txt
greet
and translator
both have individual tests with associated BUILD files. Does that help?fancy-daybreak-62348
01/13/2023, 7:04 PMhelloworld
in this case. What if i want to have multiple? for example having greet
and translate
as two packages; from greet import X
instead of from helloworld.greet ...
. Is there a recommended structure for that? Right now I do:
greet
- greet
- greeting.py
- tests
- README.MD
- pyproject.toml
- BUILD
translate
- translate
- translate.py
- tests
- README.MD
- pyproject.toml
- BUILD
is that the right way?aloof-appointment-30987
01/15/2023, 4:34 PMgit diff HEAD~
once you've unzipped the attachment.
The monorepo structure demonstrated is:
├── helloworld
│ ├── BUILD
│ ├── __init__.py
│ └── main.py
├── libs
│ ├── greet
│ │ ├── BUILD
│ │ ├── __init__.py
│ │ ├── greeting.py
│ │ ├── greeting_test.py
│ │ └── translations.json
│ └── translator
│ ├── BUILD
│ ├── __init__.py
│ ├── translator.py
│ └── translator_test.py
├── pants.toml
The change to root_patterns
in pants.toml
enables the libs to be imported directly.
I hope this helps