Is there a way to only include a dependency in a t...
# general
s
Is there a way to only include a dependency in a target only when running on a particular platform? Our project is using a 3rd party library that's a thin python wrapper around C++ code. There are pre-built pypi packages for x86 and for macOS's darwin arm platform, but not for aarch64, so I need to build that myself. However, I don't want to run this cumbersome build in any environment that doesn't need it. Does
python_requirement
support specifying an environment? Or would the build target that does the building always be included as a dependency, but it only executes in certain environments?
w
I haven't tried what you're trying to do, but maybe check this out? https://www.pantsbuild.org/2.21/docs/using-pants/environments#building-one-target-in-multiple-environments Might be something you can use this for, using some of the builtins: https://www.pantsbuild.org/2.21/reference/build-file-symbols
c
I think you could express this in the regular python version specifier way https://peps.python.org/pep-0440/
s
Does that still apply for wheels that I generate myself and reference with a file path? I'll try and see what happens.