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

incalculable-grass-76623

08/18/2022, 12:12 AM
I am running to conversions of a few repos to Pants and am wondering if there are techniques for performance improvements in how or what I am doing ...
Copy code
./pants test libs/somelib/tests/decorators/test_foobar.py
After this begins,
Pants
starts by building a
pex
from the requirements.txt .. (and tests_requirements.txt)
Copy code
10:06:26.17 [INFO] Canceled: Building requirements.pex with 31 requirements: ... etc ... (381 characters truncated)
10:06:32.25 [INFO] Completed: Building pytest.pex from pytest_default.lock
10:07:08.96 [INFO] Completed: Building requirements.pex with 31 requirements: ... etc ... (381 characters truncated)
the requirements are in the
BUILD
file as
Copy code
python_requirements(
    name="requirements"
)

python_requirements(
    name="test_requirements",
    source="test_requirements.txt",
)
two questions. 1. why does Pants "Cancel" the first build but then proceed immediately to build it. 2. how can I get Pants to cache this file, it hasn;t changed and everytime i run the test, it rebuilds the requirements.pex which is 60s.
w

witty-crayon-22786

08/18/2022, 3:23 AM
the Canceled is because it is trying to “clean” the graph from a previous run and then failing. that should only happen if something has actually changed. so to check on that, you should look in
.pants.d/pants.log
, which will show which files pants thinks have changed
i

incalculable-grass-76623

08/18/2022, 5:44 AM
gotcha - ok
thanks
w

witty-crayon-22786

08/18/2022, 4:50 PM
Did you find something?