https://pantsbuild.org/ logo
#general
Title
# general
p

purple-plastic-57801

03/04/2023, 7:40 PM
A current workflow that we have is that make is used to download several artifacts that are required to test. In bazel land, I have a written rules that will grab external dependencies, and associate them as dependencies for whichever label I’m building as needed. Is there a way to do the same thing in pants?
e

enough-analyst-54434

03/04/2023, 7:41 PM
Pants subsets the lock for each test file executed.
Each test runs with exactly and only its real deps IOW.
Is that what you mean?
Or by artifact do you mean blob - not Python package dependency artifact? Like a text file or something.
p

purple-plastic-57801

03/04/2023, 7:43 PM
Correct. An external resource that is required for the test to run. Test data.
So is there a way to specify this external HTTP endpoint and checksum are dependencies for this test target?
e

enough-analyst-54434

03/04/2023, 7:44 PM
See `resource`: https://www.pantsbuild.org/docs/reference-resource#codesourcecode You would depend on a resource.
Those sorts of deps are ~obviously not inferrable. You have to go old school and edit the
python_tests
target
dependencies
list in a
BUILD
file for that.
So, you just add 1 dependency entry. The rest of the Python import deps 1st and 3rd party are still inferred. That manual addition is just added in.
👍 1
3 Views