https://pantsbuild.org/ logo
#general
Title
# general
b

boundless-zebra-79556

10/26/2022, 8:41 PM
I'm trying to add a 3rd party dependency that depends on
tables
on mac m1. With vanilla
pip
, I install with extra brew packages and environment vars:
Copy code
brew install hdf5 c-blosc lzo bzip2

export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1                                                     
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
export HDF5_DIR=/opt/homebrew/opt/hdf5                                                        
export BLOSC_DIR=/opt/homebrew/opt/c-blosc
Is there anyway I can propagate these environment vars to
pants
when its building requirement
pex
?
1
c

curved-television-6568

10/26/2022, 8:43 PM
I think these options may be for you:
Copy code
[subprocess-environment]
env_vars.add = [
  "GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1",
  "GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1",
]

[python-native-code]
cpp_flags = "-I/opt/homebrew/opt/openssl@3/include"
ld_flags = "-L/opt/homebrew/opt/openssl@3/lib"
adjust as needed 😉
🙏 1
b

boundless-zebra-79556

10/26/2022, 9:01 PM
cool. for me
Copy code
[subprocess-environment]
env_vars.add = [
  "GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1",
  "GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1",
  "HDF5_DIR=/opt/homebrew/opt/hdf5",
  "BLOSC_DIR=/opt/homebrew/opt/c-blosc",
]
did the trick. Is there any easy way of making this environment specific? I need these only for mac m1
nvm might just put it under
.pants.rc
👍 1
6 Views