ericvsmith / dataclasses

Apache License 2.0
587 stars 53 forks source link

Adding a python_requires >=3.6.* at least #149

Closed yawara closed 5 years ago

yawara commented 5 years ago

If someone install dataclasses to python3.5 ( default version of Ubuntu 16.04 ), some other packages imports are failed because python3.5 does not implement format string literal.

The current setup.py does not forbid installing to python3.5.

For example, flask 1.1.1.

$ python3
Python 3.5.2 (default, Jul 10 2019, 11:58:48)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
import flask
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/usr/local/lib/python3.5/dist-packages/flask/__init__.py", line 19, in <module>
   from . import json
 File "/usr/local/lib/python3.5/dist-packages/flask/json/__init__.py", line 25, in <module>
   import dataclasses
 File "/usr/local/lib/python3.5/dist-packages/dataclasses.py", line 246
   f'name={self.name!r},'
   ^
SyntaxError: invalid syntax
yawara commented 5 years ago

In this example, flask 1.1.1 ( compatible with python3.5 ) check the availability of dataclasses, then if it is found, flask use it and raise SyntaxError.

ericvsmith commented 5 years ago

This is a subset of #146. Closing this in preference to it.