I have two distributions in my repo, let’s call th...
# general
h
I have two distributions in my repo, let’s call them A and B. Both distributions use a
pyproject.toml
to declare dependencies. Distribution B depends on distribution A, so it is listed in the
dependencies
list of B’s
pyproject.toml
in addition to the
python_distribution
for B depending on that of A. When I try generating a lockfile, I get an error like
No matching distribution found for A==0.0.1
. Other operations that interact with the lockfile also fail trying to look it up. Removing that line from the
pyproject.toml
causes the lockfile to generate as expected, but then the distribution for
B
is wrong because its
pyproject.toml
doesn’t list
A
as a dependency. My question then is, what’s the expected way to declare peer dependencies?
h
Pants will generate that requirement for you, and at the appropriate version, if you allow it to generate a setup.py. It sounds like you're not using it in that mode?
Basically Pants can look at your import-level dependencies and infer the right distribution-level dependencies from them.
Both for internal and 3rdparty requirements
So you shouldn't need those pyproject.toml at all
Or at least not the dependency information
h
I’d prefer not to have a
setup.py
- setuptools is trying to get people to move away from it after all. Is there a way to get pants to read the pyproject for all other dependencies but exclude built in ones? I tried using overrides but it didn’t seem to have an effect. Or have it add the local dependencies to the pyproject
h
Well, the setup.py is a Pants-generated internal implementation detail, you never see it.
There is an open ticket for supporting generating pyproject.toml instead, and allowing a merging of generated and user-supplied fields
There is some work to be done on that