|
15 | 15 | # See the License for the specific language governing permissions and |
16 | 16 | # limitations under the License. |
17 | 17 |
|
18 | | -import distutils.core |
19 | | -import io |
20 | | -import sys |
21 | | -# Importing setuptools adds some features like "setup.py test", but |
22 | | -# it's optional so swallow the error if it's not there. |
23 | | -try: |
24 | | - import setuptools |
25 | | -except ImportError: |
26 | | - pass |
27 | | - |
28 | | -major, minor = sys.version_info[:2] |
29 | | -python_25 = (major > 2 or (major == 2 and minor >= 5)) |
30 | | -if not python_25: |
31 | | - raise RuntimeError("Python 2.5 or newer is required") |
32 | | - |
33 | | -# Discover version of phonenumbers package |
34 | | -from phonenumbers import __version__ |
35 | | - |
36 | | -# Discover whether per-prefix data is available |
37 | | -if 'lite' in sys.argv: |
38 | | - lite = True |
39 | | - del sys.argv[sys.argv.index('lite')] |
40 | | -else: |
41 | | - lite = False |
42 | | -if not lite: |
43 | | - try: |
44 | | - import phonenumbers.tzdata |
45 | | - except ImportError: |
46 | | - lite = True |
47 | | - |
48 | | -with io.open("README.md", mode="r", encoding="utf-8") as readme: |
49 | | - long_description = readme.read() |
50 | | - |
51 | | -# Various parameters depend on whether we are the lite package or not |
52 | | -if lite: |
53 | | - pkgname = 'phonenumberslite' |
54 | | - pkgs = ['phonenumbers', 'phonenumbers.data', 'phonenumbers.shortdata'] |
55 | | -else: |
56 | | - pkgname = 'phonenumbers' |
57 | | - pkgs = ['phonenumbers', 'phonenumbers.data', 'phonenumbers.geodata', 'phonenumbers.shortdata', |
58 | | - 'phonenumbers.carrierdata', 'phonenumbers.tzdata'] |
59 | | - |
60 | | -distutils.core.setup(name=pkgname, |
61 | | - version=__version__, |
62 | | - description="Python version of Google's common library for parsing, formatting, storing and validating international phone numbers.", |
63 | | - long_description=long_description, |
64 | | - long_description_content_type="text/markdown", |
65 | | - author='David Drysdale', |
66 | | - |
67 | | - url='https://github.com/daviddrysdale/python-phonenumbers', |
68 | | - license='Apache License 2.0', |
69 | | - packages=pkgs, |
70 | | - test_suite="tests.examplenumberstest", |
71 | | - platforms='Posix; MacOS X; Windows', |
72 | | - package_data={"": ["*.pyi", "py.typed"]}, |
73 | | - classifiers=['Development Status :: 5 - Production/Stable', |
74 | | - 'Intended Audience :: Developers', |
75 | | - 'License :: OSI Approved :: Apache Software License', |
76 | | - 'Operating System :: OS Independent', |
77 | | - 'Topic :: Communications :: Telephony', |
78 | | - 'Programming Language :: Python :: 2', |
79 | | - 'Programming Language :: Python :: 2.5', |
80 | | - 'Programming Language :: Python :: 2.6', |
81 | | - 'Programming Language :: Python :: 2.7', |
82 | | - 'Programming Language :: Python :: 3', |
83 | | - 'Programming Language :: Python :: 3.3', |
84 | | - 'Programming Language :: Python :: 3.4', |
85 | | - 'Programming Language :: Python :: 3.5', |
86 | | - 'Programming Language :: Python :: 3.6', |
87 | | - 'Programming Language :: Python :: 3.7', |
88 | | - 'Programming Language :: Python :: 3.8', |
89 | | - 'Programming Language :: Python :: 3.9', |
90 | | - 'Programming Language :: Python :: 3.10', |
91 | | - 'Programming Language :: Python :: 3.11', |
92 | | - 'Programming Language :: Python :: 3.12', |
93 | | - 'Programming Language :: Python :: Implementation :: CPython', |
94 | | - 'Programming Language :: Python :: Implementation :: PyPy', |
95 | | - ], |
96 | | - ) |
| 18 | +import setuptools |
| 19 | +setuptools.setup() |
0 commit comments