rapid-bird-79300
06/01/2022, 4:23 PMapi.py
in a module, we want the tests for this module to have this as a dependency python_tests(dependencies=[app/module_1/api.py])
.
I was thinking either a custom plugin (maybe somehow hooks into to tailor) or possibly a macro. Curious if anyone has done something similar or have a suggestion on best approach for this.hundreds-father-404
06/01/2022, 4:27 PMrapid-bird-79300
06/01/2022, 4:29 PMhundreds-father-404
06/01/2022, 4:33 PMunfortunately no these are not imported in test modules.Imported in what way? Test imports should still work
rapid-bird-79300
06/01/2022, 4:34 PMapi.py
will not run required tests. We want to automate to ensure on changes to api.py
we run required testsrapid-bird-79300
06/01/2022, 4:35 PMhundreds-father-404
06/01/2022, 4:43 PMimport foo.api
, right?rapid-bird-79300
06/01/2022, 4:44 PMhundreds-father-404
06/01/2022, 4:45 PMtailor
-- when it's possible to infer, we generally encourage that
A relevant example is how we infer deps on init.py. It's relevant because it's based purely on file paths, rather than parsing the .py file contents. https://github.com/pantsbuild/pants/blob/c0ba9ffeeb98e9ec17ad4bf69f98470ef113a1d5/src/python/pants/backend/python/dependency_inference/rules.py#L464rapid-bird-79300
06/01/2022, 4:46 PMhundreds-father-404
06/01/2022, 4:52 PMrapid-bird-79300
06/01/2022, 4:53 PMUnionRule
the bread and butter here for augmenting??hundreds-father-404
06/01/2022, 4:56 PMsetup-py
require a target only has one implementation, due to ambiguityrapid-bird-79300
06/01/2022, 4:57 PM