is it possible to set `execution_mode="venv"` and...
# general
c
is it possible to set
execution_mode="venv"
and
venv_site_packages_copies=True
in a test environment? Context here: I’m trying to test AWS CDK code which depends on an installed
node
binary
e
@chilly-holiday-77415 that should be the default already for the PEX venvs Pants runs pytest with. Do you have any custom
pants.toml
config? For example, if this is set to True, that would foil you here: https://www.pantsbuild.org/v2.17/docs/reference-pex#venv_use_symlinks
c
Hey John - thanks for getting back to me, I didn’t want to tag you to avoid sniping you specifically with more jsii/node stuff. I’m getting the same “node not found” error from the previous thread:
Copy code
------------------------------- Captured stderr --------------------------------
b'No version is set for command node\n'
b'Consider adding one of the following versions in your config file at \n'
b'nodejs 18.6.0\n'
b'nodejs 19.4.0\n'
b'nodejs 16.19.0\n'
which lead me to try and follow the same path - the cdk pex itself is working (in that it runs without complaint). Here’s my full pants.toml…
Untitled
e
Copy code
b'Consider adding one of the following versions in your config file at \n'
Note the ghost "" config file. I know ~nothing about node here but you do. Does that prompt you?
So, basically tests run under /tmp unlike when you run a PEX, which is likely under ~
Do you have node config under your home dir? If so tests may not find that when run from /tmp depending on node config discovery algorithms.
c
💡 this is going to be an
asdf
issue I think, I also know ~nothing about node except I installed it with that and it seems like that phrase is generated by asdf from googling it 🙂 thanks John!