Skip to content

Commit

Permalink
Install typing module only for python<3.5
Browse files Browse the repository at this point in the history
This prevents shadowing the version of the module that comes with the stdlib since Python 3.5.
Quoting from the package pypi site (https://pypi.org/project/typing/):

"For package maintainers, it is preferred to use typing;python_version<"3.5" if your package requires it to support earlier Python versions. This will avoid shadowing the stdlib typing module when your package is installed via pip install -t . on Python 3.5 or later."

Incidentally, this fixes some bug caused by the two versions of typing coexisting that arises in some versions of Python 3.7, see e.g.:
pypa/pip#8272
https://travis-ci.community/t/python-3-7-and-3-8-builds-are-failing-attributeerror-type-object-callable-has-no-attribute-abc-registry/10900
  • Loading branch information
gfrances committed May 12, 2021
1 parent bde0513 commit fa32e28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def read(filename):
scripts=['scripts/pyrddl'],
install_requires=[
'ply',
'typing'
'typing; python_version<"3.5"'
],
include_package_data=True,
zip_safe=False,
Expand Down

0 comments on commit fa32e28

Please sign in to comment.