green-match-66337
06/28/2022, 11:53 AMrich-king-51691
06/28/2022, 2:47 PMextra_env_vars
? I have
[test]
extra_env_vars = ["VAR=value"]
in pants.toml
This works in Python, but those environment is completely empty for Go?flat-queen-95161
06/28/2022, 6:48 PMflat-queen-95161
06/29/2022, 8:00 AMflat-queen-95161
06/29/2022, 8:01 AMflat-queen-95161
06/29/2022, 8:02 AMagreeable-minister-96040
06/29/2022, 8:13 AMhigh-energy-55500
06/29/2022, 2:03 PMblack
and i’m getting an error i don’t understand when trying to run ./pants fmt
, does anyone understand what the issue is? (traceback in thread)thousands-plumber-33255
06/29/2022, 3:22 PMentrypoint.sh
pants.toml
/serviceA
Dockerfile
BUILD
And the COPY in the Dockerfile looks like this:
COPY entrypoint.sh /
What needs to be added to the BUILD file? It is always complaining that the file cannot be found.bitter-ability-32190
06/29/2022, 9:18 PMhigh-energy-55500
06/29/2022, 9:27 PMhigh-energy-55500
06/30/2022, 12:03 AM./pants fmt ::
is printing out multiple lines for some reason (see thread)thousands-plumber-33255
06/30/2022, 7:10 AMrefined-addition-53644
06/30/2022, 11:07 AMpre-commit
for linting formatting. I added a flake8 plugin called flake8-docstrings
to check for docstring.
In case the lint check for flake8 fails because of docstring, pre-commit doesn't show any log about what are the checks its failing.
On the other hand, when I manually run ./pants lint ::
I do see the log about what are the cases which are failing.
This is how the .pre-commit-config.yaml
section looks like
- repo: local
hooks:
- id: lint-check
name: Checking source files formatting
entry: "./pants --changed-since=main lint"
language: script
types: [python]
pass_filenames: false
verbose: true
big-xylophone-43403
06/30/2022, 8:33 PMcareful-address-89803
07/01/2022, 5:26 AMmsal-extensions
, it has a dependency on portalocker, which has a dependency on pywin32
on windows. If I have msal-extensions
listed directly in a python_requirment
, it thinks that it always needs pywin32
. But if instead I copy the dependencies that it requests, it correctly identifies that it only needs pywin32
on windows. Details and repro in threadhappy-family-315
07/01/2022, 2:23 PMrun --debug-adapter
on the target django:manage, which sets the field run_in_sandbox
to True
. This will likely cause your breakpoints to not be hit, as your code will be run under the sandbox's path.`
My breakpoints do not work when debugging tests or debugging a normal run. Is there a way to make that work? Currently I am using PANTS_SHA: 918ac2f68182a8d308113eff336f55dcdbc84847cool-printer-74432
07/01/2022, 5:15 PMpants repl
? E.g., help(str)
in repl
gives me empty output.proud-dentist-22844
07/01/2022, 11:42 PM!
. That only applies to CLI specs, right? We aren't replacing !
specs in BUILD files with -
right?freezing-lamp-12123
07/02/2022, 6:54 AMfew-arm-93065
07/02/2022, 7:45 PMsrc/common:lib
which depends on some 3rd-party python packages, and many other modules which each have their own additional 3rd party dependencies. These other modules follow a pattern of python_requirements
-> python_sources
-> pex_binary
-> docker_image
-> python_tests
. Their python_sources
all declare a dependency on src/common:lib
.
My intention is to have all the dependent modules inherit the python dependencies of src/common:lib
, but I can’t do that without multiple resolves. When I try that, I get errors trying to reference those targets. Example:
python_requirements(resolve="align")
python_sources(
name="lib",
sources=["src/*.py"],
dependencies=[
'src/common:lib',
'#pandas',
'#pysam'
],
resolve=parametrize("align", "common")
)
pex_binary(
name="exe",
entry_point="src/align.py",
dependencies=[':lib'],
shebang="/usr/bin/env python3",
platforms=[
"current",
"manylinux2014_x86_64-cp-39-cp39",
],
resolve=parametrize("align", "common")
)
docker_image(
name="docker",
image_tags=["{build_args.GIT_BRANCH}", "{build_args.GIT_COMMIT}", "{build_args.RELEASE_VERSION}"],
dependencies=[
"src/common/docker:python_base",
":exe",
]
)
python_tests(
name="tests",
sources=["tests/test_*.py"],
dependencies=[
":lib",
"src/test_framework:lib",
":test_data",
],
runtime_package_dependencies=[":docker_test"],
tags=["docker_required"],
resolve=parametrize("align", "common")
)
When I test this, I get:
ValueError: The address `src/stages/align:exe` was not generated by the target `src/stages/align:exe`, which only generated these addresses:
* src/stages/align:exe@resolve=align
* src/stages/align:exe@resolve=common
Did you mean to use one of those addresses?
Any idea how to work with this? I tried setting the :exe
targets to :exe@resolve=align
and :exe@resolve=common
, and even tried both at once - but each time they errored out because neither resolve has the full set of dependencies.careful-address-89803
07/04/2022, 3:09 PMhigh-yak-85899
07/04/2022, 9:33 PMunzipped_pexes
determined?ambitious-actor-36781
07/05/2022, 8:01 AMpip
implementation (https://github.com/micropython/micropython/blob/4b9a2abbdec0e905fbc08f247513e43fb6bff39e/tools/upip.py) that installs packages to a directory for you.
But it's uh, low-budget, and has some issues. But the main thing it does is puts the code where it's needed (in micropython your PYTHONPATH
is /
and that's where you put everything.)
Can I do this with pant's existing pex packaging? Just need the .py files copied to a directory.refined-addition-53644
07/05/2022, 8:10 AMpyprojec.toml
when using poetry?billions-keyboard-33102
07/05/2022, 9:00 AMpython_sources
https://www.pantsbuild.org/docs/reference-python_sources
In the docs under dependencies
it says:
This augments any dependencies inferred by Pants, such as by analyzing your importsIs there a way to disable the automatic import analysis and just use the manual list? I want to be explicit about the dependencies that’s all.
billions-keyboard-33102
07/05/2022, 10:00 AMpants export
to skip the export of the virtualenvs for the tools (e.g. pytest
, autoflake
, black
etc.)
I only want to export the python-default
resolve virtual-env.
I see export
has no options. https://www.pantsbuild.org/docs/reference-export
Maybe I’m missing something though.billions-keyboard-33102
07/05/2022, 10:02 AMcurved-television-6568
07/05/2022, 10:48 AMcurved-television-6568
07/05/2022, 10:48 AM