`multiple pypi indexes & multiple resolves` I...
# general
b
multiple pypi indexes & multiple resolves
I have a project with multiple resolve and multiple indexes. I use pipenv to generate initial lock files and then pants uses that lock file to generate its own lockfiles for each resolve. Package
X
available in multiple pypi indexes. Version <1.2 is available in index
A
and version >1.2 in index
B
. In the Pipfile I explicitly mention the index it should use. Pipenv successfully generates a lock file that contains version
X>=1.5
but pants fails.
Copy code
ERROR: Could not find a version that satisfies the requirement X==1.5.1
ERROR: No matching distribution found for X==1.5.1
Is there a way to limit an index use for a specific resolve? As I understand I have to specify all indexes I want to use in
pants.toml
, but I cannot limit the use to specific resolves. Also there is no way to select it during locking.
using pants 2.16.0
It looks like the problem was with interpreter_constraints, the pants env had wider constraints than the package I wanted to install, which caused pants not to find it.
g
Yeah; Pants has to be able to select a package (including exact version!) for all the Python's your targeting If you say "Python 3.8 to Python 3.11" then the package has to exist for all of them. Re: your original question (which was a red herring) per-resolve-repos is something I'd want to add but haven't found time for. In this case it wouldn't have had any effect, but helps with limiting scope and visibility during resolves.