cold-soccer-63228
07/27/2022, 8:14 PMpath/to/file.py:target_name
.
What Iβm looking for is a way to filter out all of the targets returned such that I only get things like path/to/file.py
.high-energy-55500
07/27/2022, 8:19 PMhappy-kitchen-89482
07/27/2022, 9:06 PMpath/to/file.py:target_name
is the "proper name" of a file-level target (generated by path/to:target_name
)happy-kitchen-89482
07/27/2022, 9:06 PMcold-soccer-63228
07/27/2022, 9:17 PMrefined-addition-53644
07/27/2022, 9:23 PMhappy-kitchen-89482
07/27/2022, 10:50 PM./pants --filter-target-type=python_test peek ::
and pluck out the sources with jq
or some json-parsing scripthappy-kitchen-89482
07/27/2022, 10:50 PM--filter
arguments to any goalhappy-kitchen-89482
07/27/2022, 10:50 PMpeek
in this casehappy-kitchen-89482
07/27/2022, 10:51 PM./pants filter
to ./pants peek
happy-kitchen-89482
07/27/2022, 10:51 PMhappy-kitchen-89482
07/27/2022, 10:51 PMblue-queen-76603
07/28/2022, 12:24 AM[docker].env_vars / tools
, and a docker context which uses a docker host via ssh.
I'm able to see that the local process is spawned for docker, and PATH is set to a private .shims/bin.
ssh
is defined within [docker].tools
, but I am getting docker: error during connect: Post "<http://docker.example.com/v1.24/containers/create>": exec: "ssh": executable file not found in $PATH.
The basic test (symlinking, and env -i
) works trivially.cold-soccer-63228
07/28/2022, 12:58 AMIs Pantsβs build-in test parallelization not sufficient for your case?Itβs not, at the moment. I initially was looking to try to implement https://github.com/pantsbuild/pants/issues/15026, but encountered some issues with pytest-xdist, and wanted to try implementing a workaround in case it ended up being difficult to implement the pytest-xdist feature into Pants. (Issue I ran into is described in the thread on https://pantsbuild.slack.com/archives/C046T6T9U/p1658777475033269.)
cold-soccer-63228
07/28/2022, 1:06 AM--filter-target-type=python_test
.
First, I tried running the following.
./pants --changed-since=origin/master dependees --transitive --closed
This output a huge list of changed targets and corresponding dependees (with many test and non-test targets).
Then, I ran the following.
./pants --changed-since=origin/master dependees --transitive --closed --filter-target-type=python_test
This output a pruned list of the above, but seems to have overpruned. There existed tests in the first list, that did not exist in the second list.
Do you know what might be happening?hallowed-plastic-91664
07/28/2022, 3:52 AMhappy-kitchen-89482
07/28/2022, 4:54 AMhappy-kitchen-89482
07/28/2022, 5:16 AMwhite-jordan-40851
07/28/2022, 6:18 AMdocker_image
definition, I'm adding the python_distribution src/python/dep1:dist
to the dependencies
. But in my Dockerfile:
COPY src.python.dep1/dist.whl /wheels/dep1.whl
returns a COPY failed: file not found in build context or excluded by .dockerignore: stat src.python.dep1/dist.whl: file does not exist
Not clear in here how the syntax should be, is .ext
supposed to be .whl
in this context ?rough-electrician-21871
07/28/2022, 8:32 AMdocker-compose
file, where required, and run docker-compose up
prior to executing pytest
, for example. So the layout of monorepo looks roughly like this:
βββ services
βββ go-service-1
β βββ <CODEBASE>
β βββ docker-compose.yaml
βββ py-service-1
β βββ <CODEBASE>
β βββ docker-compose.yaml
βββ py-service-2
β βββ <CODEBASE>
βββ docker-compose.yaml
But I donβt see a clear way for pants
to understand that it need to execute docker-compose up
in a directory path/to/service/foo
upon a code-change of that service foo
And the use-case is quite common, so perhaps itβs solved somehow differently? Maybe I need to employ experimental_shell_command
to spin up DBs and set some envs for unit tests to consume?
Basically, thatβs the only stopping factor of us starting to adopt pants
β i simply donβt understand how to solve my issue at hand..best-motherboard-49373
07/28/2022, 1:13 PM./pants generate-lockfiles ...
However when I try to use a tool that relies on a default lockfile, I get this error:
(in this particular case I was running ./pants package
against a python_distribution
target)
13:07:24.22 [ERROR] 1 Exception encountered:
ProcessExecutionFailure: Process 'Building build_backend.pex from setuptools_default.lock' failed with exit code 1.
stdout:
...
pex.result.ResultError: There were 2 errors downloading required artifacts:
1. setuptools 57.5 from <https://files.pythonhosted.org/packages/4b/b9/71687c5d2034c863db1db2e0704f5e27581ff3cb44d7f293968c5e08ceb3/setuptools-57.5.0-py3-none-any>.
whl
<urlopen error [Errno 101] Network is unreachable>
2. wheel 0.37.1 from <https://files.pythonhosted.org/packages/27/d6/003e593296a85fd6ed616ed962795b2f87709c3eee2bca4f6d0fe55c6d00/wheel-0.37.1-py2.py3-none-any.whl>
<urlopen error [Errno 101] Network is unreachable>
As it tries to download from https://files.pythonhosted.org it's clear that the resolve doesn't honor the internal package index.
I've tried adding the following to my pants.toml
config with no luck:
[python-repos]
indexes = [
"<http://devpi.company.internal/root/+simple/>",
]
[subprocess-environment]
env_vars.add = [
"PIP_INDEX_URL=devpi.company.internal/root/+simple/,
"PIP_TRUSTED_HOST=devpi.company.internal",
]
Could you maybe point me in some direction where the problem may happen? Thanks very much in advance!hallowed-plastic-91664
07/28/2022, 2:23 PMproud-dentist-22844
07/28/2022, 2:23 PMhallowed-plastic-91664
07/28/2022, 2:25 PMhallowed-plastic-91664
07/28/2022, 2:25 PMproud-dentist-22844
07/28/2022, 2:26 PMproud-dentist-22844
07/28/2022, 2:26 PMhallowed-plastic-91664
07/28/2022, 2:27 PMproud-dentist-22844
07/28/2022, 2:27 PMworried-painter-31382
07/28/2022, 2:55 PMcdk.out
, which apparently means symlink shenanigans:
14:47:31.25 [INFO] Initializing scheduler...
14:47:31.43 [INFO] Scheduler initialized.
14:47:31.97 [ERROR] 1 Exception encountered:
Exception: Failed to read link "/codebuild/output/src157654992/src/cdk.out": Absolute symlink: "/codebuild/local-cache/custom/34f023ad3ffa4b6cff760e0246a80119a65a53c5011ff63d5e880846cbd15928/cdk.out"