@@ -5,63 +5,80 @@ except ImportError:
5
5
use_setuptools()
6
6
from setuptools import setup, find_packages
7
7
8
- with open("README.rst", 'r') as readme:
9
- README_txt = readme.read()
10
-
11
- with open("CHANGELOG.rst", 'r') as changelog:
12
- README_txt += changelog.read()
8
+ NAME = '{{name}}'
9
+ AUTHOR = '{{author}}'
10
+ VERSION = '{{version}}'
11
+ EMAIL = '{{contact}}'
12
+ LICENSE = '{{license}}'
13
+ PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])
14
+ DESCRIPTION = '{{description}}'
15
+ KEYWORDS = [
16
+ 'excel',
17
+ 'python',
18
+ 'pyexcel',
19
+ {%block additional_keywords%}
20
+ {%endblock%}
21
+ ]
13
22
14
- dependencies = [
23
+ INSTALL_REQUIRES = [
15
24
{% for dependency in dependencies: %}
16
25
'{{dependency}}',
17
26
{% endfor %}
18
27
]
19
28
20
29
{% if extra_dependencies: %}
21
- extras = {
30
+ EXTRAS_REQUIRE = {
22
31
{% for dependency in extra_dependencies: %}
23
32
{% for key, value in dependency.items(): %}
24
33
'{{key}}': {{value}},
25
34
{% endfor %}
26
35
{% endfor %}
27
36
}
28
37
{% else: %}
29
- extras = {}
38
+ EXTRAS_REQUIRE = {}
30
39
{% endif %}
31
40
32
- {%block extras %}
33
- {%endblock %}
41
+ CLASSIFIERS = [
42
+ 'Topic :: Office/Business',
43
+ 'Topic :: Utilities',
44
+ 'Topic :: Software Development :: Libraries',
45
+ 'Programming Language :: Python',
46
+ 'License :: OSI Approved :: BSD License',
47
+ 'Intended Audience :: Developers',
48
+ {%block additional_classifiers%}
49
+ {%endblock %}
50
+ ]
51
+
52
+
53
+ def read_files(*files):
54
+ """Read files into setup"""
55
+ text = ""
56
+ for single_file in files:
57
+ text = text + read(single_file) + "\n"
58
+ return text
59
+
60
+
61
+ def read(afile):
62
+ """Read a file into setup"""
63
+ with open(afile, 'r') as opened_file:
64
+ return opened_file.read()
65
+
34
66
35
- setup(
36
- name='{{name}}',
37
- author='{{author}}',
38
- version='{{version}}',
39
- author_email='{{contact}}',
40
- url='https://github.com/{{organisation}}/{{name}}',
41
- description='{{description}}',
42
- install_requires=dependencies,
43
- extras_require=extras,
44
- packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
45
- include_package_data=True,
46
- long_description=README_txt,
47
- zip_safe=False,
48
- tests_require=['nose'],
49
- keywords=[
50
- 'excel',
51
- 'python',
52
- 'pyexcel',
53
- {%block additional_keywords%}
54
- {%endblock%}
55
- ],
56
- license='{{license}}',
57
- classifiers=[
58
- 'Topic :: Office/Business',
59
- 'Topic :: Utilities',
60
- 'Topic :: Software Development :: Libraries',
61
- 'Programming Language :: Python',
62
- 'License :: OSI Approved :: BSD License',
63
- 'Intended Audience :: Developers',
64
- {%block additional_classifiers%}
65
- {%endblock %}
66
- ]
67
- )
67
+ if __name__ == '__main__':
68
+ setup(
69
+ name=NAME,
70
+ author=AUTHOR,
71
+ version=VERSION,
72
+ author_email=EMAIL,
73
+ description=DESCRIPTION,
74
+ install_requires=INSTALL_REQUIRES,
75
+ keywords=KEYWORDS,
76
+ extras_require=EXTRAS_REQUIRE,
77
+ packages=PACKAGES,
78
+ include_package_data=True,
79
+ long_description=read_files('README.rst', 'CHANGELOG.rst'),
80
+ zip_safe=False,
81
+ tests_require=['nose'],
82
+ license=LICENSE,
83
+ classifiers=CLASSIFIERS
84
+ )
0 commit comments