|
1 | | -import os.path |
2 | | -from setuptools import setup |
| 1 | +import os |
3 | 2 | import sys |
4 | 3 |
|
5 | | -# Load __version__ info globals without importing anything |
6 | | -with open( |
7 | | - os.path.join(os.path.dirname(__file__), 'jsonschema', 'version.py') |
8 | | -) as fh: |
9 | | - exec(fh.read()) |
| 4 | +from setuptools import setup |
| 5 | + |
10 | 6 |
|
11 | | -with open("README.rst") as readme: |
| 7 | +with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme: |
12 | 8 | long_description = readme.read() |
13 | 9 |
|
14 | 10 | classifiers = [ |
|
26 | 22 | "Programming Language :: Python :: Implementation :: PyPy", |
27 | 23 | ] |
28 | 24 |
|
29 | | -install_requires = [] |
30 | 25 |
|
31 | | -if sys.version_info < (3, 2): |
32 | | - install_requires.append('repoze.lru >= 0.6') |
| 26 | +extras_require = {"format" : ["rfc3987", "strict-rfc3339", "webcolors"]} |
| 27 | +if sys.version_info[:2] == (2, 6): |
| 28 | + install_requires = ["argparse", "repoze.lru"] |
| 29 | +elif sys.version_info[:2] == (2, 7): |
| 30 | + install_requires = ["functools32"] |
| 31 | +else: |
| 32 | + install_requires = [] |
33 | 33 |
|
34 | 34 | setup( |
35 | 35 | name="jsonschema", |
36 | | - version=__version__, |
37 | 36 | packages=["jsonschema", "jsonschema.tests"], |
38 | 37 | package_data={"jsonschema": ["schemas/*.json"]}, |
| 38 | + setup_requires=["vcversioner"], |
| 39 | + install_requires=install_requires, |
| 40 | + extras_require=extras_require, |
39 | 41 | author="Julian Berman", |
40 | 42 | |
41 | 43 | classifiers=classifiers, |
|
44 | 46 | long_description=long_description, |
45 | 47 | url="http://github.com/Julian/jsonschema", |
46 | 48 | entry_points={"console_scripts": ["jsonschema = jsonschema.cli:main"]}, |
47 | | - install_requires=install_requires, |
| 49 | + vcversioner={"version_module_paths" : ["jsonschema/_version.py"]}, |
48 | 50 | ) |
0 commit comments