-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
60 lines (51 loc) · 1.57 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from setuptools import setup, find_packages
from setuptools.command.install import install as _install
requirements = ["termcolor >=1.1, <1.2"]
try:
import argparse
except ImportError:
requirements.append("argparse >=1.2, <1.3")
try:
from collections import OrderedDict
except ImportError:
requirements.append("ordereddict >=1.1, <1.2")
try:
from weakref import WeakSet
except ImportError:
requirements.append("weakrefset >=1.0, <1.1")
try:
import importlib
except ImportError:
requirements.append("importlib >=1.0, <1.1")
import platform
if platform.system().lower() == "windows":
requirements.append("colorama >=0.2, <0.3")
import sys
class InstallHook(_install):
def run(self):
self.preInstall()
_install.run(self)
def preInstall(self):
if sys.version_info[0] >= 3 or sys.version_info <= (2,5):
raise Exception("This module only supports Python 2.6 or 2.7")
setup(
cmdclass = {"install": InstallHook},
name = "py.Lang",
version = "2.0.1",
description = "Common modules that probably should have been included in the Python standard library but weren't",
author = "Jesse Cowles",
author_email = "[email protected]",
url = "http://projects.indigitaldev.net/jcowles/py.Lang",
package_dir = {"":"src"},
packages = find_packages("src"),
zip_safe = False,
test_suite = "test",
install_requires = requirements,
classifiers = [
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Operating System :: OS Independent",
],
)