forked from python-excel/xlrd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
77 lines (67 loc) · 2.22 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env python
from os import path
import sys
python_version = sys.version_info[:2]
av = sys.argv
if len(av) > 1 and av[1].lower() == "--egg":
if python_version < (2, 3):
raise Exception("Can't lay eggs with Python version %d.%d " % python_version)
del av[1]
from setuptools import setup
else:
from distutils.core import setup
the_url = 'http://www.lexicon.net/sjmachin/xlrd.htm'
# Get version number without importing xlrd/__init__
# (this horrificness is needed while using 2to3 for
# python 3 compatibility, it should go away once
# we stop using that.)
sys.path.insert(0, path.join(path.dirname(__file__), 'xlrd'))
from info import __VERSION__
sys.path.pop(0)
def mkargs(**kwargs):
return kwargs
args = mkargs(
name = 'xlrd',
version = __VERSION__,
author = 'John Machin',
author_email = 'sjmachin@lexicon.net',
url = the_url,
packages = ['xlrd'],
scripts = [
'scripts/runxlrd.py',
],
description = 'Library for developers to extract data from Microsoft Excel (tm) spreadsheet files',
long_description = \
"Extract data from Excel spreadsheets (.xls and .xlsx, versions 2.0 onwards) on any platform. " \
"Pure Python (2.6 to 2.7). Strong support for Excel dates. Unicode-aware.",
platforms = ["Any platform -- don't need Windows"],
license = 'BSD',
keywords = ['xls', 'excel', 'spreadsheet', 'workbook'],
)
if python_version >= (2, 3):
args23 = mkargs(
download_url = the_url,
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Topic :: Database',
'Topic :: Office/Business',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
args.update(args23)
if python_version >= (2, 4):
args24 = mkargs(
package_data={
'xlrd': [
'doc/*.htm*',
# 'doc/*.txt',
'examples/*.*',
],
},
)
args.update(args24)
setup(**args)