What's the proper way to handle items in `requirem...
# general
h
What's the proper way to handle items in
requirements.txt
that come from a repository? It seems the
python_requirement
target happily consumes these, but I got an error when pants was resolving my
constraints.txt
generated by
pip-compile
.
Error was
Copy code
DEPRECATION: Constraints are only allowed to take the form of a package name and a version specifier.
Per this, I have something like (although not this)
Copy code
some-package@ <git+ssh://git@github.com/source/some_package.git@abcdefg>
Since I'm pinning a specific hash, I think it's silly that it shows up in
constraints.txt
anyway so I might add a separate parser to go in and cut those lines in the script used to generate this file.
h
With "come from a repository", it looks like you mean "VCS requirements", i.e. Git requirements, right? Rather than a custom index/"cheeseshop"? Yeah, see https://www.pantsbuild.org/docs/python-third-party-dependencies#version-control-and-local-requirements Indeed, I think you will need to leave it off of
constraints.txt
. The upcoming lockfile revamp will switch from constraints.txt to first-class lockfiles (via Pex), which will soon-ish have first-class support for locking VCS requirements: https://github.com/pantsbuild/pex/issues/1556
h
Nice, definitely easy to do, just wanted to make sure that was right. I voted very much for lock file support! That was my favorite part of investigating with poetry.
🙌 1