high-yak-85899
05/04/2022, 6:33 PMpip install
and point to the pex-based constraints file pants can generate? My context is that I'd really like to switch to the native lockfile generation pants offers, but we still have some tests that rely on a venv-style setup. We currently have requirements.txt
, requirements-dev.txt
(which contains things like pytest
, etc.) and constraints.txt
generated by pip-tools
based on those two source files. Pants is happy to use constraints.txt
even though it contains more information than it actually needs right now. If I generate the lockfile from generate-lockfiles
, that only reflects requirements.txt
. I can ./pants export
to get a venv, and then pip install -r requirements-dev.txt
in that venv, but I'm losing some reproduceability there as that pip install command no longer has a lockfile to look at.hundreds-father-404
05/04/2022, 6:35 PMbut I'm losing some reproduceability there as that pip install command no longer has a lockfile to look at.What do you mean? The Virtual environment will have all pinned versions from your lock file.
high-yak-85899
05/04/2022, 6:35 PMrequirements.txt
(which doesn't include what is in requirements-dev.txt
)hundreds-father-404
05/04/2022, 6:36 PMIf I generate the lockfile from generate-lockfiles, that only reflects requirements.txt .The lockfile will include every
python_requirement
in that resolve, even if your code does not use it. So create a second python_requirements
target generatorhigh-yak-85899
05/04/2022, 6:37 PMhigh-yak-85899
05/04/2022, 7:07 PMhigh-yak-85899
05/04/2022, 7:16 PMhundreds-father-404
05/04/2022, 7:18 PMhigh-yak-85899
05/04/2022, 7:20 PM<repo name>-venv
so that people have awareness if they're using the wrong venv when switching between repos (since we're not fully monorepo integrated yet)high-yak-85899
05/04/2022, 7:21 PMhundreds-father-404
05/04/2022, 7:23 PM