cold-sugar-54376
08/18/2022, 7:03 PMancient-france-42909
08/18/2022, 9:04 PMancient-france-42909
08/18/2022, 9:13 PM00:06:19.65 [ERROR] Encountered 2 rule graph errors:
No installed rules return the type BuildFileAddressRequest, and it was not provided by potential callers of @rule(pants.engine.internals.build_files:150:find_build_file(BuildFileAddressRequest) -> BuildFileAddress, gets=[Get(AddressFamily, AddressFamilyDir)]).
If that type should be computed by a rule, ensure that that rule is installed.
If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
No source of dependency Get(AddressFamily, AddressFamilyDir) for @rule(pants.engine.internals.build_files:150:find_build_file(BuildFileAddressRequest) -> BuildFileAddress, gets=[Get(AddressFamily, AddressFamilyDir)]). All potential sources were eliminated: []
Traceback (most recent call last):
File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.13.0rc1_py37/lib/python3.7/site-packages/pants/bin/daemon_pants_runner.py", line 130, in single_daemonized_run
scheduler, options_initializer = self._core.prepare(options_bootstrapper, complete_env)
File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.13.0rc1_py37/lib/python3.7/site-packages/pants/pantsd/pants_daemon_core.py", line 175, in prepare
scheduler_restart_explanation,
File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.13.0rc1_py37/lib/python3.7/site-packages/pants/pantsd/pants_daemon_core.py", line 118, in _initialize
raise e
File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.13.0rc1_py37/lib/python3.7/site-packages/pants/pantsd/pants_daemon_core.py", line 109, in _initialize
bootstrap_options, build_config, dynamic_remote_options, self._executor
File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.13.0rc1_py37/lib/python3.7/site-packages/pants/init/engine_initializer.py", line 199, in setup_graph
watch_filesystem=bootstrap_options.watch_filesystem,
File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.13.0rc1_py37/lib/python3.7/site-packages/pants/init/engine_initializer.py", line 323, in setup_graph_extended
watch_filesystem=watch_filesystem,
File "/Users/user/.cache/pants/setup/bootstrap-Darwin-x86_64/2.13.0rc1_py37/lib/python3.7/site-packages/pants/engine/internals/scheduler.py", line 228, in __init__
exec_stategy_opts,
ValueError: Encountered 2 rule graph errors:
No installed rules return the type BuildFileAddressRequest, and it was not provided by potential callers of @rule(pants.engine.internals.build_files:150:find_build_file(BuildFileAddressRequest) -> BuildFileAddress, gets=[Get(AddressFamily, AddressFamilyDir)]).
If that type should be computed by a rule, ensure that that rule is installed.
If it should be provided by a caller, ensure that it is included in any relevant Query or Get.
No source of dependency Get(AddressFamily, AddressFamilyDir) for @rule(pants.engine.internals.build_files:150:find_build_file(BuildFileAddressRequest) -> BuildFileAddress, gets=[Get(AddressFamily, AddressFamilyDir)]). All potential sources were eliminated: []
ancient-france-42909
08/18/2022, 11:37 PMgenerate-lockfiles
takes 5 minutes per βthingβ, how can I find out why?ancient-france-42909
08/19/2022, 12:01 AMupdate-build-scripts
or whatever the command is called is implemented, but I had to write two ast
+ astor
scripts to fix things in BUILD
files. Is there a better way? (Only one was an error, the fact that you cannot include conftest.py
fiels now in your python_tests
)quiet-painter-18838
08/19/2022, 12:29 AM.pydistutils.cfg
[build_ext]
include_dirs=<YOUR PATH>/include/
library_dirs=<YOUR PATH>/lib/
I have confirmed it works fine if I have tried $ pip install pyaudio
in my terminal with the above file. My question is how can we apply this in pantsbuild environment. Could you help me?ancient-rose-27306
08/19/2022, 3:56 AMpants.toml
file and downloaded pants
script. Afterwards when I ran the command ./pants --version
, its giving me following error:
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$ ./pants --version
Bootstrapping Pants using /opt/anaconda3/envs/pants/bin/python3.7
Creating the virtualenv PEX.
Downloading the Pex PEX.
SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.62/pex> verified.
Installing pantsbuild.pants==2.12.0 into a virtual environment at /Users/dheerajramchandani/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37
ERROR: Could not find a version that satisfies the requirement pantsbuild.pants==2.12.0 (from versions: 0.0.17, 0.0.18, 0.0.20, 0.0.21, 0.0.22, 0.0.23, 0.0.24, 0.0.25, 0.0.26, 0.0.27, 0.0.28, 0.0.29, 0.0.30, 0.0.31, 0.0.32, 0.0.33, 0.0.34, 0.0.35, 0.0.36, 0.0.37, 0.0.38, 0.0.39, 0.0.40, 0.0.41, 0.0.42, 0.0.43, 0.0.44, 0.0.45, 0.0.46, 0.0.47, 0.0.48, 0.0.49, 0.0.50, 0.0.51, 0.0.52, 0.0.53, 0.0.54, 0.0.55, 0.0.56, 0.0.57, 0.0.58, 0.0.59, 0.0.60, 0.0.61, 0.0.62, 0.0.63, 0.0.64, 0.0.65, 0.0.66, 0.0.67, 0.0.68, 0.0.69, 0.0.70, 0.0.71, 0.0.72, 0.0.73, 0.0.74, 0.0.75, 0.0.76, 0.0.77, 0.0.79, 0.0.80, 0.0.81, 0.0.82, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.15.0, 1.16.0, 1.17.0, 1.18.0, 1.19.0, 1.20.0, 1.21.0, 1.22.0, 1.23.0, 1.24.0, 1.25.0, 1.26.0, 1.27.0, 1.28.0, 1.29.0, 1.30.0, 1.30.1, 1.30.2, 1.30.3, 1.30.4, 1.30.5rc1, 2.0.0, 2.0.1, 2.0.2, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.4.0, 2.4.1, 2.4.2)
ERROR: No matching distribution found for pantsbuild.pants==2.12.0
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$
Based on the error message, I figured something in my setup is not compatible with pants version 2.12.0 and changed the version in the pants.toml
file to 2.4.0
but to no avail. It did not bootstrap and started giving other errors:
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$ ./pants --version
Bootstrapping Pants using /opt/anaconda3/envs/pants/bin/python3.7
Installing pantsbuild.pants==2.4.0 into a virtual environment at /Users/dheerajramchandani/.cache/pants/setup/bootstrap-Darwin-x86_64/2.4.0_py37
New virtual environment successfully created at /Users/dheerajramchandani/.cache/pants/setup/bootstrap-Darwin-x86_64/2.4.0_py37.
23:25:08.23 [INFO] initializing scheduler...
Traceback (most recent call last):
File "/Users/dheerajramchandani/.cache/pants/setup/bootstrap-Darwin-x86_64/2.4.0_py37/lib/python3.7/site-packages/pants/init/extension_loader.py", line 128, in load_backend
module = importlib.import_module(backend_module)
File "/opt/anaconda3/envs/pants/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pants.backend.experimental'
23:25:08.30 [ERROR] Failed to load the pants.backend.experimental.python.lint.autoflake.register backend: ModuleNotFoundError("No module named 'pants.backend.experimental'")
(Use --print-stacktrace to see more error details.)
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$
I removed the backend 'pants.backend.experimental'
that the error pointed at but received error for another backend:
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$ ./pants --version
23:25:40.91 [INFO] initializing scheduler...
Traceback (most recent call last):
File "/Users/dheerajramchandani/.cache/pants/setup/bootstrap-Darwin-x86_64/2.4.0_py37/lib/python3.7/site-packages/pants/init/extension_loader.py", line 128, in load_backend
module = importlib.import_module(backend_module)
File "/opt/anaconda3/envs/pants/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pants.backend.plugin_development'
23:25:40.99 [ERROR] Failed to load the pants.backend.plugin_development.register backend: ModuleNotFoundError("No module named 'pants.backend.plugin_development'")
(Use --print-stacktrace to see more error details.)
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$ ./pants --version
23:26:05.25 [INFO] initializing scheduler...
23:26:05.96 [INFO] scheduler initialized.
23:26:05.99 [ERROR] Invalid scope [python] in /Users/dheerajramchandani/pants-training/pants.toml
23:26:05.99 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
(Specify --no-verify-config to disable this check.)
(Use --print-stacktrace to see more error details.)
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$
Finally, after removing this backend I received the following error which is not much helpful:
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$ ./pants --version
23:26:05.25 [INFO] initializing scheduler...
23:26:05.96 [INFO] scheduler initialized.
23:26:05.99 [ERROR] Invalid scope [python] in /Users/dheerajramchandani/pants-training/pants.toml
23:26:05.99 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
(Specify --no-verify-config to disable this check.)
(Use --print-stacktrace to see more error details.)
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$
Why does it say invalid scope for [python]? I have used this scope with pants v1 and with v2.12 and it bootstrapped fine. Was this scope removed sometime after v1 and reintroduced after 2.4.0?
Could anyone please help me bootstrap pants with version 2.12.0?enough-analyst-54434
08/19/2022, 4:04 AMancient-rose-27306
08/19/2022, 4:04 AMancient-rose-27306
08/19/2022, 4:06 AMenough-analyst-54434
08/19/2022, 4:06 AMenough-analyst-54434
08/19/2022, 4:07 AMenough-analyst-54434
08/19/2022, 4:11 AM./pants -V
works, you can run ./build-support/bin/release.sh --build-wheels
to build a wheel that works on your machine.enough-analyst-54434
08/19/2022, 4:13 AMgit checkout release_2.12.0
.enough-analyst-54434
08/19/2022, 4:14 AMancient-rose-27306
08/19/2022, 4:16 AMancient-rose-27306
08/19/2022, 4:17 AMhandsome-sunset-98068
08/19/2022, 6:07 AM.
βββ 3rdparty
β βββ python
β βββ default.lock
βββ BUILD
βββ pants
βββ pants.toml
βββ poetry.lock
βββ projects
β βββ proj1
β β βββ BUILD
β β βββ manage.py
β β βββ proj1
β β βββ BUILD
β β βββ __init__.py
β β βββ asgi.py
β β βββ settings.py
β β βββ urls.py
β β βββ wsgi.py
β βββ proj2
β βββ ...
βββ pyproject.toml
Here's my pants.toml:
[GLOBAL]
pants_version = "2.12.0"
backend_packages.add = [
'pants.backend.python',
]
[anonymous-telemetry]
enabled = false
[source]
root_patterns = ["/"]
[python]
enable_resolves = true
lockfile_generator = "pex"
[python-infer]
string_imports = true
Here's my projects/proj1/BUILD:
pex_binary(
name="manage",
entry_point="manage.py",
)
python_sources()
Here's my projects/proj1/proj1/BUILD:
python_sources()
I am trying to run the runserver command with pants:
./pants run projects/proj1/:manage -- runserver
But I am getting an error with stack trace:
Traceback (most recent call last):
File "/Users/reksus/.cache/pants/named_caches/pex_root/installed_wheels/115baf5049d5cf4163e43492cdc7139c306ed6d451e7d3571fe9612903903713/Django-3.2.15-py3-none-any.whl/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/reksus/.cache/pants/named_caches/pex_root/installed_wheels/115baf5049d5cf4163e43492cdc7139c306ed6d451e7d3571fe9612903903713/Django-3.2.15-py3-none-any.whl/django/core/management/commands/runserver.py", line 61, in execute
super().execute(*args, **options)
File "/Users/reksus/.cache/pants/named_caches/pex_root/installed_wheels/115baf5049d5cf4163e43492cdc7139c306ed6d451e7d3571fe9612903903713/Django-3.2.15-py3-none-any.whl/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/Users/reksus/.cache/pants/named_caches/pex_root/installed_wheels/115baf5049d5cf4163e43492cdc7139c306ed6d451e7d3571fe9612903903713/Django-3.2.15-py3-none-any.whl/django/core/management/commands/runserver.py", line 68, in handle
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
File "/Users/reksus/.cache/pants/named_caches/pex_root/installed_wheels/115baf5049d5cf4163e43492cdc7139c306ed6d451e7d3571fe9612903903713/Django-3.2.15-py3-none-any.whl/django/conf/__init__.py", line 82, in __getattr__
self._setup(name)
File "/Users/reksus/.cache/pants/named_caches/pex_root/installed_wheels/115baf5049d5cf4163e43492cdc7139c306ed6d451e7d3571fe9612903903713/Django-3.2.15-py3-none-any.whl/django/conf/__init__.py", line 69, in _setup
self._wrapped = Settings(settings_module)
File "/Users/reksus/.cache/pants/named_caches/pex_root/installed_wheels/115baf5049d5cf4163e43492cdc7139c306ed6d451e7d3571fe9612903903713/Django-3.2.15-py3-none-any.whl/django/conf/__init__.py", line 170, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'proj1'
I tried updating the projects/proj1/BUILD:
pex_binary(
name="manage",
entry_point="manage.py",
dependencies=[
"projects/proj1/proj1:proj1",
]
)
python_sources()
But still the same error. What am I missing here?ancient-rose-27306
08/19/2022, 6:12 AM./pants tailor
and got following output:
(pants) [root@9a5752857756 pants-training]# ./pants tailor
Created src/client/BUILD:
- Add python_sources target client
- Add pex_binary target greeter_client
Created src/proto/BUILD:
- Add protobuf_sources target proto
Created src/server/BUILD:
- Add pex_binary target greeter_server
- Add python_requirements target reqs
- Add python_sources target server
(pants) [root@9a5752857756 pants-training]#
After that I did ./pants package src/server/greeter_server.py
and encountered following error:
(pants) [root@9a5752857756 pants-training]# ./pants package src/server/greeter_server.py
05:54:49.45 [ERROR] 1 Exception encountered:
IndexError: string index out of range
(pants) [root@9a5752857756 pants-training]#
Could someone please help? My goal is to generate the stubs from the proto files and publish them as python wheels so that I can pip install them and use them in client and server code.
Following is how my repo looks:
(pants) [root@9a5752857756 pants-training]# /tree.sh
Tree of: /root/pants-training
.
|__pants
|__src
| |__proto
| | |__helloworld.proto
| | |__BUILD
| |__server
| | |__requirements.txt
| | |__greeter_server.py
| | |__BUILD
| |__client
| | |__greeter_client.py
| | |__BUILD
|__.pants.d
| |__exceptions.log
| |__exceptions.471.log
| |__run-tracker
| | |__pants_run_2022_08_19_05_55_17_757_5184323f0cce42809255925d6987ccbe
| | | |__logs
| | |__pants_run_2022_08_19_05_55_11_114_e3698008d5454c2aa6d584bf5680eaed
| | | |__logs
| | |__pants_run_2022_08_19_05_53_24_325_48f808a97d1c4c8aa6faad9261780e60
| | | |__logs
| | |__pants_run_2022_08_19_05_48_46_160_81dfa93f029b44f0bc191a8560c255c6
| | | |__logs
| | |__pants_run_2022_08_19_05_54_45_113_dee6bff2c02a414c94a754c60781580c
| | | |__logs
| | |__pants_run_2022_08_19_05_54_08_319_a3964cb6faa049c7917933ccfe3ede11
| | | |__logs
| |__pants.log
|__pants.toml
|__.pids
| |__855f83c10083
| | |__pantsd
| | | |__socket
| | | |__pid
| | | |__process_name
| | | |__fingerprint
| |__.lock.pantsd
ancient-rose-27306
08/19/2022, 1:50 PM::
with any goal:
(pants) [root@9a5752857756 pants-training]# ./pants peek ::
13:48:35.36 [ERROR] 1 Exception encountered:
IndexError: string index out of range
(pants) [root@9a5752857756 pants-training]#
Any insight into this would be really helpful?ancient-rose-27306
08/19/2022, 1:52 PMpython_distribution
targets:
(pants) [root@9a5752857756 pants-training]# ./pants package src/server:grpc-server
13:51:25.81 [ERROR] 1 Exception encountered:
IndexError: string index out of range
(pants) [root@9a5752857756 pants-training]#
Could anyone please help here?ancient-rose-27306
08/19/2022, 2:21 PMIndexError: string index out of range
is a rather generic one. See example below:
(pants) [root@9a5752857756 pants-training]# ./pants dependencies src/server/greeter_server.py
src/proto/helloworld.proto
src/server/greeter_server.py
(pants) [root@9a5752857756 pants-training]# ./pants dependees src/server/greeter_server.py
14:18:47.17 [ERROR] 1 Exception encountered:
IndexError: string index out of range
(pants) [root@9a5752857756 pants-training]#
The dependencies
goal worked but dependees
failed on the same target. If the target doesnβt have any dependees then I guess it shouldnβt fail.proud-dentist-22844
08/19/2022, 3:04 PMgorgeous-addition-6562
08/19/2022, 5:32 PMancient-france-42909
08/19/2022, 6:04 PMancient-france-42909
08/19/2022, 7:09 PMpylint
. We have a lot of apps and for some in particular, when I run ./pants --changed-since=foo lint
(which for this PR runs it on all the repo, since I changed every BUILD file) I get a lot of nonsensical errors, like complaints about modules not having members they definitely should have. This only runs on the CI, since itβd take forever on my mac, but I thought I could debug it by trying to lint the file, howeverβ¦ When I do that, it doesnβt happen. Even if I try to lint the whole directory. This seems to be related to namespace packages. The simplest example is we have a folder called audit
in which we have several packages, one of them being lib
. So in audit/lib
we have a BUILD file and then the sources are in audit/lib/src/audit/lib/
(with another BUILD in audit/lib/src/
) and tests in audit/lib/tests/
. When we run it on the CI:
audit/lib/tests/unit/test_validate_event.py:73:24: E1101: Module 'audit' has no 'lib' member (no-member)
And, yes, the tests depend on "audit/lib/src:lib"
. However, as I said, when I just run pylint locally on audit/
, I donβt get this problem. Iβm really at a loss at how I can debug this. Also, this problem appeared (presumably) after updating from 2.6 to 2.12 and is still present in 2.13, but it could just be that this PR runs against a lot of targets and thatβs related somehow. Any ideas?ancient-breakfast-45303
08/19/2022, 8:02 PMpex --lock ...
that pants only considers the urls in the lock file and not the --find-links
and --index
arguments? I have a case where a lockfile references pypi but I need to build a pex in a constrained environment where the artifacts need to be downloaded from an internal registry.wide-midnight-78598
08/20/2022, 12:37 AMflat-zoo-31952
08/20/2022, 11:16 AMripe-cpu-85141
08/20/2022, 4:10 PM./pants check ::
mypy yells at me saying there is a duplicate module named turbocorp
which is true but also the purpose of the namespace π
Do you know how I can fix that? I try to use --exclude
but I can't find a way to please mypy π
https://github.com/Gaasmann/monorepants