Is there a way to get the resolved python interpre...
# plugins
c
Is there a way to get the resolved python interpreter path inside a
@rule
?
context: mostly through pants upgrade(!!!) but our rust + pyO3 plugin is unhappy because the Python interpreter appears to be stripped from the path or something:
Copy code
error: failed to run custom build command for `pyo3-build-config v0.16.4`

Caused by:
  process didn't exit successfully: `/tmp/process-execution5FMB10/target/release/build/pyo3-build-config-7a02b8b034926fc6/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=PYO3_CONFIG_FILE
  cargo:rerun-if-env-changed=PYO3_NO_PYTHON
  cargo:rerun-if-env-changed=PYO3_PYTHON
  cargo:rerun-if-env-changed=VIRTUAL_ENV
  cargo:rerun-if-env-changed=CONDA_PREFIX
  cargo:rerun-if-env-changed=PATH

  --- stderr
  error: no Python 3.x interpreter found
I can probably hack this, but I'd like to do it "right" and use the interpeter that pants resolves for this context
f
request
PythonBinary
from the engine
if you want an interpreter
c
Awesome, I was hoping it'd be that easy!
thank you!
(comments give more context on it)
c
There doesn't appear to be a
PythonBinaryRequest
type, or am I missing it?
f
just put
python: PythonBinary
as an argument to your rule
👍 2
the engine knows how to fill that in