Dependencies fail to resolve correctly when installing via egg #1179
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
Python 3.8.5
andPython 3.8.3
pip 20.1.1
andpip 19.3.1
, respectively with the Python versionsgoogle-api-python-client
version:1.12.8
(latest)Steps to reproduce
wheel
andsetuptools
are installed.Build
FooModule
as an egg:python3 setup.py bdist_egg
Try to install the egg:
python3 -m easy_install dist/FooModule-0.0.1-py3.8.egg
ORpython3 setup.py install
. This should fail! The error iserror: google-auth 2.0.0.dev0 is installed but google-auth<2.0dev,>=1.21.1 is required by {'google-api-core'}
See the full output below.Click to expand
pip3 freeze | xargs pip3 uninstall -y
and verify onlypip
,wheel
, andsetuptools
are installed before continuing.FooModule
as a wheel:python3 setup.py bdist_wheel
pip3 install dist/FooModule-0.0.1-py3-none-any.whl
This will resolve the dependencies fine and succeed!What's going on?
This is my best guess. This package's dependencies are written as follows:
google-api-python-client/setup.py
Lines 34 to 41 in 91b61d3
Notably,
google-api-core
itself has a dependency ongoogle-auth
,"google-auth >= 1.21.1, < 2.0dev"
.Naively, these dependencies specify incompatible ranges. If
google-auth>=1.16.0
is installed first, then the resultinggoogle-auth
dependency ingoogle-api-core
will fail to be satisfied (google-auth 2.0.0.dev0 is installed but google-auth<2.0dev,>=1.21.1 is required by {'google-api-core'}
).However, it seems like pip and/or the wheel format are able to figure this out, and install a compatible dependency. easy_install and/or the egg format are unable to figure this out, and an error occurs.
Is this something that the google-api-python-client team is interested in fixing? I think the fix would be as simple as removing the dependency on
google-auth
, or upper-bounding the dependency range to matchgoogle-api-core
's dependency range.Workarounds in the meantime
google-auth<2.0dev
toFooModule
. This is what we're doing today. It might rely on the ordering ofinstall_requires
, which isn't guaranteed to be the installation order.FooModule
as a wheel. This is the more mature solution. We hope to do this eventually.The text was updated successfully, but these errors were encountered: