ivankorobkov / python-inject

Python dependency injection
Apache License 2.0
694 stars 79 forks source link

pip installing to Python 2.7 installs the non 2.7 compatible version #73

Open selimt opened 3 years ago

selimt commented 3 years ago

It seems like pip installing the latest version of inject on Python 2.7 tries to install version 4.3.1 which is compatible with 3.6+ . Is there a way for it to resolve to the latest 2.7 compatible version?

Thanks.

ivankorobkov commented 3 years ago

Hi,

There is a table with supported versions in readme:

Python Inject Version
3.6+ 4.1+
3.5 4.0
< 3.5 3.*

You can install a specific version with: pip install 'Inject==3.5.4'

selimt commented 3 years ago

Yes but if your setup.py contained the ‘python_requires’ option as specified here:

https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires

then pip would not try to install an incompatible release.

ivankorobkov commented 3 years ago

You may add it and make a pull request, if you want :-)