rhythmic-morning-87313
05/19/2022, 5:03 AM./pants package with a python_distribution("dist") target in src/ai/backend/common/BUILD which depends on a python_sources("lib") target in the same file which depends on a python_sources("stubs") target in stubs/trafaret/BUILD, it says "No python_distribution target found to own stubs/trafaret/__init__.pyi:stubs". Shouldn't it be included in the original src/ai/backend/common:dist target transitively?
I don't want to make a separate package for the type stubs but just embed it inside the src/ai/backend/common:dist package. How do I avoid the error without changing the directory structure?rhythmic-morning-87313
05/19/2022, 5:04 AM./pants check.curved-television-6568
05/19/2022, 5:40 AMrhythmic-morning-87313
05/19/2022, 5:41 AMcurved-television-6568
05/19/2022, 5:42 AM!tgtcurved-television-6568
05/19/2022, 5:42 AM!!tgtcurved-television-6568
05/19/2022, 5:47 AMcurved-television-6568
05/19/2022, 5:48 AMrhythmic-morning-87313
05/19/2022, 5:54 AMrhythmic-morning-87313
05/19/2022, 5:55 AMNoSourceRootError: No source root found for `.`rhythmic-morning-87313
05/19/2022, 5:55 AMsrc, tests, stubs, tools/pants-pluginshappy-kitchen-89482
05/19/2022, 6:08 AMhappy-kitchen-89482
05/19/2022, 6:09 AMrhythmic-morning-87313
05/19/2022, 6:09 AMhappy-kitchen-89482
05/19/2022, 6:10 AMstubs/trafaret/BUILD is not under src/ai/backend/common, so it cannot be in that distributionhappy-kitchen-89482
05/19/2022, 6:10 AMhappy-kitchen-89482
05/19/2022, 6:11 AMhappy-kitchen-89482
05/19/2022, 6:11 AMhappy-kitchen-89482
05/19/2022, 6:12 AM!! to exclude sounds like the way to gorhythmic-morning-87313
05/19/2022, 6:12 AMrhythmic-morning-87313
05/19/2022, 6:12 AMhappy-kitchen-89482
05/19/2022, 6:12 AMrhythmic-morning-87313
05/19/2022, 6:12 AMhappy-kitchen-89482
05/19/2022, 6:12 AMrhythmic-morning-87313
05/19/2022, 6:13 AMEngine traceback:
in select
in pants.core.goals.package.package_asset
in pants.backend.python.goals.setup_py.package_python_dist (src/ai/backend/common:dist)
in pants.source.source_root.get_source_roots
Traceback (most recent call last):
File "/home/joongi/workspace/pants/src/python/pants/engine/internals/selectors.py", line 705, in native_engine_generator_send
res = func.send(arg)
File "/home/joongi/workspace/pants/src/python/pants/source/source_root.py", line 249, in get_source_roots
raise NoSourceRootError(path)
pants.source.source_root.NoSourceRootError: No source root found for `.`. See <https://www.pantsbuild.org/v2.13/docs/source-roots> for how to define source roots.rhythmic-morning-87313
05/19/2022, 6:13 AM[source]
root_patterns = ["src", "stubs", "tests", "tools/pants-plugins"]rhythmic-morning-87313
05/19/2022, 3:49 PM/ to the root_patterns seems to resolve the issue, but i get the missing python_distribution error when executing ./pants package :: because stubs directory has python_sources() without python_distribution(). How can I let pants "ignore" it?rhythmic-morning-87313
05/19/2022, 3:54 PMrhythmic-morning-87313
05/19/2022, 3:54 PM!!stubs/trafaret:stubs to all existing python_distribution() declarationsrhythmic-morning-87313
05/19/2022, 3:54 PM