proud-dentist-22844
12/03/2022, 7:27 PMpants.toml
.
• Can I export the same resolve multiple times, each with a different python interpreter?
Background: For st2 CI, I need one virtualenv for python 3.8 and another for python 3.6 (3.6 is ancient I know. updating that is a separate effort). I will use the exported virtualenvs instead of a Makefile managed venv for processes that have not yet been configured in pants. Eventually, I'll be able to stop using the exported virtualenv and just use pants for everything, but this should help to bridge that gap.flat-zoo-31952
12/05/2022, 2:50 PMexample/lib.py
I would expect files that import that like example/app.py
to be an affected transitive dependent, but it doesn't seem like this is the case. Is there a way to enable this behavior if it exists? Or does that imply scanning deps on two different versions of the worktree?freezing-lamp-12123
12/05/2022, 4:18 PMmodern-manchester-33562
12/05/2022, 4:37 PM./pants generate-lockfiles --resolve=my-resolve
. Recently it's become an absolute path which is quite annoying.fresh-cat-90827
12/05/2022, 5:00 PMabundant-autumn-67998
12/05/2022, 6:43 PM-D
- these end up in the target site-packages
. Is there a way to install data files outside site-packages
as well, without using setup.py or Python build mechanisms? If not, I can repurpose -D
to ship data files into, say site-packages/some-data
. However is there an easy way to discover the path of the venv when running the pex-file? We build with pex tools but do not unpack the pex-file manually.thousands-sandwich-2635
12/05/2022, 7:50 PMbuild_ext
, and implement our own cache so that we only rebuild modules that have changed. I can define a distribution target for the library in Pants that triggers the build_ext
routine, but in this case our cache doesn't work. And when building the Pex, I'd like to bring along just those shared library files that are required and not the whole boatload.
It seems like what I want is to be able to define a target for each eventual shared library file, with dependencies looking something like:
pex -> application code -> .so file -> .py source
Before I dive too deep into the plugin framework, any pointers or feedback? If I were to go the route of writing a plugin, any words of advice for how to think about this?loud-laptop-17949
12/05/2022, 8:53 PM./pants list
to output only filenames and not the owning target name as well?high-yak-85899
12/05/2022, 9:32 PMrules_rust
and it seems to work fine, so we always have that as a fallback.fresh-cat-90827
12/05/2022, 10:48 PM./pants dependencies
does when dependency inference is disabled and enabled 🧵eager-dress-66405
12/05/2022, 11:10 PMextra_requirements
for different segments of the codebase. Is this something pants might want to support natively? Any advise on what a plugin for it might look like?best-byte-73775
12/06/2022, 10:17 AMbillions-keyboard-33102
12/06/2022, 5:19 PMPEX_INHERIT_PATH=fallback
- I couldn’t remove the /var/runtime
from the python path 😞
https://pex.readthedocs.io/en/latest/api/vars.html#PEX_INHERIT_PATHenough-analyst-54434
12/06/2022, 5:47 PMsys.path
? If its the latter, I think you can, you just don't use - I forget the terminology exactly - the standard AWS Lambda executor. They have an API to plug that.enough-analyst-54434
12/06/2022, 5:48 PMenough-analyst-54434
12/06/2022, 5:50 PM-D <dir>
where that dir includes an executable bootstrap
file meeting their specs. If that proves difficult, perhaps a feature can be added to ... Pants I think, to do that for you. This feels 1 level higher than Pex, Pants knows AWS Lambda, Pex does not - currently.billions-keyboard-33102
12/06/2022, 5:58 PMenough-analyst-54434
12/06/2022, 6:17 PMpex_binary
instead. That supports PEX_INHERIT_PATH
config (https://www.pantsbuild.org/docs/reference-pex_binary#codeinherit_pathcode). You really only need python_awslambda
for the lambda zip deployment scheme and even that is only historically true. You can now use a plain old PEX (pex_binary
again) for that too; you just prefix your lambda entry point configuration value out in AWS with __pex__.
to make PEX files as lambda zips work.gentle-painting-24549
12/06/2022, 6:23 PMpackage-1
has a Pyrex file (foo.pyx
) that gets compiled to a C Extension (foo.c
) at build time. The issue that I’m having is with plain Python projects in the monorepo that depend on that module. So in package-2
the following import raises an error, from package_1.foo import bar
.
My current workaround has been to create multiple resolves so that package-1
is actually a third party dependency for package-2
and the from package_1.foo import bar
statement passes as expected.
But I don’t really like that solution and now I’m stuck with an issue where in order to make a change to both package-1
and package-2
I have to go through the burdensome process of changing package-1
and republishing it and then changing package-2
.
Is there any pants magic that will allow me to keep both of these projects using the same resolve (i.e. package-2
depends on the compiled package-1
instead of the uncompiled code)?aloof-appointment-30987
12/06/2022, 6:25 PMFROM python:3.8
ENTRYPOINT ["/example_app"]
COPY apps.python.example_app/example_app_bin.pex /example_app
Are Go build artifacts tracked in the same way?
Any examples or documentation to point me to?billions-keyboard-33102
12/06/2022, 6:30 PMenough-analyst-54434
12/06/2022, 6:34 PMpex_binary
like I said and ensure a few things like a platforms
or complete_platforms
that matches AWS (I can provide more info there is needed), inherit_path
to solve your problem without having to set PEX_*
env vars out in AWS and a handler spec like __<http://pex__.my|pex__.my>_<http://package.my|package.my>_module:my_handler_func
.billions-keyboard-33102
12/06/2022, 6:35 PMenough-analyst-54434
12/06/2022, 6:35 PMpython_awslambda
target / rules.freezing-lamp-12123
12/06/2022, 8:24 PMThere is a predefined rule to go from PexProcess -> Process, so Get(ProcessResult, Process) will cause the engine to run PexProcess -> Process -> ProcessResult.is it possible to create your own external tool installer which runs a specific command to get the environment correctly setup, similar to the pex machinery and
PexRequest
/ PexProcess
?high-yak-85899
12/06/2022, 8:54 PMpex_binary
and docker_image
target for me for the majority of simple cases where we're just doing the standard base image and copying in a pex. Any recommendations on how to autopopulate the COPY
line of the Dockerfile
? I'd like to avoid requiring the user to specify the full path to the module that serves as the entrypoint for the pex_binary
, but I'm not sure there's another way.curved-television-6568
12/06/2022, 9:11 PMlemon-oxygen-72498
12/06/2022, 9:29 PM./pants test ::
command tests all versions. Sounds cool on paper. But getting pyenv
work fast in the CI is a job in itself.
How do you people do that smartly on GitHub actions? Any pointer?sparse-lifeguard-95737
12/06/2022, 9:49 PM./pants export --symlink-python-virtualenv
🧵high-yak-85899
12/06/2022, 9:57 PMinstructions
set to a list and source=None
in a docker_image
target, but I'm getting an error like "provides both a Dockerfile with the source
field, and Dockerfile contents with the instructions
field, which is not supported.". To fix, it's saying to set source=None
or instructions=None
. When I do source=''
, things are happy.