gentle-flower-25372
02/28/2024, 10:05 PMpants list path/to/module::
and adding them as explicit deps to the pex_binary target? I don't know what people do here and I'm curious.better-van-82973
02/28/2024, 11:02 PMpants list
) - you should be able to add the python_sources
target in that file as a dependency for the pex_binary
target?better-van-82973
02/28/2024, 11:03 PMpex_binary(
name="binary-srcs",
entry_point="main.py",
dependencies=[
":lib",
"my/nested/dir/scripts:lib",
],
...
)
gentle-flower-25372
02/28/2024, 11:25 PMbetter-van-82973
02/28/2024, 11:26 PMhappy-kitchen-89482
02/28/2024, 11:42 PMpex_binary
should only need an explicit dep on the entry point, everything else should come along via inferred depsgentle-flower-25372
02/29/2024, 12:10 AMcurved-television-6568
02/29/2024, 7:36 AMhappy-kitchen-89482
02/29/2024, 3:21 PMfoo.py
depends on bar.py
through some "weird unusual thing" that isn't amenable to dep inference, then make that dep explicit via an override on the relevant python_sources()
gentle-flower-25372
02/29/2024, 3:22 PMhappy-kitchen-89482
02/29/2024, 3:25 PMpython_sources(
overrides={
"foo.py": {"dependencies": ["path/to/bar.py"]},
}
)
happy-kitchen-89482
02/29/2024, 3:25 PMhappy-kitchen-89482
02/29/2024, 3:27 PMgentle-flower-25372
02/29/2024, 3:27 PMhappy-kitchen-89482
02/29/2024, 3:31 PMhappy-kitchen-89482
02/29/2024, 3:31 PMgentle-flower-25372
02/29/2024, 3:39 PMapp: str = "app:app"
)
The weird thing is should actually be app: str = "<http://module_name.app:app|module_name.app:app>"
I have no idea how it was working before I changed it.
As I was typing this out I realized that I didn't try removing explicit deps after I fixed the above string and enabled string_imports
and string_imports_min_dots = 2
[python-infer]
string_imports = true
string_imports_min_dots = 2
I bet it will actually work properly now with inference.