|
1 | | -from setuptools import setup |
2 | 1 | import sys |
3 | 2 |
|
| 3 | +# Before we get to the rest of setup, with dependencies on setuptools and the |
| 4 | +# Python 3 standard library, let's make sure we're not on Python 2 and provide |
| 5 | +# a helpful message if we are. |
4 | 6 |
|
5 | 7 | PY2_MESSAGE = """ |
6 | 8 | Sorry, this version of ftfy is no longer written for Python 2. |
7 | 9 |
|
8 | | -It is much easier to provide consistent handling of Unicode when developing |
9 | | -only for Python 3. ftfy is exactly the kind of library that Python 3 is |
10 | | -designed for, and now there is enough Python 3 usage that we can take advantage |
11 | | -of it and write better, simpler code. |
12 | | -
|
13 | 10 | The older version of ftfy, version 4.4, is still available and can run on |
14 | 11 | Python 2. Try this: |
15 | 12 |
|
16 | 13 | pip install ftfy==4.4.3 |
17 | 14 | """ |
18 | 15 |
|
19 | | -DESCRIPTION = open('README.md', encoding='utf-8').read() |
20 | | - |
21 | | - |
22 | 16 | if sys.version_info[0] < 3: |
23 | 17 | print(PY2_MESSAGE) |
| 18 | + readable_version = sys.version.split(' ')[0] |
| 19 | + print("The version of Python you're running is: %s" % readable_version) |
| 20 | + print("Python is running from: %r" % sys.executable) |
24 | 21 | sys.exit(1) |
25 | 22 |
|
26 | 23 |
|
| 24 | +from setuptools import setup |
| 25 | + |
| 26 | +DESCRIPTION = open('README.md', encoding='utf-8').read() |
| 27 | + |
27 | 28 | setup( |
28 | 29 | name="ftfy", |
29 | 30 | version='5.5.0', |
|
46 | 47 | "Programming Language :: Python :: 3.4", |
47 | 48 | "Programming Language :: Python :: 3.5", |
48 | 49 | "Programming Language :: Python :: 3.6", |
| 50 | + "Programming Language :: Python :: 3.7", |
49 | 51 | "License :: OSI Approved :: MIT License", |
50 | 52 | "Operating System :: OS Independent", |
51 | 53 | "Topic :: Software Development :: Libraries :: Python Modules", |
|
0 commit comments