Closed
Description
Reproed this from a question asked on the Pants slack, and it seems like it's a Pex issue and can be reproed standalone.
The original question:
It seems that uv pip interpreters includes (-r extra.txt ) relative to the current requirement file, whereas pants seems to take it relative to project root. Is there a way to get pants to include the file relative to the including file? Or at least relative to the BUILD file that has the python_requirements target?
And this script reproduces a success with both uv
and pip
but fails with pex
:
python3 -m venv .venv
source .venv/bin/activate
mkdir -p requirements
echo "numpy" > requirements/requirements.txt
echo "-r extras.txt" >> requirements/requirements.txt
echo "pandas" > requirements/extras.txt
pip install --dry-run -r requirements/requirements.txt
uv pip install --dry-run -r requirements/requirements.txt
pex3 lock create -r requirements/requirements.txt
This is using pex 2.38.