Running pants dependencies command twice, gives di...
# general
f
Running pants dependencies command twice, gives different warnings. Anyone know why that would be?
Copy code
(base3.10) matt@DGX-2:~/mlcore$ pants dependencies mlcore/training/gpu_utils.py && echo "********* Second running of dependencies below*******" && pants dependencies mlcore/training/gpu_utils.py 
16:15:28.66 [INFO] waiting for pantsd to start...
16:15:31.27 [INFO] pantsd started
16:15:31.56 [INFO] Initializing scheduler...
16:15:38.44 [INFO] Scheduler initialized.
16:15:40.91 [WARN] Unmatched globs from tests/dummy_data:dummy_data's `sources` field: ["tests/dummy_data/*.py", "tests/dummy_data/*.pyi"], excludes: ["tests/dummy_data/*_test.py", "tests/dummy_data/*_test.pyi", "tests/dummy_data/conftest.py", "tests/dummy_data/test_*.py", "tests/dummy_data/test_*.pyi", "tests/dummy_data/tests.py", "tests/dummy_data/tests.pyi"]

Do the file(s) exist? If so, check if the file(s) are in your `.gitignore` or the global `pants_ignore` option, which may result in Pants not being able to see the file(s) even though they exist on disk. Refer to <https://www.pantsbuild.org/v2.16/docs/troubleshooting#pants-cannot-find-a-file-in-your-project>.
16:15:41.52 [WARN] Pants cannot infer owners for the following imports in the target mlcore/training/gpu_utils.py:

  * GPUtil (line: 7)

If you do not expect an import to be inferrable, add `# pants: no-infer-dep` to the import line. Otherwise, see <https://www.pantsbuild.org/v2.16/docs/troubleshooting#import-errors-and-missing-dependencies> for common problems.
3rdparty/python:default#boto3
mlcore/__init__.py
mlcore/training/__init__.py
********* Second running of dependencies below*******
3rdparty/python:default#boto3
mlcore/__init__.py
mlcore/training/__init__.py
To reset, run it with -ldebug and you'll get the warning on the next dependencies command.
g
Pants utilizes caching heavily, so the second time it doesn't do any of the work since no files have changed. If you
pkill pantsd
in-between you should see it print twice.
f
👍 ok thanks. Any other way to turn that caching off?
g
I think this cache can only be disabled by disabling the pants daemon with
--no-pantsd
. That's called the "rule cache", which is the high-level execution. There's also
--no-local-cache
which is on-disk caches from other processes.
I'd generally avoid
--no-pantsd
since cold starts are quite slow, but if you're working on setting up Pants in your repo it might help to get more consistent outputs.
f
great, thanks! 👍