sparse-lifeguard-9573701/19/2023, 8:17 PM
sparse-lifeguard-9573701/19/2023, 8:18 PM
happy-kitchen-8948201/19/2023, 8:20 PM
high-magician-4618801/19/2023, 9:54 PM
part of the documentation is referring to. In my case, the lockfile and the reqs file are in the root of the repo, what does the path need to be in that case?
late-keyboard-8931401/19/2023, 9:59 PM
to a project and can’t quite get pants to properly resolve its dependencies: When doing a
which imports from
./pants run src/python/my_project/script.py
, I get an error with the protobuf module:
Now, I can see in my lockfile that
from google.protobuf.internal import builder as _builder ModuleNotFoundError: No module named 'google.protobuf'
properly declares this dep, so I’m not sure why pants isn’t including it. The module name/import mapping are in the defaults here, and my lockfile contains the following:
This is purely a transitive dependency, do I have to explicitly specify it via a
"project_name": "authzed", "requires_dists": [ "async_generator<2.0,>=1.10", "google-api-core<3.0.0,>=2.4.0", "google_api<0.2.0,>=0.1.12", "grpcio==1.50.0", "mock<5.0.0,>=4.0.3", "protobuf==3.20.2", "protoc-gen-validate<0.5.0,>=0.4.1", "typing-extensions<5,>=3.7.4" ], "requires_python": "<4.0,>=3.7", "version": "0.7"
target or something?
high-yak-8589901/20/2023, 12:22 AM
As has been the case for a while, awesome features from the Pants team continue to make our lives easier!
./pants --changed-since=master --changed-dependees=transitive --filter-tag-regex=<our tag here> list
worried-painter-3138201/20/2023, 7:44 AM
famous-river-9497101/20/2023, 3:07 PM
refined-addition-5364401/20/2023, 3:40 PM
crooked-country-193701/21/2023, 4:39 PM
I was running
./pants test :: Another pants invocation is running. Will wait up to 60.0 seconds for it to finish before giving up. If you don't want to wait for the first run to finish, please press Ctrl-C and run this command with PANTS_CONCURRENT=True in the environment.
in another terminal. Anyways, I was able to get it to run by
./pants repl ::
. Was wondering why it isn’t default? Are there any issues which I should be aware of? Typically, have a repl in another shell is a common strategy
PANTS_CONCURRENT=True ./pants test ::
plain-engine-9121501/22/2023, 1:57 PM
This is actually just a warning but ultimately it leads to an error like:
The target lib/modules/serviceA/controller.py imports `sqlalchemy.text`, but Pants cannot safely infer a dependency because more than one target owns this module, so it is ambiguous which to use: ['services/serviceA:poetry#SQLAlchemy', 'services/serviceB:poetry#SQLAlchemy', 'services/serviceC:poetry#SQLAlchemy'].
I think somehow I need to specify that all tests need to use only the main PyProject.toml file but I'm not sure how I do that. Currently I'm setting my source as:
ModuleNotFoundError: No module named 'flask_sqlalchemy'
Please advise on how I can go about solving this problem. Thanks in advance.
[source] marker_filenames = ["pyproject.toml"]
enough-analyst-5443401/22/2023, 2:35 PM
crooked-country-193701/22/2023, 3:47 PM
. here is a repo with the issue: https://github.com/adityav/pants-python-tryouts
ModuleNotFoundError: No module named 'pandas'
plain-engine-9121501/22/2023, 4:02 PM
high-magician-4618801/22/2023, 4:26 PM
Is there anything I can do to debug it? There is probably a bad constraint that wrack havoc, but I don't know which and there are 370 dependencies in the repo...
> pants generate-lockfiles --resolve=python-default ⠂ 4795.88s Generate lockfile for python-default
ambitious-actor-3678101/22/2023, 9:06 PM
but only ever mentions files external to the repository. Is there a way to include .zip/.whl files in the repository?
broad-processor-9240001/22/2023, 9:34 PM
: there is only one `poetry_requirements`/`python_requirements` target in our whole repo. This does force pants to be using everything the same versions of all dependencies across all projects, though.
plain-night-5132401/23/2023, 6:31 AM
Just so I can provide accurate information on whether we should move forward with pants to use bazel, it seems like there are two versions of pants, and he is possibly referring to pants v1? Also, my understanding is pants v2 is known to be used on repos with thousands of python files but pants v1 was proven to work on monorepos a magnitude larger? And pants v2 is more extensible than bazel's skylark, from my understanding?
Pants had scalability issues, and both pants and buck are not as easily extensible as Bazel with skylark
narrow-activity-1740501/23/2023, 10:15 AM
outside of Pants/Docker and got this (selected the interesting part):
RUN PEX_TOOLS=1 /usr/local/bin/python3.10 /binary.pex venv --scope=deps --compile /bin/app
Any idea what might be wrong? Many thanks in advance!
$ PEX_VERBOSE=9 PEX_TOOLS=1 python dist/src.python.arcor2_calibration.scripts/calibration.pex venv --scope=deps --compile appTest pex: Laying out Spread PEX directory /home/zdenal/arcor2_repos/arcor2/dist/src.python.arcor2_calibration.scripts/calibration.pex: 0.1ms pex: Executing installed PEX for /home/zdenal/arcor2_repos/arcor2/dist/src.python.arcor2_calibration.scripts/calibration.pex at /home/zdenal/.pex/unzipped_pexes/b1de9cb1dc137d74acdc0779598b9da266d9abcc ... pex: Re-writing /home/zdenal/arcor2_repos/arcor2/appTest/bin/ttx pex: Executing: /usr/bin/python3.10 -s -E -m compileall appTest Traceback (most recent call last): File "/home/zdenal/.pex/unzipped_pexes/b1de9cb1dc137d74acdc0779598b9da266d9abcc/.bootstrap/pex/result.py", line 105, in catch return func(*args, **kwargs) File "/home/zdenal/.pex/unzipped_pexes/b1de9cb1dc137d74acdc0779598b9da266d9abcc/.bootstrap/pex/tools/commands/venv.py", line 209, in run pex.interpreter.execute(["-m", "compileall", venv_dir]) File "/home/zdenal/.pex/unzipped_pexes/b1de9cb1dc137d74acdc0779598b9da266d9abcc/.bootstrap/pex/interpreter.py", line 1239, in execute stdout, stderr = Executor.execute(cmd, stdin_payload=stdin_payload, env=env, **kwargs) File "/home/zdenal/.pex/unzipped_pexes/b1de9cb1dc137d74acdc0779598b9da266d9abcc/.bootstrap/pex/executor.py", line 99, in execute raise cls.NonZeroExit(cmd, process.returncode, stdout, stderr) pex.executor.Executor.NonZeroExit: received exit code 1 during execution of `['/usr/bin/python3.10', '-s', '-E', '-m', 'compileall', 'appTest']` while trying to execute `['/usr/bin/python3.10', '-s', '-E', '-m', 'compileall', 'appTest']` received exit code 1 during execution of `['/usr/bin/python3.10', '-s', '-E', '-m', 'compileall', 'appTest']` while trying to execute `['/usr/bin/python3.10', '-s', '-E', '-m', 'compileall', 'appTest']` ...
microscopic-refrigerator-6977401/23/2023, 10:51 AM
exec /bin/main.pex: exec format error
crooked-country-193701/23/2023, 1:58 PM
when running tests. Repo reproducing the issue: https://github.com/adityav/pants-python-tryouts
ModuleNotFoundError: No module named 'pyarrow'
plain-engine-9121501/23/2023, 9:08 PM
def get_module_json(module, file_name):
Helped method to load a file
file_name = "tests/" + module + "/jsons/" + file_name
with open(file_name) as file:
We're using this to load json payloads from various locations but since we're loading them like this pants is unable to detect these files and hence does not include them in the sandbox. So I need to know how I can include all files in my tests folder in pants sandbox (at least all json files). Thanks in advance.
glamorous-accountant-9721701/23/2023, 10:59 PM
, but i had to use
in pants). is there any reason not to support all the built-in ini options in pants? what about supporting just
rhythmic-battery-4519801/23/2023, 11:38 PM
microscopic-refrigerator-6977401/24/2023, 3:12 AM
narrow-activity-1740501/24/2023, 11:28 AM
to a pex file? Some of our code depends on
- when I run
becomes false. But it seems that when I run
remains true. The same result with
🙂 Not sure how this is supposed to work... But I would like to turn on optimizations for production images based on pex files. Thanks for hints.
python -O file.pex
stocky-helmet-2265501/24/2023, 3:56 PM
nice-florist-5595801/24/2023, 5:10 PM
broad-hospital-9663201/24/2023, 7:11 PM
I would appreciate any help or guidance to run pants behind proxies and any recipes for running in offline mode as well.
$ pip install pex[requests] Collecting pex[requests] Downloading pex-2.1.121-py2.py3-none-any.whl (2.9 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.9/2.9 MB 20.2 MB/s eta 0:00:00 WARNING: pex 2.1.121 does not provide the extra 'requests' Installing collected packages: pex Successfully installed pex-2.1.121
polite-garden-5064101/24/2023, 7:34 PM