fresh-cat-9082705/15/2022, 2:02 PM
doesn’t support saving the output error messages into a file (in the same way you can do
). If I’d be calling
on its own, I could just
, but since it happens in the
call, I can’t do that. Have I overlooked anything in the options and it’s actually possible to produce a file report? Is it something we could extend in Pants itself to produce such a report?
breezy-cat-5271805/15/2022, 8:05 PM
doesn't wait until the previous docker container stops. I'll provide an example: src/docker/BUILD
docker_image( name="app", dependencies=["src/python/app:bin"], restartable=True )
python_sources() pex_binary( name="bin", entry_point="main.py" )
Then running as:
FROM python:3.9-slim COPY <http://src.python.app/bin.pex|src.python.app/bin.pex> /app/bin ENTRYPOINT [ "/app/bin" ]
Runs fine, but fails when any file is modified:
./pants run --docker-run-args="-p 8000:8000" src/docker:app
docker: Error response from daemon: driver failed programming external connectivity on endpoint cool_gould (5a6265badca64afa4e304e6475119f912621ee8cddf8e195d36a6d0d55b7854f): Bind for 0.0.0.0:8000 failed: port is already allocated.
Also runs fine, but fails when any file is modified:
./pants run --docker-run-args="-p 8000:8000 --name=app" src/docker:app
docker: Error response from daemon: Conflict. The container name "/app" is already in use by container "e003d8f7b8c1e963e1f540ab49a06b67a21530938ac1f9092862e858e800dcfe". You have to remove (or rename) that container to be able to reuse that name.passing --rm to the --docker-run-args gives the same result
rhythmic-morning-8731305/16/2022, 7:41 AM
bulky-alarm-9402705/16/2022, 9:47 AM
hundreds-father-40405/16/2022, 1:55 PM
field less confusing & target addresses simpler..would you be willing to run this script and report back on what it says? (warning it may take ~3-15 minutes probably, and you can't run other Pants commands while doing it)
witty-family-1333705/16/2022, 2:05 PM
, etc), to have dependencies on
targets as well as in
? The case that I’m thinking of is one in which I would like to launch a subprocess (generated at an earlier stage) at the start of a test suite. Being a runnable file, I can not run it from inside a JAR so I can’t use a dependency on a `resource`…
thousands-ability-2412605/16/2022, 4:14 PM
has some built-in tools for that. Thanks!
rough-electrician-2187105/16/2022, 4:58 PM
? In conventional CI tool I'd just
stuff and run my
bitter-ability-3219005/16/2022, 5:48 PM
./pants --dependencies --transitive some/other:tgt
full-student-9182505/16/2022, 7:40 PM
./pants fmt ::
for multiple Python versions? Something equivalent to Nox sessions.
brainy-solstice-2704205/16/2022, 8:13 PM
ambitious-actor-3678105/16/2022, 9:28 PM
in my BUILD files have tags. but only the
files have them when doing a
./pants --tags=-integration_tests ::
and subsequently all the tests within.
rapid-exabyte-7668505/17/2022, 6:22 AM
is still only giving me the stdout from the test that fails… is there something that I could be doing wrong here? Also is it true that both
do the same thing?
rapid-exabyte-7668505/17/2022, 6:27 AM
files - and my tests fail depending on the order in which Pants decides to run the files, so making it a bit time-consuming to force a run that triggers the race condition
rhythmic-morning-8731305/17/2022, 8:50 AM
cold-soccer-6322805/17/2022, 3:12 PM
, what is the difference between
? The docstring description and example for https://github.com/pantsbuild/pants/blob/c73b9f68b7e05ac455057142ae50c75f2560d06b/src/python/pants/engine/target.py#L2529-L2559 seem to contradict each other
kind-hydrogen-97505/17/2022, 5:06 PM
locally, it works. inside circleCI, same exact command fails on creds.. The credentials for AWS are working in CircleCI because other non-pants apps are using them. Any hint anyone? I'm assuming the test runs in sort of a "chrooted" environment, but why does it work locally but not in circleCI? thanks 🙂
./pants test <some_app_that_puts_files_to_s3>
hundreds-father-40405/17/2022, 10:49 PM
? 2. Where do we write the result?
thousands-ability-2412605/17/2022, 11:36 PM
errors print the original source path in a Python stacktrace, instead of the
happy-kitchen-8948205/18/2022, 4:39 AM
on python code with [mypy].interpreter_constraints is set, we don't actually use those constraints on targets that have their own ICs
cold-soccer-6322805/18/2022, 2:37 PM
files are siblings in the directories by subclassing
I'm interested in making it so that Python sources that invoke
resources( name="graphql_schema", sources=[ "*.graphql", ], )
have dependencies on all GraphQL resources in my codebase, e.g. the targets specified in each
file. (This is necessary because the
function opens GraphQL file paths.) I think the
file I want to generate should look something like the following:
I see that infer_python_dependencies_via_source is a rule that already exists in the Python backend. I was wondering if I could leverage this. To solve my problem, would it be valid to create an additional rule, e.g.
python_sources( dependencies=[ "path/to/service_a/graphql:graphql_schema", "path/to/service_b/graphql:graphql_schema", "path/to/service_c/graphql:graphql_schema", ... ] )
, and then looks through the dependencies, and adds dependencies on all
targets whenever an
dependency is found? So far, I have the following (not working) code that I'm trying to play with.
The issue with this code are errors that look like the following:
class InferPythonGraphQLResourceDependenciesRequest(InferDependenciesRequest): infer_from = PythonSourceField @rule(desc="Inferring Python GraphQL dependencies by analyzing source") async def infer_python_graphql_dependencies( request: InferPythonGraphQLResourceDependenciesRequest, python_infer_subsystem: PythonInferSubsystem, python_setup: PythonSetup, ) -> InferredDependencies: if not python_infer_subsystem.imports and not python_infer_subsystem.assets: return InferredDependencies() _wrapped_tgt = await Get(WrappedTarget, Address, request.sources_field.address) tgt = _wrapped_tgt.target return await Get(InferredDependencies, DependenciesRequest(tgt[Dependencies])) def rules() -> Iterable[Rule]: return [ infer_python_graphql_dependencies, UnionRule(InferDependenciesRequest, InferPythonGraphQLResourceDependenciesRequest), ]
Do I perhaps I need to re-register rules the
No installed rules return the type InferConftestDependencies No installed rules return the type InferInitDependencies No installed rules return the type InferPythonGraphQLResourceDependenciesRequest
function defined in my dependency inference declarations?
limited-insurance-3739305/18/2022, 3:19 PM
⇉ ./pants tailor 11:16:35.25 [INFO] Initializing scheduler... 11:16:35.36 [INFO] Scheduler initialized. 11:16:35.42 [ERROR] 1 Exception encountered: Exception: Failed to read link "/home/tmacey/code/mit/data/ol-data-platform/.venv/bin/python": Absolute symlink: "/home/tmacey/.pyenv/versions/3.9.9/bin/python"
happy-kitchen-8948205/18/2022, 3:32 PM
to help it along), but fails slowly under Pants (partly because those
# type: ignore
# type: ignore
bitter-ability-3219005/18/2022, 6:41 PM
which in it I put type hints (because I'm used to it). Specifically I used
. Myself and all my devs use py 3.8. I can see
foo: str | None = None
being used in the Pants bootstrap env. I use the macro in a few places. ...and yet nothing errors (It should, the union syntax for the types wasn't added until 3.10). Until now. Someone just got the error. What's happening? I'm bewildered.
cold-soccer-6322805/18/2022, 7:24 PM
Is there any way I can use this? I want to write some tests for my plugins. I'm getting the following error.
from pants.testutil.rule_runner import RuleRunner
Import "pants.testutil.rule_runner" could not be resolved
rapid-bird-7930005/18/2022, 9:15 PM
. I recently upgraded my go version
and when running Pants I'm seeing this error:
When inspecting the go version it seems to be correct
BinaryNotFoundError: Cannot find a `go` binary with the expected version of 1.18 (set by `[golang].expected_version`). Found these `go` binaries, but they had different versions: * /usr/local/bin/go: 1.17 To fix, please install the expected version (<https://golang.org/doc/install>) and ensure that it is discoverable via the option `[golang].go_search_paths`, or change `[golang].expected_version`.
Not sure if it's pants related at all but any help is appreciated
$/usr/local/bin/go version go version go1.18.2 darwin/amd64
high-yak-8589905/18/2022, 10:10 PM
shouldn't be the default. Any tips for what I might have changed or done to make it think this?
hundreds-father-40405/19/2022, 12:33 AM
*Edit: this is not about the
./pants test 'project/*.py' '!project/ignore.py'
field in BUILD files. Only CLI arguments 👎 I had no idea ➖ yes, but I've never used 👍 yes, and I've used at least once