happy-kitchen-8948201/02/2023, 6:47 PM
happy-kitchen-8948201/02/2023, 6:48 PM
for a pex_binary target, it will rebuild the pex every time and run it
./pants run path/to:target_name
happy-kitchen-8948201/02/2023, 6:48 PM
it will be much much faster
./pants run path/to/manage.py
happy-kitchen-8948201/02/2023, 6:48 PM
many-engine-679601/02/2023, 7:03 PM
concept, but it seems that I misconfigure something or it’s not that powerful as I thought it is, because it restarts the app on every change in the repo not inputs only. Details in the thread 🧵.
green-match-6633701/02/2023, 11:05 PM
red-pilot-8388601/03/2023, 1:27 AM
abundant-leather-1738601/03/2023, 3:16 PM
curved-manchester-6600601/03/2023, 5:34 PM
directory (I think this is pretty typical!) and there is also a utility file located in the test directory that is a dependence of the tests and not a test itself (this seems debatable as a practice, but I think should work?). I'm seeing different behavior with
when the utility class is in a parent vs-grandparent directory of the tests.
$ tree test/ test/ ├── BUILD ├── __init__.py ├── test_util.py <--- utility class, not actually a test └── unit ├── BUILD ├── __init__.py ├── scripts │ ├── BUILD │ └── test_some_more_stuff.py <-- this target can *not* import test.test_util └── test_some_stuff.py <-- this target can import test.test_util
busy-vase-3920201/03/2023, 6:17 PM
busy-vase-3920201/03/2023, 6:24 PM
witty-byte-1364601/03/2023, 7:15 PM
plain-night-5132401/04/2023, 4:06 AM
in my python repo and got many BUILD files (pants v2.14), but they all contain a single line
./pants tailor ::
with nothing else in it. I am comparing to the official python repo which has slightly more stuff in it. So is that single line all I need in almost all cases? It seems that name field has a default and if I don’t have it specified.
curved-manchester-6600601/04/2023, 4:59 AM
, or python3.10 and resolver
. (Said resolvers already have
)I then have a set of tests I want to parameterize to verify both cases actually work. In other words I want to run with (resolve=foo, interpreter_constraints=python3.7) and (resolve=bar, interpreter_constraints=python3.10) but not (foo && python3.10) or (bar && python3.7). I tired to do something like:
But that generates the full matrix and pants yells with a
__defaults__(all=dict( resolve=parametrize("foo", "bar"), interpreter_constraints=parametrize(py3_7=["CPython>=3.7.1,<3.8"], py3_10=["CPython==3.10.*"])
subsets. Is there a way to pair the parametrize or otherwise generate less than the full set of permutations? I read https://github.com/pantsbuild/pants/issues/14863 and https://pantsbuild.slack.com/archives/C046T6T9U/p1671723858955379 and I'm not sure if I should take the current state of constraints+resolves as "confusing but works" or "can't do what I want yet" (Thank you everyone for answering so many questions!)
happy-kitchen-8948201/04/2023, 7:39 AM
curved-policeman-279601/04/2023, 10:37 AM
format? It looks like
used to do this with
high-magician-4618801/04/2023, 2:11 PM
plain-night-5132401/04/2023, 6:55 PM
how do we improve the workflow? Convert it to poetry? (it doesn’t seem to support monorepo) Do I still need to go through this process? it seems pants does not support a --check option currently for lockfiles so the lockfile and my requirements could go out of date.
famous-river-9497101/04/2023, 8:50 PM
for a monorepo of AWS Cloud Development Kit (CDK), an infrastructure as code tool, projects. I've got a decent prototype set up, and it looks like the
flag is working great. It's identifying "targets" that should be redeployed when they change. I'm struggling to figure out the best way to run a shell command on targets that have changed. For instance, this command is properly identifying code that has changed:
Now I'd like to run a single command in
./pants --changed-since=HEAD --changed-dependees=transitive --filter-tag-regex='^cdk_app$' list aws/projects/project_1:project_1 aws/projects/project_1/app.py aws/projects/project_1/stack.py
), but I'm not sure how to best do this. In this case
cd aws/projects/project_1 && ./my-script.sh
would call out to the CDK binary to do the actual deployment 🧵
chilly-tailor-7506301/04/2023, 9:22 PM
multiple times in a row, it reports that changes were made each time. Why is that?
./pant fmt ::
chilly-tailor-7506301/04/2023, 9:23 PM
immediately after a
./pants lint ::
It reports that black failed, even though it succeeded immediately prior. Why does that happen?
./pants fmt ::
high-yak-8589901/05/2023, 12:05 AM
plain-night-5132401/05/2023, 12:13 AM
to work: Got errors that it can’t find 3rd party libraries like sqlalchemy, google.protobuf, factory (see inside)
./pants test <single-file>
acoustic-fall-9248201/05/2023, 12:19 AM
goal on pants 2.14, arm64, python 3.11. Seems there is an issue building httptools wheel. Any help would be appreciated. Thanks!
average-exabyte-6156801/05/2023, 1:48 PM
[~/pants]$ /bin/bash -c "$(curl -fsSL <https://static.pantsbuild.org/setup/one_step_setup.sh>)" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1176k 100 1176k 0 0 4468k 0 --:--:-- --:--:-- --:--:-- 4632k % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 162 100 162 0 0 465 0 --:--:-- --:--:-- --:--:-- 465 100 19427 100 19427 0 0 46206 0 --:--:-- --:--:-- --:--:-- 46206 Bootstrapping Pants using /Users/xyz/.pyenv/shims/python3.9 Creating the virtualenv PEX. Downloading the Pex PEX. SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.103/pex> verified. Installing pantsbuild.pants==2.14.0 into a virtual environment at /Users/xyz/.cache/pants/setup/bootstrap-Darwin-arm64/2.14.0_py39 Traceback (most recent call last): File "/Users/xyz/.cache/pants/setup/bootstrap-Darwin-arm64/pants.Spxdr9/install/bin/pip", line 5, in <module> from pip._internal.cli.main import main ModuleNotFoundError: No module named 'pip._internal'
glamorous-nail-5954401/05/2023, 3:28 PM
in github actions when the same Test-Build workflow is triggered for both PRs and Push events?
abundant-autumn-6799801/05/2023, 5:20 PM
. Say I have
compatible_tags: ['a', 'b']
and I'm trying to build an sdist. Also assume my current platform can build
tagged wheels. I expect the build to work but it fails. Using the latest pex 2.1.119. However if I move
to the front of the list
, the same command works. This seems like a bug? Or am I missing something about how compatible tags are supposed to work?
compatible_tags: ['b', 'a']
early-jelly-1046801/05/2023, 6:21 PM
Our code is laid out in this manner (omitting the pants files) with each service in its own directory and a separate directory for tests and the application code. If I run a
root ├── service_1 │ ├── app_code_1/ │ │ └── module_123.py │ ├── tests/ │ │ ├── conftest.py │ │ └── test_app_code_1 │ │ └── test_module_123.py │ ├── conftest.py │ └── requirements.txt ├── service_2 │ ├── app_code_1/ │ │ └── module_123.py │ ├── tests/ │ │ ├── conftest.py │ │ └── test_app_code_1 │ │ └── test_module_123.py │ ├── conftest.py │ └── requirements.txt └── n...
it successfully picks up all the tests from each service, but they all fail due to missing 3rd party imports. I ran
./pants test ::
and it looks like it is finding all the imports from the requirements.txt
./pants --filter-target-type=python_requirement list ::
Makes me think something about how our code is organized is preventing the tests from running using the requirements file. I was also expecting that I would be able to do something like
projects/service_1:reqs#pytest projects/service_1:reqs#etc n...
but that does not pickup the test directory contained inside the service, further making me think the organization is messing it up. Any guidance or direction would be helpful, I've been poking around the settings/configurations for about a day and haven't made any headway 🙂. Thanks for anyone's time
./pants test /service_1/:
famous-river-9497101/05/2023, 7:36 PM
were identified as changed:
But if I try to
./pants --changed-since=HEAD --changed-dependees=transitive --filter-tag-regex='^cdk$' list aws/projects/project_1:cdk aws/projects/project_2:cdk
them, I get an error:
I can hack something with
./pants --changed-since=HEAD --changed-dependees=transitive --filter-tag-regex='^cdk$' run 12:32:43.46 [ERROR] 1 Exception encountered: TooManyTargetsException: The `run` goal only works with one valid target, but was given multiple valid targets: * aws/projects/project_1:cdk * aws/projects/project_2:cdk Please select one of these targets to run.
but I was wondering if there's a "better"/more
export PANTS_CONCURRENT=True && ./pants --changed-since=HEAD --changed-dependees=transitive --filter-tag-regex='^cdk$' list | xargs -L1 -P 2 ./pants run
-y way to do this?
plain-night-5132401/05/2023, 8:49 PM
? I have a directory full of json, i had to specify each one using
and then python tests I use all of these files, so I had a
. tried wildcard in dependencies and got UnsupportedWildcardError