|
1 import os |
|
2 import sys |
|
3 |
|
4 from setuptools import setup, find_packages |
|
5 |
|
6 # Dynamically calculate the version based on django.VERSION. |
|
7 version = __import__('renkanmanager').get_version() |
|
8 |
|
9 def launch_setup(script_name, script_args): |
|
10 |
|
11 |
|
12 data_files = [] |
|
13 |
|
14 root_dir = os.path.dirname(__file__) |
|
15 if root_dir != '': |
|
16 os.chdir(root_dir) |
|
17 source_dir = 'renkanmanager' |
|
18 |
|
19 |
|
20 for dirpath, dirnames, filenames in os.walk(source_dir): |
|
21 # Ignore dirnames that start with '.' |
|
22 for i, dirname in enumerate(dirnames): |
|
23 if dirname.startswith('.'): del dirnames[i] |
|
24 if filenames and '__init__.py' not in filenames: |
|
25 data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]]) |
|
26 |
|
27 #write MANIFEST.in |
|
28 |
|
29 with open("MANIFEST.in", "w") as m: |
|
30 m.write("include MANIFEST.in\n") |
|
31 for entry in data_files: |
|
32 file_list = entry[1] |
|
33 for filename in file_list: |
|
34 m.write("include %s\n" % (filename)) |
|
35 |
|
36 setup( |
|
37 script_name = script_name, |
|
38 script_args = script_args, |
|
39 name='renkanmanager', |
|
40 version=version, |
|
41 url='http://renkan.iri-research.org/', |
|
42 author='I.R.I.', |
|
43 author_email='contact@iri-research.org', |
|
44 description=('Basic Django module for saving renkan'), |
|
45 license='CECILL-B', |
|
46 packages=find_packages(), |
|
47 include_package_data=True, |
|
48 zip_safe=False, |
|
49 classifiers=[ |
|
50 'Development Status :: 3 - Alpha', |
|
51 'Environment :: Web Environment', |
|
52 'Framework :: Django', |
|
53 'Intended Audience :: Developers', |
|
54 'License :: OSI Approved :: CECILL License', |
|
55 'Operating System :: OS Independent', |
|
56 'Programming Language :: Python', |
|
57 'Programming Language :: Python :: 2', |
|
58 'Programming Language :: Python :: 2.7', |
|
59 'Topic :: Internet :: WWW/HTTP', |
|
60 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', |
|
61 'Topic :: Internet :: WWW/HTTP :: WSGI', |
|
62 'Topic :: Software Development :: Libraries :: Python Modules', |
|
63 ], |
|
64 ) |
|
65 |
|
66 if __name__ == "__main__": |
|
67 |
|
68 script_name = os.path.basename(sys.argv[0]) |
|
69 script_args = sys.argv[1:] |
|
70 |
|
71 launch_setup(script_name, script_args) |