Poetry: Poetry doesn't honor python version constraint in setup.py

Created on 7 Aug 2019  路  4Comments  路  Source: python-poetry/poetry

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.

Issue

It seems that poetry doesn't honor the following constraint:

if sys.version_info[0] >= 3:
    install_requires = ['Flask>=0.10.1', 'python3-openid>=2.0']
    extra['use_2to3'] = True
else:
    install_requires = ['Flask>=0.3', 'python-openid>=2.0']

Link to source: https://github.com/mitsuhiko/flask-openid/blob/master/setup.py#L30

In the gist pyproject.toml, airflow is installing Flask which installs flask-openid. If I do not maually add python3-openid = "^3.1" in my pyproject.toml, poetry installs python-openid==2.2.5 which is only compatible with python 2.

Most helpful comment

@mbelang This is true for installing the packages but not for resolving the dependencies.

All 4 comments

Same issue for 锘匡豢锘匡豢https://github.com/python/typing/blob/master/typing_extensions/setup.py#L67

And as a result this broke package installation with AttributeError: type object 'Callable' has no attribute '_abc_registry' like here https://github.com/aws/chalice/issues/1050

This issue has been reported before and the gist of it is: this is not an issue with Poetry. Checking the Python version programmatically is not recommended and environment markers should be used. Poetry does not execute the setup.py file, for security reasons, and as such cannot see the dependencies.

You should report the issue upstream.

Fair enough but I thought poetry was using pip under the hood and pip install does honor the dependency?

@mbelang This is true for installing the packages but not for resolving the dependencies.

Was this page helpful?
0 / 5 - 0 ratings