ripe-cpu-85141
07/29/2022, 7:58 PMa
├── ba
│ ├── __init__.py
│ └── resources.py
├── bb
│ ├── __init__.py
│ └── resources.py
├── bc
│ ├── __init__.py
│ └── resources.py
├── bd
│ ├── __init__.py
│ └── resources.py
├── be
│ ├── __init__.py
│ └── resources.py
├── bf
│ ├── __init__.py
│ └── resources.py
└── __init__.py
a/__init__.py
uses importlib.import_module
to load all the resources.py
files under it (done to do auto-registration on a factory).
This isn't picked up by the pants' inference system.
I thought to have a/BUILD
with something like
python_sources(
overrides={
"__init__.py": {
"dependencies": ["*/**/*.py"]
}
}
)
But pants is complaining.
I'm not sure I can use glob on dependencies
anyway.
Therefore, I'm not sure how to handle that situation.
Can you guys tell me if my approach is ok and what is missing to make it works?hundreds-father-404
07/29/2022, 9:09 PMdependencies
, unfortunately. So you have three options:
1) Rewrite the code to use something Pants can infer
2) Hardcode each dependency
3) Automate with a light weight dependency inference plugin, which will auto-detect resource.py
in subtrees
Happy to help w/ #3 if you're interestedripe-cpu-85141
07/29/2022, 9:30 PM