gentle-flower-25372
04/12/2024, 4:57 PMresources("dist_files", sources=["module_name/**/*", "README.md"])
python_distribution(
name="dist",
dependencies=[":dist_files"],
...
)
As a result, when a developer creates a new sub-directory somewhere in the module, when they run pants tailor ::, it isn't generating the python_sources for what I assume is because pants is detecting the files being owned by a target already. So the question is, is this a bug or is there some feature I'm unaware of and should be doing this differently?
I'm working around it by commenting out the resources, re-running pants tailor and then uncommenting.narrow-vegetable-37489
04/12/2024, 5:03 PMnarrow-vegetable-37489
04/12/2024, 5:03 PMnarrow-vegetable-37489
04/12/2024, 5:04 PMgentle-flower-25372
04/12/2024, 5:08 PMpython_distribution(
name="dist",
dependencies=recursive_python_source_targets(),
...
)gentle-flower-25372
04/12/2024, 5:13 PM# Find all python sources
pants --filter-target-type=python_sources list path/to/dir::
# Shove into dependencies
python_distribution(
name="dist",
dependencies=[<shove-here>],
...
)
Which is complicated when they create a new directory.gentle-flower-25372
04/12/2024, 5:13 PMnarrow-vegetable-37489
04/12/2024, 5:14 PMpython_sources(sources="module_name/**/*.py") and depend on that only, and then, if you still want your resources(), do an ignore selector that removes .py from it.gentle-flower-25372
04/12/2024, 5:14 PMgentle-flower-25372
04/12/2024, 5:15 PMcurved-television-6568
04/15/2024, 8:11 AMfalse it would mean that all sources depend on all other sources grouped together by that generator. But the default is true which means pants looks at imports to build the dependency graph.