flaky-match-48400
03/13/2024, 10:09 AMpython_test
that depends on a shell_command
(which generates a Python extension module needed by the test).
pants test
uses that dependency: it calls the shell_command
as needed and puts its output in the sandbox when executing the test.
The problem: pants check
does not use that dependency: it does not run the shell_command
before running the type-checker and it does not put the output of the shell command into the sandbox -> the type-checker fails to find that import and complains.
Does anyone have any suggestions on how to convince pants to place that generated extension module in the sandbox in which pants check
is run?fresh-cat-90827
03/13/2024, 4:00 PMcheck
goal, I am not sure whether this approach would work. I have seen a few similar attempts to make python_sources
depend on some shell related logic, see
https://pantsbuild.slack.com/archives/C0D7TNJHL/p1671827626536889
https://pantsbuild.slack.com/archives/C046T6T9U/p1699964896277789
Maybe those could be of help.flaky-match-48400
03/13/2024, 4:02 PMpants check
depend on a generated file? pants would just have to...not ignore the dependency 😬flaky-match-48400
03/13/2024, 4:02 PMfresh-cat-90827
03/13/2024, 4:03 PMshell_command
as a dependency in https://www.pantsbuild.org/2.18/reference/targets/python_sources#dependencies?fresh-cat-90827
03/13/2024, 4:04 PMpython_sources
which would require those files you generateflaky-match-48400
03/13/2024, 4:12 PMfresh-cat-90827
03/13/2024, 4:13 PMflaky-match-48400
03/13/2024, 4:25 PMexperimental_wrap_as_python_sources
(mentioned in your first link) seems to be exactly what I was looking for! somehow my web and pants docs searches hadn't turned it upfresh-cat-90827
03/13/2024, 4:26 PMflaky-match-48400
03/13/2024, 4:27 PMflaky-match-48400
03/13/2024, 4:27 PMfresh-cat-90827
03/13/2024, 4:27 PMgorgeous-winter-99296
03/13/2024, 6:08 PMflaky-match-48400
03/13/2024, 8:10 PM