stocky-helmet-22655
01/10/2023, 9:08 PMasync
in front claim they can’t find fixtures. I’ve got a much larger project already using tornado so re-writing without async is not currently feasible, hoping this simplified example sparks something in someone. I’ve got a sample project here with instructions on how to reproduce the issueglamorous-nail-59544
01/10/2023, 9:35 PMfancy-daybreak-62348
01/11/2023, 2:21 AMpackage
a docker_image
target within a github action. It's telling me that it cant connect to docker:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
Whats weird is that if in the same step i do docker build .
to the same dockerfile pants points to in docker_image
, it works properly and builds all layers except the ones using the pants context (i.e foo.bar/main.pex
)gray-shoe-19951
01/11/2023, 3:05 AM./pants check
command, mypy is complaining error from third-party library. Below is an example. Sometimes it goes away after re-running the command or cleaning the cache. It is annoying, any insight or suggestion?
[2023-01-02T16:05:59.896Z] .cache/pex_root/venvs/0cbc48e25cc767e871f34f3472936b3851b41d9c/bf77cd40798e75deda6009f40e4c437c9e3474cf/lib/python3.9/site-packages/torch/fx/experimental/symbolic_shapes.py:14:1: error: Cannot find implementation or library stub for module named "sympy" [import]
[2023-01-02T16:05:59.896Z] import sympy # type: ignore[import]
[2023-01-02T16:05:59.896Z] ^
[2023-01-02T16:05:59.896Z] test/unit/atom_fm/fm/pipeline/data/test_create_coarse_features_dataset.py:6: note: In module imported here:
[2023-01-02T16:05:59.897Z] .cache/pex_root/venvs/0cbc48e25cc767e871f34f3472936b3851b41d9c/bf77cd40798e75deda6009f40e4c437c9e3474cf/lib/python3.9/site-packages/xarray/__init__.py:43:1: error: Cannot find implementation or library stub for module named "importlib_metadata" [import]
[2023-01-02T16:05:59.897Z] from importlib_metadata import version as _version # type: ignore[no-redef]
[2023-01-02T16:05:59.897Z] ^
abundant-analyst-12845
01/11/2023, 8:47 AM./pants test ::
./pants test ::
08:44:38.18 [WARN] Failed to generate JUnit XML data for lambdas/hello_world/tests/test_hello_world.py.
08:44:38.18 [ERROR] Completed: Run Pytest - lambdas/hello_world/tests/test_hello_world.py failed (exit code 4).
ERROR: usage: pex [options] [file_or_dir] [file_or_dir] [...]
pex: error: unrecognized arguments: --report-skipped=
inifile: /tmp/pants-sandbox-q5Tr08/tox.ini
rootdir: /tmp/pants-sandbox-q5Tr08
wooden-baker-63668
01/11/2023, 10:38 AMbored-energy-25252
01/11/2023, 10:44 AMbillions-keyboard-33102
01/11/2023, 11:36 AMmain.py
shim to call pytest.main()
on the tests within the pex. Thank you very much in advance for any guidance on this topic!bland-soccer-72046
01/11/2023, 2:40 PMpysocks
library in the venv used by Pants
(likely here /home/circleci/.cache/pants/setup/bootstrap-Linux-x86_64/2.14.0_py38/lib/python3.8/site-packages
)
Pip needs that library to retrieve packages, hence I have the error.
Looking in indexes: <https://pypi.org/simple/>, <https://admin>:****@python-index.xxxxx.fr/simple/
ERROR: Could not install packages due to an EnvironmentError: Missing dependencies for SOCKS support.
I installed pysocks
at system venv (with pip), this is working as expected, but not while running Pants.
➡️ Can you tell me how I can add a library to the venv used by pants ?
Thank you very much for your help.glamorous-cpu-22971
01/11/2023, 3:46 PM2.7
. I think that our security scanner detected a version of the Python wheel
in package in the PEX application binary with the security vulnerability… apparently all versions of wheel
below 0.38.1
have this vulnerability.
When I built the PEX binary with Pants 2.7
: wheel
version 0.36.2
was detected.
When I built the PEX binary with Pants 2.14
: wheel
version 0.37.1
was detected.
I changed as little as possible in the Python application and configuration when upgrading the Pants versions (but I did have to make some small changes as a result of the API / CLI changes between the two Pants versions). I’m reasonably certain that the increase in wheel
version was due to the Pants upgrade, having gone to some pains to rule out other factors.
My question is: is there any way I can ask Pants to embed a newer version of the wheel
package that replaces these older versions in the PEX
binary? Is there any other information I could give that would help shed any more light on this issue?
Thanks in advance for taking a gander!curved-microphone-39455
01/11/2023, 4:12 PMresources
I would like to include all *.html
in multiple projects. I am just not sure of the syntax to specify any folder under the project root
Giving this structure
• Project A
◦ Folder A
▪︎ file.html
◦ Folder B
▪︎ Folder B.1
• file.html
◦ BUILD
Can I include only this in the BUILD at the root of every projects ?
python_sources(
dependencies=[":static-files"],
)
resources(
name="static-files",
sources=["**/*.html"]
)
Thanks in advance 🙂important-restaurant-12848
01/11/2023, 5:33 PMbrash-student-40401
01/11/2023, 5:55 PMdocker_image(
name="create_json_image",
repository="repo",
dependencies=[":create_json_lambda"],
image_tags=["tag"],
)
python_awslambda(
name="create_json_lambda",
runtime="python3.8",
handler="lambda_function.py:lambda_handler",
)
python_sources(
dependencies=[
"src/vendor/python:reqs#pkg1",
"src/vendor/python:reqs#pkg2",
]
)
And then the Lambda itself gives me errors like:
[ERROR] ResolveError: Failed to resolve requirements from PEX environment @ /app.
Needed cp38-cp38-manylinux_2_26_x86_64 compatible dependencies for:
1: Pillow>=8.1.1
Required by:
pkg2
But this pex had no ProjectName(raw='Pillow', normalized='pillow') distributions.
(with lots of other un-available packages). Is this a problem with Lambdex? Pants has always been so great at avoiding dependency errors!fancy-daybreak-62348
01/11/2023, 7:45 PMrapid-bird-79300
01/11/2023, 8:04 PMchilly-holiday-77415
01/11/2023, 10:49 PMfancy-daybreak-62348
01/12/2023, 1:31 AMpackage
a pex binary, do i have to do anything special to make pants know that import my_proto_source
?curved-farmer-66180
01/12/2023, 3:26 AM{build_args.REGISTRY}/$stg/$ecr_repository:$IMAGE_TAG +1 additional tag.
Error: 5.45 [ERROR] 1 Exception encountered:
ProcessExecutionFailure: Process 'Building docker image {build_args.REGISTRY}/$stg/$ecr_repository:$IMAGE_TAG +1 additional tag.' failed with exit code 125.
stdout:
stderr:
invalid argument "{build_args.REGISTRY}/$stg/$ecr_repository:$IMAGE_TAG" for "-t, --tag" flag: invalid reference format
See 'docker build --help'.
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
github action ci file
run: |
./pants publish \
--docker-build-args='[ \
"DD_SERVICE=payhere-hero-cx", \
"DD_ENV=stg", \
"DD_VERSION=$IMAGE_TAG", \
"IMAGE_TAG=$IMAGE_TAG", \
"REGISTRY=$ECR_REGISTRY", \
"REPOSITORY=$STG/$ECR_REPOSITORY", \
]' payhere/app_services/hero_cx:payhere_hero_cx
I got the error with invalid argument. I am using docker plugin. Is anybody able to help?glamorous-nail-59544
01/12/2023, 2:52 PMrun
goal fail when the applied filters return nothing?
I am trying to run DB migrations if there is any change detected in my microservice migrations, but if I use the --changed-since
flag and nothing is detected, it fails my ci.
I also tried the list
goal and piped the result into a run, same thing.
Any ideas?able-advantage-61346
01/12/2023, 3:13 PM./pants export ::
? When I run the command it fails on compiling grpcio (MacOS). I have solved it by setting a few env variables in my zsh profile, but they don't seem to be present when ./pants export ::
runs.aloof-appointment-30987
01/12/2023, 4:02 PMgo_mod
target in a BUILD file at the monorepo root. go_binary
in sub directories pick this up.
I would like to mirror the convention used for Python and place the go.mod and associated build file in [monorepo root]/3rdParty/go/
Is this possible? When I try. pants reports `The target ... does not have a go_mod
target in its BUILD file or any ancestor BUILD files.`
dependencies
on `go_package`does not resolve the go mod targetabundant-analyst-12845
01/12/2023, 4:11 PMaloof-appointment-30987
01/12/2023, 4:21 PMdevelop
branch on the git remote?
Does it work with ./pants --changed-since=develop tailor
Does it work with ./pants --changed-since=main test tailor
(or whatever you name your main brach)?big-fall-51153
01/12/2023, 4:21 PMaloof-appointment-30987
01/12/2023, 4:22 PMfancy-daybreak-62348
01/12/2023, 4:35 PMancient-rose-27306
01/12/2023, 5:54 PMTree of: /root/project
.
|__apps
| |__app1
| |__app2
| |__app3
And I have the root_patterns
declared as:
[source]
root_patterns = [
"/apps/app2",
"/apps/app3",
]
But the command ./pants tailor ::
is generating BUILD
files in apps/app1
too. I don’t want that to happen. Could anyone please help?famous-river-94971
01/12/2023, 6:31 PMpants
? I use CodeArtifact for a private PyPi repository, so I need CODEARTIFACT_AUTH_TOKEN
to be set in the environment. It'd be pretty cool if I could somehow hook into the bootstrap process to:
• check if the CODEARTIFACT_AUTH_TOKEN
environment variable is set.
◦ if so, continue
◦ if not, set it
▪︎ upon failure, throw an error message telling the dev what to do
Is this possible? Thanks!famous-river-94971
01/12/2023, 8:28 PM--changed-since
on main
branches after a PR is merged? For example, with this workflow:
1. A PR is opened, we can use --changed-since=origin/main
to detect everything that's new on the PR.
2. The PR is merged to main
. We want to run a command with effectively the same files that "changed-since" on the PR, but we can't use origin/main
anymore.
A few thoughts in the 🧵curved-microphone-39455
01/12/2023, 9:07 PMpublish
Goal for docker_image
to put a dynamic Tag, I have already have a Git Tag with semver
accessible at this moment in my ci/cd, so if I have 1.2.3
, how could I publish to my repository using the same tag 1.2.3
?