Is it possible to generate a `python_requirement` ...
# general
r
Is it possible to generate a
python_requirement
target using a local
.tar.gz
distribution? You can do this with
pip install local.tar.gz
r
yes, https://www.pantsbuild.org/v2.10/docs/python-third-party-dependencies#version-control-and-local-requirements
You can also install from local files using PEP 440 direct references. You must use an absolute path to the file, and you should ensure that the file exists on your machine.
Copy code
Django @ file:///Users/pantsbuild/prebuilt_wheels/django-3.1.1-py3-none-any.whl
🙌 1
👍 1
h
Thanks Ouail for linking to that. Warning that local files do not yet work with the
generate-lockfiles
goal in Pants 2.10 and 2.11, so you'd to manually generate the locks if you use a lockfile (which we recommend) https://www.pantsbuild.org/v2.10/docs/python-third-party-dependencies#generate-lockfiles-goal-vs-manual-lockfile-generation Pants 2.11 or 2.12 will hopefully add support for VCS (git) and local path requirements to locks, thanks to switching to Pex for lockfiles rather than Poetry