sparse-lifeguard-95737
01/19/2023, 8:17 PMCPython==3.9.13
partitionsparse-lifeguard-95737
01/19/2023, 8:18 PMhappy-kitchen-89482
01/19/2023, 8:20 PMhigh-magician-46188
01/19/2023, 9:54 PM3rdparty/python
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-89314
01/19/2023, 9:59 PMauthzed
to a project and can’t quite get pants to properly resolve its dependencies:
When doing a ./pants run src/python/my_project/script.py
which imports from authzed
, I get an error with the protobuf module:
from google.protobuf.internal import builder as _builder
ModuleNotFoundError: No module named 'google.protobuf'
Now, I can see in my lockfile that authzed
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:
"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"
This is purely a transitive dependency, do I have to explicitly specify it via a python_requirement
target or something?high-yak-85899
01/20/2023, 12:22 AM./pants --changed-since=master --changed-dependees=transitive --filter-tag-regex=<our tag here> list
As has been the case for a while, awesome features from the Pants team continue to make our lives easier!worried-painter-31382
01/20/2023, 7:44 AMfamous-river-94971
01/20/2023, 3:07 PMrefined-addition-53644
01/20/2023, 3:40 PMcrooked-country-1937
01/21/2023, 4:39 PM./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.
I was running ./pants repl ::
in another terminal.
Anyways, I was able to get it to run by PANTS_CONCURRENT=True ./pants test ::
.
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 strategyplain-engine-91215
01/22/2023, 1:57 PMThe 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'].
This is actually just a warning but ultimately it leads to an error like:
ModuleNotFoundError: No module named 'flask_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:
[source]
marker_filenames = ["pyproject.toml"]
Please advise on how I can go about solving this problem. Thanks in advance.enough-analyst-54434
01/22/2023, 2:35 PMcrooked-country-1937
01/22/2023, 3:47 PM./pants run
gives ModuleNotFoundError: No module named 'pandas'
.
here is a repo with the issue: https://github.com/adityav/pants-python-tryoutsplain-engine-91215
01/22/2023, 4:02 PMhigh-magician-46188
01/22/2023, 4:26 PM> pants generate-lockfiles --resolve=python-default
⠂ 4795.88s Generate lockfile for python-default
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...ambitious-actor-36781
01/22/2023, 9:06 PMpython_requirements
but only ever mentions files external to the repository.
Is there a way to include .zip/.whl files in the repository?broad-processor-92400
01/22/2023, 9:34 PMpyproject.toml
: 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-51324
01/23/2023, 6:31 AMPants had scalability issues, and both pants and buck are not as easily extensible as Bazel with skylark
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?narrow-activity-17405
01/23/2023, 10:15 AMRUN PEX_TOOLS=1 /usr/local/bin/python3.10 /binary.pex venv --scope=deps --compile /bin/app
outside of Pants/Docker and got this (selected the interesting part):
$ 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']`
...
Any idea what might be wrong? Many thanks in advance!microscopic-refrigerator-69774
01/23/2023, 10:51 AMexec /bin/main.pex: exec format error
crooked-country-1937
01/23/2023, 1:58 PMModuleNotFoundError: No module named 'pyarrow'
when running tests.
Repo reproducing the issue: https://github.com/adityav/pants-python-tryoutsplain-engine-91215
01/23/2023, 9:08 PMimport json
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:
return json.load(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-97217
01/23/2023, 10:59 PM-W
, but i had to use -W
via pytest args
in pants). is there any reason not to support all the built-in ini options in pants? what about supporting just filterwarnings
for now?rhythmic-battery-45198
01/23/2023, 11:38 PMtorch
package. 🧵microscopic-refrigerator-69774
01/24/2023, 3:12 AMnarrow-activity-17405
01/24/2023, 11:28 AMPYTHONOPTIMIZE
to a pex file? Some of our code depends on __debug__
- when I run PYTHONOPTIMIZE=1 python
, then __debug__
becomes false. But it seems that when I run PYTHONOPTIMIZE=1 file.pex
, __debug__
remains true. The same result with python -O file.pex
🙂 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.stocky-helmet-22655
01/24/2023, 3:56 PMnice-florist-55958
01/24/2023, 5:10 PMbroad-hospital-96632
01/24/2023, 7:11 PM$ 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
I would appreciate any help or guidance to run pants behind proxies and any recipes for running in offline mode as well.polite-garden-50641
01/24/2023, 7:34 PM~/.cache/pants/setup