gentle-sugar-52379
10/29/2022, 3:10 PM./pants test ::
on pants itself after i cloned it from github main?
atm some tests fail.calm-intern-1609
10/29/2022, 5:57 PMexperimental_shell_command
to execute maven to build a jar, works perfectly. then, that jar needs to go inside of a pex_binary
(because I then need my python code to upload it somewhere on demand). pants says I should use a resource
for that. But the resource
target only accepts source files. Is there any way I can make the outputs of a previous target into the inputs of the resources
?cool-yacht-37128
10/29/2022, 11:28 PMfilesystem_resources
option on the pyoxidizer_binary
target but I can't get it to store a first-party module on the file system. How should I be referencing it?boundless-zebra-79556
10/31/2022, 1:45 PMpip install dgllife@ <https://github.com/awslabs/dgl-lifesci/archive/54649fb.zip#subdirectory=python>
But if I put dgllife@ <https://github.com/awslabs/dgl-lifesci/archive/54649fb.zip#subdirectory=python>
in requirements.txt, pants doesn't seem to recognize options after #
. Is there a way to make it work?brash-baker-91190
10/31/2022, 2:40 PM[pytest].extra_requirements
list, and another is for a type that is included in [mypy].extra_type_stubs
, whose import is gated behind an if TYPE_CHECKING
guard in the test file. This worked without issue in 2.13; is this a bug, or a legitimate new change in behavior? If the latter, what would be the recommended way to fix this? Thanks.bright-pilot-85305
10/31/2022, 6:27 PMcurved-television-6568
10/31/2022, 7:19 PMproud-dentist-22844
10/31/2022, 7:42 PM[python-infer].unowned_dependency_behavior
default from ignore to warn).
But, in at least some of the cases, the indicated lines already have # pylint: disable=import-error
, so how should I add # pants: no-infer-dep
when there is already a disable comment for other tools?proud-dentist-22844
10/31/2022, 9:27 PM.api_models
import (I'm getting "Pants cannot infer owner" warning):
https://github.com/st2sandbox/st2/blob/pants/pylint_plugins/api_models_test.py#L25
Here /pylint_plugins
is a source root, and /pylint_plugins/api_models_test.py
is using a relative import for /pylint_plugins/api_models.py
:
from . import api_models
Does the dep inference not like relative imports?gorgeous-winter-99296
10/31/2022, 9:40 PMpex_binary
from a dep+name of entrypoint in the dep, but it doesn't seem like I can run a go_third_party_package
. Context: Want to https://github.com/kubernetes-sigs/controller-tools to generate code.plain-summer-72727
10/31/2022, 11:29 PMraise InvalidFieldException(
pants.engine.target.InvalidFieldException: Unrecognized field `environment=local_docker` in target src/database:funstuff. Valid fields for the target type `pex_binary`: ['complete_platforms', 'dependencies', 'description', 'emit_warnings', 'entry_point', 'execution_mode', 'ignore_errors', 'include_requirements', 'include_sources', 'include_tools', 'inherit_path', 'interpreter_constraints', 'layout', 'output_path', 'platforms', 'resolve', 'resolve_local_platforms', 'restartable', 'script', 'shebang', 'strip_pex_env', 'tags', 'venv_site_packages_copies'].
I just want to confirm that I have 2.15.0a0 set up properly, since it looks like my pex_binary target isn't accepting environment
as a field:
• I set pants_version
to 2.15.0a0
• In pants.toml, I set [environments-preview.names]
to local_docker="//:local_docker"
• In my topmost BUILD file I added:
docker_environment(
name="local_docker",
platform="linux_x86_64",
image="python:3.9-bullseye",
)
• Lastly, in src/database/BUILD I added:
pex_binary(
name="funstuff",
entry_point="funstuff.py",
environment="local_docker",
)
docker_image(
name="docker_image",
instructions=[
"FROM python:3.9-bullseye",
'ENTRYPOINT ["/main"]',
"COPY examples/main.pex /main",
],
)
(funstuff.py is just a hello-world Python script).
Definitely understand that this is an alpha build but I figured this is likely a basic error w/ something I'm msising. Help would be appreciated - thank you!refined-addition-53644
11/01/2022, 7:49 AM./pants run <path_to_main.py>
I get this error
ERROR: Error loading ASGI app. Could not import module "main".
My main.py
looks like
app = FastAPI(title=PROJECT_NAME, debug=DEBUG, version="0.1.0")
app.include_router(v1_router, prefix="/v1")
if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=9000, reload=True)
This is because fastapi looks for app in the current directory as mentioned here. Even after providing the complete path from pants, it still complains.
The only thing which works is when I modify “main:app” to just app
and remove the reload option completely. It won’t allow just using app
with reload=True
app = FastAPI(title=PROJECT_NAME, debug=DEBUG, version="0.1.0")
app.include_router(v1_router, prefix="/v1")
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=9000, reload=True)
busy-vase-39202
11/01/2022, 8:38 AMfreezing-lamp-12123
11/01/2022, 1:54 PMExternalTool
download details? .. i’ve looked at the documentation and according to my own local tools i have entered the proper values for checksum + size, but … pants does not really like me:
all i get is (with debug logging as well):
14:51:39.58 [DEBUG] (workunit_store) Completed: Downloading: <https://github.com/google/go-jsonnet/releases/download/v0.19.1/go-jsonnet_0.19.1_Darwin_arm64.tar.gz> (2.87 MB)
14:51:39.58 [ERROR] (pants.bin.local_pants_runner) 1 Exception encountered:
Exception: Error hashing/capturing URL fetch response: Downloaded file was larger than expected digest
output from running checks on my local system:
❯ shasum -a 256 ~/Downloads/go-jsonnet_0.19.1_Darwin_arm64.tar.gz
c7a98187b4b167e9e885dba52138ed802d4db4635b47b95af6a82448ff9d7ba1 /Users/dreuss/Downloads/go-jsonnet_0.19.1_Darwin_arm64.tar.gz
❯ wc -c /Users/dreuss/Downloads/go-jsonnet_0.19.1_Darwin_arm64.tar.gz
3004958 /Users/dreuss/Downloads/go-jsonnet_0.19.1_Darwin_arm64.tar.gz
external tool known versions config:
default_known_versions = [
"v0.19.1|macos_arm64|c7a98187b4b167e9e885dba52138ed802d4db4635b47b95af6a82448ff9d7ba1|3004948",
]
freezing-lamp-12123
11/01/2022, 2:21 PMTransitiveTargetsRequest
which has a closure
of all Target
types … but, what is the easiest way to get the full digest to pass to a Process
from that?rhythmic-battery-45198
11/01/2022, 3:44 PMsetup.py
script imports numpy
which is not not specified either using setup_requires
or PEP-518 build-system requires
. Is there any pants mechanism to patch this type of undeclared dependency? https://www.pantsbuild.org/docs/python-third-party-dependencies#requirements-with-undeclared-dependencies addresses a similar issue, but not for build-dependencies.boundless-zebra-79556
11/01/2022, 5:23 PMensurepip
step in export
ever fail? I'm getting error when exporting to venv, just says ensurepip ended with non zero exit. When I check venv out I actually see there's pip module missing so there's that. It doesn't give any other useful error message to check what's going wrong. I can do pants repl
just fine.ambitious-xylophone-5772
11/01/2022, 6:03 PMxdist_enabled
option. I’ve set it to be true in pants.toml
, but I’m not exactly sure if my tests are being run in parallel underneath. Checking htop
isn’t really giving me an indicationhappy-kitchen-89482
11/01/2022, 7:40 PMincalculable-hydrogen-44003
11/01/2022, 7:47 PM-no-run-cleanup
to preserve the files, but it is tedious to copy the files out of the pex sandbox. Anybody dealt with this and have a good solution?plain-summer-72727
11/01/2022, 8:39 PMambitious-actor-36781
11/02/2022, 12:35 AMfreezing-lamp-12123
11/02/2022, 9:10 AMTargetFilesGenerator
… and i’m looking at settings_request_cls
— but after digging a little bit i’ve not found what i need — i think i need to do something like this … but there’s something i’m not fully understanding yet here i think in terms of how the sausage is made …bitter-orange-16997
11/02/2022, 1:36 PMsome-match-14970
11/02/2022, 3:02 PMfreezing-lamp-12123
11/02/2022, 3:05 PMProcess
or ProcessResult
— i’m not being able to auto import and manage the imports for it … — while if i reference symbols from my local plugin it works just fine — when i do import by hand, vscode knows where the source can be found and i can jump directly into definitions …
anyway to make that include detection smarter?calm-ambulance-65371
11/02/2022, 3:30 PMlittle-train-28371
11/02/2022, 4:13 PMambitious-xylophone-5772
11/02/2022, 5:48 PM./pants tailor --check
run. We haven’t seem this happen before but we seem to be hitting:
No valid Python interpreter found. For `pants_version = "2.13.0"`, Pants requires Python 3.7, 3.8, or 3.9 to run. Please check that a valid interpreter is installed and on your $PATH.
chilly-tailor-75063
11/02/2022, 6:34 PM