[solved] Hi :wave: I am new to pants and struggle ...
# general
g
[solved] Hi 👋 I am new to pants and struggle setting up the target for the following scenario: a shell script that calls a python module (
python -m module
) and the "catch" is that the python interpreter must not be the default one. What I have tried to do is the following:
Copy code
shell_source(
    source="./my-script.sh",
    dependencies=[
        "//tools/pants/dev:dev_env_export",
    ]
)

python_sources(
    name="dev_env_export",
    interpreter_constraints=["CPython==3.9.*"],
    resolve = "dev-pants",
    dependencies=[
        "//tools/pants/dev:dev-pants",
    ]
)

pants_requirements(
    name = "dev-pants",
    resolve = "dev-pants"
)
However,
pants_requirements
gets processed with the default interpreter (Py312), which then fails. What's the right way to make
pants_requirement
use Py39? Thanks 🙏
1
s
You have a separate resolve "dev-pants", you need to set interpreter constraints for the resolve
g
Yes, that's it. Thanks a lot!
👍 1