curved-television-6568
03/22/2021, 1:45 PM$ ./pants dependencies src/xx/core/data:tests
src/xx/core/data/factory_test.py:tests
src/xx/core/data/manifest.py
src/xx/core/data/manifest_test.py:tests
src/xx/core/data/metadata.py
src/xx/core/data/spec.py
src/xx:deal
expected a few more there, as I’ve added import
statements in the factory_test.py file.. and, right enough, after killing pantsd
and running again, they show up:
$ ./pants dependencies src/xx/core/data:tests
14:45:07.09 [INFO] initializing scheduler...
14:45:07.69 [INFO] scheduler initialized.
src/xx/core/data/factory_test.py:tests
src/xx/core/data/manifest.py
src/xx/core/data/manifest_test.py:tests
src/xx/core/data/metadata.py
src/xx/core/data/spec.py
src/xx:deal
src/xx:hypothesis-jsonschema
src/xx:marshmallow-jsonschema
This is on pants:
$ ./pants --version
2.4.0.dev3
witty-crayon-22786
03/22/2021, 4:22 PMwitty-crayon-22786
03/22/2021, 4:22 PM.pants.d/pants.log
from the time period before/around those runs?witty-crayon-22786
03/22/2021, 4:23 PMwitty-crayon-22786
03/22/2021, 4:59 PMcurved-television-6568
03/22/2021, 6:31 PMwitty-crayon-22786
03/22/2021, 6:35 PMwitty-crayon-22786
03/22/2021, 6:35 PMwitty-crayon-22786
03/22/2021, 6:36 PMrequirements.txt
files?curved-television-6568
03/22/2021, 6:36 PMcurved-television-6568
03/22/2021, 6:37 PMcurved-television-6568
03/23/2021, 9:38 AM/Users/x/.cache/pants/named_caches/pex_root/venvs/7226ac3b42a360653de16c64df0654e1f49252be/b0f1efb7774678bcd862110dbf4ecc25d6b24755/lib/python3.8/site-packages/marshmallow_jsonschema/__init__.py:1: in <module>
from pkg_resources import get_distribution
E ModuleNotFoundError: No module named 'pkg_resources'
this did not go away by killing pantsd. I’ve added setuptools to the module_mapping of the python_requirements target, but it didn’t seem to help (I guess it should help, but it doesn’t feel like my change to the BUILD file has been picked up..)
Also, as my requirements.txt file, and the accompanying BUILD file was not in the root, I moved it up a notch, so it is at least in a source root now… maybe it needs to move all the way up to the root?curved-television-6568
03/23/2021, 9:42 AMhundreds-father-404
03/23/2021, 2:12 PMwitty-crayon-22786
03/23/2021, 4:43 PMI’ve added setuptools to the module_mapping of the python_requirements target, but it didn’t seem to help (I guess it should help, but it doesn’t feel like my change to the BUILD file has been picked up..)there is no caching of the parsing of BUILD files independent of
pantsd
, so if restarting pantsd
didn’t affect it, then it’s unlikely to be a caching issue.witty-crayon-22786
03/23/2021, 4:44 PMpkg_resources
is unlikely to have a collision elsewhere in the repository.curved-television-6568
03/23/2021, 4:49 PMpython_requirements(
module_mapping={
"setuptools":["pkg_resources"]
}
)
hundreds-father-404
03/23/2021, 4:51 PM./pants dependencies --type=3rdparty ::
- do you see setuptools
> 1 time?curved-television-6568
03/23/2021, 4:55 PMcurved-television-6568
03/23/2021, 4:57 PMhundreds-father-404
03/23/2021, 4:58 PMwitty-crayon-22786
03/23/2021, 5:00 PMpantsd
should be pretty rare… and if restarting pantsd
does nothing, then it is very likely to just be a configuration/BUILD file content/layout problemcurved-television-6568
03/23/2021, 5:01 PMhundreds-father-404
03/23/2021, 5:04 PMcurved-television-6568
03/23/2021, 5:24 PMhundreds-father-404
03/23/2021, 5:25 PM__run.sh
script. Although, to be clear, I don't think that would be super relevant to dependency inference not working. That doesn't involve running a process in a chrootcurved-television-6568
03/26/2021, 3:21 PM$ ./pants package src/xx/cli:
16:05:58.20 [INFO] Completed: Building src.xx.cli/xx.pex
16:05:58.21 [INFO] Wrote dist/src.xx.cli/xx.pex
$ ./dist/src.xx.cli/xx.pex --help
Traceback (most recent call last):
...
File "/Users/zz/src/svs/python/xx/dist/src.xx.cli/xx.pex/xx/cli/main.py", line 2, in <module>
ModuleNotFoundError: No module named 'click'
$ ./pants dependencies src/xx/cli/main.py
## no output
# added click to requirements.txt and retried above with same outcome. then..
KILLED pantsd
$ ./pants dependencies src/xx/cli/main.py
src:click
$ ./pants package src/xx/cli:xx
16:13:53.34 [INFO] Completed: Resolving 1 requirement: click
16:13:54.49 [INFO] Completed: Building src.xx.cli/xx.pex
16:13:54.49 [INFO] Wrote dist/src.xx.cli/xx.pex
$ ./dist/src.xx.cli/xx.pex --help
Traceback (most recent call last):
...
AttributeError: module 'xx.cli.main' has no attribute '__path__'
# click is found, unrelated issues remain
witty-crayon-22786
03/26/2021, 3:27 PMcurved-television-6568
03/26/2021, 3:35 PM$ tree src/
src/
├── BUILD
├── xx
│ ├── __init__.py
│ ├── cli
│ │ ├── BUILD
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── main.py
├── requirements.txt
curved-television-6568
03/26/2021, 3:37 PM$ cat src/BUILD
# -*- mode: python -*-
python_requirements(
module_mapping={
"setuptools":["pkg_resources"]
}
)
$ cat src/xx/cli/BUILD
# -*- mode: python -*-
python_library()
pex_binary(
name="xx",
entry_point="xx.cli.main:main"
)
curved-television-6568
03/26/2021, 3:38 PM$ cat src/xx/cli/main.py
"""xx console entry point"""
import click
@click.command('xx')
def main() -> int:
print('hello from xx')
return 3
witty-crayon-22786
03/26/2021, 3:40 PMwitty-crayon-22786
03/26/2021, 3:41 PMcurved-television-6568
03/26/2021, 4:01 PM$ cat .pants.d/pants.log
16:10:04.34 [INFO] handling request: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 dependencies --transitive src/xx/cli/main.py`
16:10:08.02 [INFO] request completed: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 dependencies --transitive src/xx/cli/main.py`
16:10:12.92 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".emacs.desktop", ""}
16:10:12.92 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".emacs.desktop", ""}
16:10:12.92 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
16:10:12.92 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
16:10:12.93 [INFO] notify invalidation: cleared 1 and dirtied 234 nodes for: {"", ".emacs.desktop"}
16:10:12.93 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".emacs.desktop", ""}
16:10:12.93 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
16:10:12.93 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
16:13:46.61 [INFO] handling request: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 package src/xx/cli:xx`
16:13:54.49 [INFO] request completed: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 package src/xx/cli:xx`
16:18:41.90 [INFO] handling request: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 dependencies src/xx/cli/main.py`
16:18:42.02 [INFO] request completed: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 dependencies src/xx/cli/main.py`
16:21:02.50 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".emacs.desktop", ""}
16:21:02.50 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".emacs.desktop", ""}
16:21:02.50 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
16:21:02.50 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
16:21:02.50 [INFO] notify invalidation: cleared 1 and dirtied 272 nodes for: {".emacs.desktop", ""}
16:21:02.50 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".emacs.desktop", ""}
16:21:02.50 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
16:21:02.50 [INFO] notify invalidation: cleared 1 and dirtied 272 nodes for: {"", ".#.emacs.desktop"}
16:21:02.50 [INFO] Filesystem changed during run: retrying `PySnapshot` in 500ms...
16:24:46.65 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli", "src/xx/cli/.#BUILD"}
16:24:46.65 [INFO] notify invalidation: cleared 1 and dirtied 87 nodes for: {"src/xx/cli/.#BUILD", "src/xx/cli"}
16:24:47.86 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli", "src/xx/cli/BUILD"}
16:24:47.86 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli", "src/xx/cli/BUILD"}
16:24:47.86 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli/.#BUILD", "src/xx/cli"}
16:24:47.86 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli", "src/xx/cli/.#BUILD"}
16:24:47.86 [INFO] notify invalidation: cleared 1 and dirtied 61 nodes for: {"src/xx/cli", "src/xx/cli/BUILD"}
16:24:47.86 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli", "src/xx/cli/BUILD"}
16:24:47.86 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli", "src/xx/cli/.#BUILD"}
16:24:47.86 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli/.#BUILD", "src/xx/cli"}
16:24:56.11 [INFO] handling request: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 package src/xx/cli:xx`
16:24:57.79 [INFO] request completed: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 package src/xx/cli:xx`
16:25:05.11 [INFO] Extending leases
16:25:05.12 [INFO] Done extending leases
16:25:18.18 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".emacs.desktop"}
16:25:18.18 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".emacs.desktop"}
16:25:18.18 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
16:25:18.18 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
16:25:18.18 [INFO] notify invalidation: cleared 1 and dirtied 282 nodes for: {"", ".emacs.desktop"}
16:25:18.18 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".emacs.desktop"}
16:25:18.18 [INFO] notify invalidation: cleared 1 and dirtied 282 nodes for: {".#.emacs.desktop", ""}
16:25:18.18 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
16:25:18.18 [INFO] Filesystem changed during run: retrying `PySnapshot` in 500ms...
16:35:56.56 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".emacs.desktop", ""}
16:35:56.57 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".emacs.desktop"}
16:35:56.57 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
16:35:56.57 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
16:35:56.57 [INFO] notify invalidation: cleared 1 and dirtied 282 nodes for: {"", ".emacs.desktop"}
16:35:56.57 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".emacs.desktop", ""}
16:35:56.57 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
16:35:56.57 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
16:40:05.37 [INFO] Extending leases
16:40:05.38 [INFO] Done extending leases
16:55:05.82 [INFO] Extending leases
16:55:05.83 [INFO] Done extending leases
I’ll see what happens if I add another unlisted dep…curved-television-6568
03/26/2021, 4:05 PM$ ./pants package src/xx/cli:xx
17:03:01.07 [INFO] Completed: Building src.xx.cli/xx.pex
17:03:01.07 [INFO] Wrote dist/src.xx.cli/xx.pex
zz@zz-mac-...:~/src/svs/python/xx (refactoring-setup *)
$ ./dist/src.xx.cli/xx.pex
Traceback (most recent call last):
...
File "/Users/zz/src/svs/python/xx/dist/src.xx.cli/xx.pex/xx/cli/main.py", line 3, in <module>
ModuleNotFoundError: No module named 'kazoo'
zz@zz-mac-...:~/src/svs/python/xx (refactoring-setup *)
$ cat .pants.d/pants.log
16:10:04.34 [INFO] handling request: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 dependencies --transitive src/xx/cli/main.py`
[...]
16:55:05.83 [INFO] Done extending leases
17:01:49.82 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli/.#main.py", "src/xx/cli"}
17:01:49.82 [INFO] notify invalidation: cleared 1 and dirtied 97 nodes for: {"src/xx/cli", "src/xx/cli/.#main.py"}
17:02:21.88 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli/main.py", "src/xx/cli"}
17:02:21.88 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli", "src/xx/cli/main.py"}
17:02:21.88 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli", "src/xx/cli/.#main.py"}
17:02:21.88 [INFO] notify invalidation: cleared 1 and dirtied 36 nodes for: {"src/xx/cli", "src/xx/cli/main.py"}
17:02:21.88 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli", "src/xx/cli/main.py"}
17:02:21.88 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/xx/cli", "src/xx/cli/.#main.py"}
17:02:51.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
17:02:51.94 [INFO] notify invalidation: cleared 1 and dirtied 282 nodes for: {"", ".#.emacs.desktop"}
17:02:51.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".emacs.desktop"}
17:02:51.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".emacs.desktop"}
17:02:51.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
17:02:51.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
17:02:51.94 [INFO] notify invalidation: cleared 1 and dirtied 282 nodes for: {".emacs.desktop", ""}
17:02:51.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".emacs.desktop", ""}
17:02:51.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
17:02:51.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
17:02:57.59 [INFO] handling request: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 package src/xx/cli:xx`
17:03:01.07 [INFO] request completed: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 package src/xx/cli:xx`
zz@zz-mac-...:~/src/svs/python/xx (refactoring-setup *)
$
curved-television-6568
03/26/2021, 4:07 PM./pants package
again..
17:03:01.07 [INFO] request completed: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 package src/xx/cli:xx`
17:05:44.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".emacs.desktop"}
17:05:44.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".emacs.desktop", ""}
17:05:44.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
17:05:44.94 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".#.emacs.desktop"}
17:05:44.95 [INFO] notify invalidation: cleared 1 and dirtied 286 nodes for: {".emacs.desktop", ""}
17:05:44.95 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"", ".emacs.desktop"}
17:05:44.95 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
17:05:44.95 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {".#.emacs.desktop", ""}
17:05:58.04 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/.#requirements.txt", "src"}
17:05:58.04 [INFO] notify invalidation: cleared 1 and dirtied 282 nodes for: {"src", "src/.#requirements.txt"}
17:06:00.44 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src", "src/requirements.txt"}
17:06:00.45 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src", "src/requirements.txt"}
17:06:00.45 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src", "src/.#requirements.txt"}
17:06:00.45 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/.#requirements.txt", "src"}
17:06:00.45 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/requirements.txt", "src"}
17:06:00.45 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src", "src/requirements.txt"}
17:06:00.45 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src/.#requirements.txt", "src"}
17:06:00.45 [INFO] notify invalidation: cleared 0 and dirtied 0 nodes for: {"src", "src/.#requirements.txt"}
17:06:06.68 [INFO] handling request: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 package src/xx/cli:xx`
17:06:06.78 [INFO] request completed: `--pants-bin-name=./pants --pants-version=2.4.0.dev3 package src/xx/cli:xx`
curved-television-6568
03/26/2021, 4:09 PMwitty-crayon-22786
03/26/2021, 4:22 PMwitty-crayon-22786
03/26/2021, 4:22 PMwitty-crayon-22786
03/26/2021, 4:22 PMsrc/requirements.txt
is not being matched.witty-crayon-22786
03/26/2021, 4:24 PM[GLOBAL]
section of pants.toml
:
pantsd_invalidation_globs.add = [
"src/requirements.txt",
]
or if you have multiple requirements files:
pantsd_invalidation_globs.add = [
"**/requirements.txt",
]
curved-television-6568
03/26/2021, 4:27 PMwitty-crayon-22786
03/26/2021, 4:34 PMcurved-television-6568
03/26/2021, 4:34 PMcurved-television-6568
03/26/2021, 4:35 PM