high-yak-85899
01/31/2022, 7:01 PMbrash-baker-91190
01/31/2022, 7:09 PM<http://v1.pantsbuild.org/setup/pants>
busy-vase-39202
01/31/2022, 7:57 PMhigh-yak-85899
01/31/2022, 8:39 PMhigh-yak-85899
01/31/2022, 9:01 PM./pants dependencies path/to/my_test.py
). When I do ./pants dependencies path/to/depended_on_thing
, I see the correct dependencies I'd expect there. However, when I do ./pants dependencies --transitive path/to/my_test.py
, I don't see the correct dependency of depended_on_thing
. Apologies for the genericized version of this, but any ideas?high-yak-85899
02/01/2022, 12:43 AMINFO: Elapsed time: 715.011s, Critical Path: 105.07s
INFO: 624 processes: 4 remote cache hit, 670 linux-sandbox.
INFO: Build Event Protocol files produced successfully.
INFO: Build completed, 1 test FAILED, 624 total actions
It's way nicer than seeing the result of every test as pants does it (it seems like --test-ouput
just controls details of each executed test and not limiting the information dump to the terminal).flat-zoo-31952
02/01/2022, 5:14 PM./pants lint ::
with the flake8
and pylint
backends enabled, and it seemed to have run flake8 massively parallel, and pylint in just one job. Is this an intentional decision due to bugs in pylint?brash-baker-91190
02/01/2022, 7:54 PMpytest
configuration declaratively (or even non-declaratively!) for different subsets of tests? Something like having different extra-requirements (https://www.pantsbuild.org/docs/reference-pytest#section-extra-requirements) for unit tests vs. integration tests?busy-vase-39202
02/01/2022, 8:56 PMhigh-yak-85899
02/02/2022, 12:32 AM./pants tailor
doesn't have any changes it would want to apply?gifted-soccer-38559
02/02/2022, 1:14 AM./pants run
seems to be interfering with python signal handling in a way that is causing context managers to not get cleaned up -- wondering if there is a workaround for this.
as an example, if i take the following simple script:
from typing import Iterator
from contextlib import contextmanager
import time
@contextmanager
def test_sync_ctx() -> Iterator[None]:
print("[test_sync_ctx] creating...")
time.sleep(1.2)
try:
yield None
finally:
print("[test_sync_ctx] closing...")
time.sleep(1.2)
print("[test_sync_ctx] closed")
def main() -> None:
with test_sync_ctx():
print("inside sync context. sleeping...")
time.sleep(5)
print("slept.")
if __name__ == "__main__":
main()
Running directly with python, i get the following output:
[test_sync_ctx] creating...
inside sync context. sleeping...
^C[test_sync_ctx] closing...
[test_sync_ctx] closed
Traceback (most recent call last):
File "test_ctx.py", line 26, in <module>
main()
File "test_ctx.py", line 21, in main
time.sleep(5)
KeyboardInterrupt
But using pants, no cleanup is ever run. I get the following output:
[test_sync_ctx] creating...
inside sync context. sleeping...
^CInterrupted by user.
high-yak-85899
02/02/2022, 1:48 AMnarrow-vegetable-37489
02/02/2022, 11:51 AMbrash-baker-91190
02/02/2022, 5:57 PMcookiecutter
(a templating tool - https://cookiecutter.readthedocs.io/en/1.7.2/) project that creates a Pants project, and is itself a Pants project. Everything works great, but I want to have Pants ignore any BUILD
files within the body of the template itself (because those BUILD
files may themselves be templates, and thus not valid files for Pants to process as-is). I can do this with the following stanza in my top-level pants.toml
file:
build_ignore = [
# Don't want the BUILD files in the template to get treated as
# though they applied to this project.
"\\{\\{ cookiecutter.__repo_name \\}\\}"
]
(Yes, that directory name -- {{ cookiecutter.__repo_name }}
-- is a Jinja templating directive; that's just how cookiecutter
works.)
That complicated escaping is the best thing I've been able to come across that is accepted and lets me actually run Pants. However, when I run Pants with this configuration, I get a slew of repeated messages like this:
12:50:50.87 [WARN] <string>:1: DeprecationWarning: invalid escape sequence \{
The pants.toml
is the only place in the project that has this character sequence.
I'm not exactly sure what escape sequence would work here (again, nothing else I've thought of seems to be accepted). The DeprecationWarning
also makes me concerned that the next release of Pants will no longer work with this repository. Anybody else seen anything like this or have any suggestions? Thanks 🙇high-yak-85899
02/02/2022, 7:16 PMtest
to run serially for some specially marked tests? I don't see anything in https://www.pantsbuild.org/docs/reference-test or https://www.pantsbuild.org/docs/reference-pytest for an option on that. We have integration tests that have to run against shared hardware and running in parallel would cause lots of issues.rapid-bird-79300
02/02/2022, 9:41 PM--changed-since
subsystem and the error message is saying the git dir cannot be found. All other pants goals work without using the subsystem so curious why this is occurring.high-yak-85899
02/03/2022, 2:20 AMstocky-yacht-20557
02/03/2022, 3:40 AMPATH
? Or can I manually download the pex release (we use an airgapped secure browser w/ download and virus scan capabilities) and place it in a known location for pants to find?
We also have a docker proxy setup, so I also looked on dockerhub for a container that would hold all the required deps, but the only container there was 6 years old. For users like myself without internet access it'd be great to bundle everything up in an easy to use package.
Thanks!eager-lamp-68986
02/03/2022, 3:19 PMdocker-compose
to create environments for running integration tests. We might want to move to using Kubernetes pods in future. In both cases we are running the tests from a container which should be created by the test framework. This is different from the way pants runs tests - they are executed in the same environment as pants.
Ideally I would like ./pants test ./test/my-integration-test.py
to do the following:
1. Set up a docker-compose test environment. The necessary data for it should be collected from the target.
2. Build the necessary pex files for the test
3. Copy the pex files to a container in the environment
4. Execute the test from the environment and collect the results
5. Tear-down the test envrionment
Do you think that something like this is possible to achieve? I'm open to writing plugins as long as I don't need to rewrite the whole pytest rule to get this thing to work.fresh-cat-90827
02/03/2022, 7:49 PMicy-account-9671
02/03/2022, 8:50 PMflat-zoo-31952
02/03/2022, 10:39 PM./pants
too? Like this:
renice 19 $(cat .pids/**/pid)
nice ./pants ...
Does this make sense or am I thinking about this all wrong?few-arm-93065
02/04/2022, 1:18 AMProcessExecutionFailure: Process 'Building src.[...]/exe.pex with 10 requirements: boto3==1.20.21, cryptography==3.4.8, numpy==1.21.4, overrides==6.1.0, pandas==1.3.5, pyranges==0.0.111, scipy==1.7.3, setuptools==60.7.1, toml==0.10.2, types-toml==0.10.1' failed with exit code 1.
stdout:
stderr:
ERROR: Could not find a version that satisfies the requirement pyranges==0.0.111
ERROR: No matching distribution found for pyranges==0.0.111
ERROR: Could not find a version that satisfies the requirement pyranges==0.0.111
ERROR: No matching distribution found for pyranges==0.0.111
pid 34310 -> /Users/jwarwick/.cache/pants/named_caches/pex_root/venvs/7f518a293766277276f42aa896ce105b056e5634/c31a5b9c4ba316e0b508d32fa17316ce30a6f329/pex --disable-pip-version-check --no-python-version-warning --exists-action a --isolated -q --cache-dir /Users/jwarwick/.cache/pants/named_caches/pex_root --log /private/var/folders/3k/1rb9kxyn35z51bc7ny7z1xgw0000gn/T/process-executionC9Rqy4/.tmp/tmpu542abw0/pip.log download --dest /private/var/folders/3k/1rb9kxyn35z51bc7ny7z1xgw0000gn/T/process-executionC9Rqy4/.tmp/tmph7y1egmo/manylinux2014_aarch64-cp-39-cp39 --platform manylinux2014_aarch64 --implementation cp --python-version 39 --abi cp39 --only-binary :all: boto3==1.20.21 cryptography==3.4.8 numpy==1.21.4 overrides==6.1.0 pandas==1.3.5 pyranges==0.0.111 scipy==1.7.3 setuptools==60.7.1 toml==0.10.2 types-toml==0.10.1 --index-url <https://pypi.org/simple/> --retries 5 --timeout 15 exited with 1 and STDERR:
None
My guess is that this has to do with --only-binary :all:
. When I try to install this package with pip in a fresh virtualenv, there is no error. Can anyone point me in the right direction?full-toothbrush-75676
02/04/2022, 2:35 AMpex
also caches installed_wheels
in ~/.cache/pants/named_caches/pex_root
. Is Pants (through pex
) able to consult that cache when re-resolving dependencies? In other words, does it still re-install packages from indexes even if the exact package / version is in that pex
named cache? We currently save / restore the three Pants cache directories in our build pipelines and bust these caches whenever our 3rdparty lockfile changes. I’m wondering if persisting ~/.cache/pants/named_caches/
even in the case of a 3rdparty lockfile change would allow the build to not have to re-download packages from indexes, therefore saving time. Do these questions / this line of thought make sense? Thanks in advance 🙏prehistoric-crayon-93035
02/04/2022, 12:27 PMprehistoric-crayon-93035
02/04/2022, 12:32 PMshy-advantage-49800
02/04/2022, 12:58 PMpython_tests
?curved-television-6568
02/04/2022, 1:27 PMhigh-yak-85899
02/04/2022, 7:30 PMpb2.py
modules. I think I already know the answer, so this is mostly just 🎣 .limited-insurance-37393
02/04/2022, 8:32 PMtailor
goal, is there some machinery that I can hook into to influence what targets get autogenerated into the BUILD files? For instance "For every directory with a __main__.py
add a `python_distribution`"