happy-kitchen-89482
08/15/2024, 3:14 AMdependencies=[...] that criss-cross the repo, there are no restrictionstall-salesclerk-68028
08/15/2024, 2:54 PM# src/tests/BUILD
python_sources(dependencies=[":test_csv_files"])
files(name="test_csv_files", sources=["**/*.csv"])
This correctly detects my csv file sources
pants dependencies src/tests
->
src/tests/test_data/csv/shape_example.csv:../../test_data_files
I just can't seem to figure out the correct syntax to include in the BUILD file located within my test module directory.
# src/tests/dir/subdir/BUILD
python_tests(
name="tests",
dependencies=[":test_csv_files"]
)
:test_csv_files is out of scope, but I am not sure how to reference the python_sources and/or files field located within src/tests/BUILD. I think I am just lacking a bit of understanding on how paths are resolved between BUILD files.happy-kitchen-89482
08/15/2024, 3:11 PMpath/to/dir:target_namehappy-kitchen-89482
08/15/2024, 3:11 PM:target_name if it’s the same as the dir namehappy-kitchen-89482
08/15/2024, 3:12 PM:target_name means “the target of this name in this directory”happy-kitchen-89482
08/15/2024, 3:12 PMpath/to/file.txthappy-kitchen-89482
08/15/2024, 3:13 PMdependencies=["src/tests:test_csv_files"]happy-kitchen-89482
08/15/2024, 3:14 PMfiles() target in src/tests/test_data/csv/BUILD, but that is not requiredtall-salesclerk-68028
08/15/2024, 4:05 PMBTW you could consider putting thatI will be trying to only reference the files that I need pertarget infiles(), but that is not requiredsrc/tests/test_data/csv/BUILD
BUILD file. Most of the heavy handed glob work will be just to increase quality of life. Nonetheless, I will keep this in mind!
Thank you again, this was tremendous help.
P.S. I integrated pants into more than half of our monorepo. CI time is down from ~50 minutes to ~30 minutes. The final steps will hopefully bring us down to ~15 minutes. Pants is a great tool and its value is tremendous.happy-kitchen-89482
08/15/2024, 7:50 PMtall-salesclerk-68028
08/19/2024, 10:21 PM