bland-megabyte-12121
04/19/2024, 1:26 AMdamp-stone-65756
04/19/2024, 1:45 AMdamp-stone-65756
04/19/2024, 1:48 AMbland-megabyte-12121
04/19/2024, 4:01 AMbland-megabyte-12121
04/19/2024, 4:05 AMgentle-flower-25372
04/19/2024, 12:38 PM$ pants publish ci/pants-test:docker
Bootstrapping Pants 2.21.0.dev4
Installing pantsbuild.pants==2.21.0.dev4 into a virtual environment at /nvme/home/agent-2/.cache/nce/60b513559c7b53eb2acecbd7b8aaaeb942686f3997d07fa77377b51324f58fda/bindings/venvs/2.21.0.dev4
Failed to create Pants virtual environment.
Error: Command '['/nvme/home/agent-2/.cache/nce/60b513559c7b53eb2acecbd7b8aaaeb942686f3997d07fa77377b51324f58fda/bindings/pex_root/venvs/5914543a6b7dd2ca81816f310ee1a60ef388f6b7/8821ef26a0029f66e0d477397bfa4d7b49254cbe/bin/python', '/nvme/tmp/agent-2/tmp4_ljhung.pex', 'venv', '--prompt', 'Pants 2.21.0.dev4', '--compile', '--pip', '--collisions-ok', '--no-emit-warnings', '--disable-cache', '/nvme/home/agent-2/.cache/nce/60b513559c7b53eb2acecbd7b8aaaeb942686f3997d07fa77377b51324f58fda/bindings/venvs/2.21.0.dev4']' returned non-zero exit status 1., output:
-----
b"[Errno 17] File exists: '__main__.py' -> '/nvme/home/agent-2/.cache/nce/60b513559c7b53eb2acecbd7b8aaaeb942686f3997d07fa77377b51324f58fda/bindings/venvs/2.21.0.dev4/pex'\n"
-----
Error: Failed to establish atomic directory /nvme/home/agent-2/.cache/nce/60b513559c7b53eb2acecbd7b8aaaeb942686f3997d07fa77377b51324f58fda/locks/install-a052fb005b23b988dfa6132b8aafb42f3420a14b954467537c3535faf0e70ccb. Population of work directory failed: Boot binding command failed: exit status: 1
Isolates your Pants from the elements.
Please select from the following boot commands:
<default> (when SCIE_BOOT is not set in the environment) Detects the current Pants installation and launches it.
bootstrap-tools Introspection tools for the Pants bootstrap process.
update Update scie-pants.
You can select a boot command by setting the SCIE_BOOT environment variable.
powerful-city-61287
04/19/2024, 7:49 PMBuilding 34 requirements for requirements.pex from the 3rdparty/python/default.lock resolve: ..
takes much longer than it should in CI. I'm trying to figure out if there is a dependency that is compiling from scratch, and need more verbose output. I tried PEX_VERBOSE=100 pants --level=debug --no-pantsd ...
but that didn't quite do it. How can I get more info about what is happening during that build stage?gentle-flower-25372
04/19/2024, 10:07 PMgorgeous-jelly-46868
04/20/2024, 9:50 AMpnpm
third-party binary (graphql-codegen), but when installing the node_modules
I’m getting this error:
UNABLE_TO_GET_ISSUER_CERT_LOCALLY request to <https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.4.tgz> failed, reason: unable to get local issuer certificate
How do I configure pants to allow pnpm
to install third parties ?bright-church-87196
04/20/2024, 9:54 AMpants fix ::
, it sorts my imports like this:
import aioboto3
import uvicorn
from botocore.config import Config
from fastapi import FastAPI
from fastapi.middleware import Middleware
from fastapi.middleware.cors import CORSMiddleware
from backend.config import get_settings
from backend.routers import router
But when I either run my pre-commit, or directly run pants fix src/python/backend/main.py
, it resorts my imports to:
import aioboto3
import uvicorn
from backend.config import get_settings
from backend.routers import router
from botocore.config import Config
from fastapi import FastAPI
from fastapi.middleware import Middleware
from fastapi.middleware.cors import CORSMiddleware
So I keep getting constant reformats and my CI fails because it expects the first sorting, but pre commit overrides it to the second.
(I know I could skip the pre commit, but I wanted to fix this wrong sorting that it is doing)
Any ideas ?wide-midnight-78598
04/21/2024, 4:29 AMagreeable-carpet-43488
04/21/2024, 2:50 PMwide-midnight-78598
04/21/2024, 7:35 PMdazzling-elephant-33766
04/22/2024, 11:52 AMruff
integration. I’m seeing differences between running when running ruff inside an exported virutalenv vs via pants
I’m using a pinned version of ruff 0.3.0
[ruff]
install_from_resolve = "python-default"
pants export --resolve=python-default
When I run the local venv version:
dist/export/python/virtualenvs/python-default/3.11.8/bin/ruff check <file>
No changes ...
VS when I run via pants
pants lint <file>
12:46:51.29 [ERROR] Completed: Lint with `ruff check` - environment:macos - ruff check failed (exit code 1).
<file>:1:1: I001 [*] Import block is un-sorted or un-formatted
Found 1 error.
[*] 1 fixable with the `--fix` option.
Unsure what’s going on here. It’s obviously discovering the config correctly because the rule in question I001
is configured in my pyproject.toml
Is there a way to confirm pants is running the correct version here?powerful-city-61287
04/22/2024, 2:06 PMhelloworld/greet:greet
or the abbreviated form helloworld/greet
.
Is the implication that any abc/t:t
can be abbreviated to abc/t
? If so, then I'm running into an issue where that doesn't seem to be working the way I would expect:
> pants run experiments/e2024_04_19
TooManyTargetsException: The `run` goal only works with one valid target, but was given multiple valid targets:
* experiments/e2024_04_19/questions.py:sources
* experiments/e2024_04_19/schemas.py:sources
* experiments/e2024_04_19:e2024_04_19
I would have expected the final target to run. What am I missing?powerful-scooter-95162
04/22/2024, 6:18 PM[ERROR] Address `//` from `--changed-since` has no name part, but it's necessary because the path is the build root.
I'm getting this from my pre-commits presumably because I changed either pants.toml or the root BUILD filecold-jackal-89755
04/22/2024, 6:25 PMrefined-cat-61929
04/23/2024, 12:58 AMcareful-pizza-45959
04/23/2024, 5:00 PMrepo_stats.py --generate-stats
to collect repository metrics by git command and save them to a file metrics.json
in next steps, package the metrics.json
in the docker image. So far there is docker_image
target repostats-service
defined in build->docker->BUILD
and python_source
repo_stats
exists in src/repo-stats->BUILD
I tried two methods
1. run pants run src/repo-stats:repo_stats --export
to generate the json file and save to /dist
, which generates the correct json content, then run pants package build/docker:repostats-service
to include the json, whoever not able to address the correct json path during repostats-service
build time by modifying context_root
.
2. Create an adhoc_tool
target in src/repo-stats->BUILD
to generate the json and the docker_image
depends on it, then run pant package
do all the work. However, the adhoc_tool
target not able to generate correct metrics because it runs within the sandbox, repository files not visiable to it.
Any suggestion to either methods to make it works? thank you!!flaky-match-48400
04/23/2024, 5:25 PMpants generate-lockfiles
that prevents us from moving to versions higher than 2.18 (currently deprecated). as far as I can tell, because of this requirement specification in the jupyter-cadquery
package, pants generate-lockfiles
fails with this message:
~/S/pants-219-lockfile-issue (main *) pants generate-lockfiles
Bootstrapping Pants 2.20.0
Installing pantsbuild.pants==2.20.0 into a virtual environment at /home/blue/.cache/nce/3d6643e46b53e4cc0b2a0d5c768866226ddce3de1f57f80c4a02d8d39800fa8e/bindings/venvs/2.20.0
Found existing installation: setuptools 58.1.0
Uninstalling setuptools-58.1.0:
Successfully uninstalled setuptools-58.1.0
New virtual environment successfully created at /home/blue/.cache/nce/3d6643e46b53e4cc0b2a0d5c768866226ddce3de1f57f80c4a02d8d39800fa8e/bindings/venvs/2.20.0.
11:18:29.00 [INFO] Initializing scheduler...
11:18:32.08 [INFO] Scheduler initialized.
11:19:12.01 [INFO] Completed: Generate lockfile for python-default
11:19:12.01 [ERROR] 1 Exception encountered:
Engine traceback:
in `generate-lockfiles` goal
ProcessExecutionFailure: Process 'Generate lockfile for python-default' failed with exit code 1.
stdout:
stderr:
Expected matching RIGHT_PARENTHESIS for LEFT_PARENTHESIS, after version specifier
cadquery (==master) ; extra == 'prod'
~^
You can find a standalone reproducer here: https://github.com/eguiraud-pf/pants-219-lockfile-issue-repro .
can anyone here suggest a solution or workaround (or generally tell what the underlying problem is)?silly-queen-7197
04/24/2024, 12:13 AMpants dependencies --output-file=dependencies.json --transitive ::
suppose to work with --format=json
? Including --format=json
just prints to stdout. Not a big deal because I can pipe the results to a file.many-vase-25409
04/24/2024, 8:15 AM<none> inherits @experimental and therefore may only be used in an experimental scope.
This started happening without any changes to the Scala or pants version, and the project definitely doesn't use any experimental features (the same code compiles fine using gradle). With pants, if I run the build a second time after the error, it works. Doing a fresh build (on the CI), it fails consistently. This is with Scala 3.4.0/1, pants 2.19/20.little-afternoon-68046
04/24/2024, 10:06 AMlibrary
tests
test_features
test_feature_a.py
BUILD
resources
BUILD
input_data.json
What would be the best way for creating a path inside test_feature_a.py
To read tests/test_features/resources/input_data.json
I was thinking of using abs path
# test_feature_a.py
from pathlib import Path
script_dir = Path(__file__).parent
json_path = script_dir/ 'resources' / 'input_data.json'
with open(json_path, 'r') as f:
pass
This works ok, however I'm not sure if thats the safest solution, I couldn't find any good practice domumented for something like thatancient-france-42909
04/24/2024, 8:25 PMsquare-psychiatrist-19087
04/24/2024, 8:51 PMnamespace
is always set for helm_deployment
target. Thanks!happy-kitchen-89482
04/24/2024, 9:28 PMpowerful-scooter-95162
04/24/2024, 9:39 PMbrash-glass-61350
04/25/2024, 11:21 AMcreating '/tmp/pants-sandbox-f1coPK/.tmp/tmp3slzt946/build/pyspark-3.5.0.dist-info'
Could not gather lock metadata for 1 project with source artifacts:
1. /tmp/pants-sandbox-f1coPK/.tmp/tmpizqd38ib/usr.bin.python3.10/kenlm-0.2.0.tar.gz: Failed to install extra requirement in venv at /home/telmo/.cache/pants/named_caches/pex_root/venvs/7b553b51d30285d7667c7e705da470155a7acc96/5985ed09b49a653d6596b0e14d134c5456cf1a9f: wheel
STDERR:
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/telmo/.cache/pants/named_caches/pex_root/venvs/7b553b51d30285d7667c7e705da470155a7acc96/5985ed09b49a653d6596b0e14d134c5456cf1a9f/lib/python3.10/site-packages/pip/__main__.py", line 22, in <module>
from pip._internal.cli.main import main as _main
ModuleNotFoundError: No module named 'pip._internal'
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
Any clue about what this means and/or how I can debug it?rhythmic-morning-87313
04/25/2024, 12:59 PMbrash-glass-61350
04/25/2024, 1:19 PMsyntax = "proto3";
package package_a;
message MessageA {
int32 value = 1;
}
syntax = "proto3";
package package_b;
import "folder1/folder2/protos/someproto.proto";
message MessageB {
package_a.MessageA value = 1;
}
This does not work. It complains that folder1/folder2/protos/someproto.proto
, although it does. This was working fine before resolves. Any clues?