|
1 | 1 | """
|
2 | 2 | Based entirely on Django's own ``setup.py``.
|
3 | 3 | """
|
4 |
| -import os |
5 |
| -from distutils.command.install import INSTALL_SCHEMES |
6 |
| -from distutils.core import setup |
| 4 | +from setuptools import setup |
| 5 | +from setuptools import find_packages |
7 | 6 |
|
8 | 7 | import tagging
|
9 | 8 |
|
| 9 | +setup( |
| 10 | + name='django-tagging', |
| 11 | + version=tagging.__version__, |
10 | 12 |
|
11 |
| -def fullsplit(path, result=None): |
12 |
| - """ |
13 |
| - Split a pathname into components (the opposite of os.path.join) in a |
14 |
| - platform-neutral way. |
15 |
| - """ |
16 |
| - if result is None: |
17 |
| - result = [] |
18 |
| - head, tail = os.path.split(path) |
19 |
| - if head == '': |
20 |
| - return [tail] + result |
21 |
| - if head == path: |
22 |
| - return result |
23 |
| - return fullsplit(head, [tail] + result) |
24 |
| - |
25 |
| -# Tell distutils to put the data_files in platform-specific installation |
26 |
| -# locations. See here for an explanation: |
27 |
| -# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb |
28 |
| -for scheme in INSTALL_SCHEMES.values(): |
29 |
| - scheme['data'] = scheme['purelib'] |
| 13 | + description='Generic tagging application for Django', |
| 14 | + long_description='\n'.join([open('README.rst').read(), |
| 15 | + open('CHANGELOG.txt').read()]), |
| 16 | + keywords='django, tag, tagging', |
30 | 17 |
|
31 |
| -# Compile the list of packages available, because distutils doesn't have |
32 |
| -# an easy way to do this. |
33 |
| -packages, data_files = [], [] |
34 |
| -root_dir = os.path.dirname(__file__) |
35 |
| -tagging_dir = os.path.join(root_dir, 'tagging') |
36 |
| -pieces = fullsplit(root_dir) |
37 |
| -if pieces[-1] == '': |
38 |
| - len_root_dir = len(pieces) - 1 |
39 |
| -else: |
40 |
| - len_root_dir = len(pieces) |
| 18 | + author=tagging.__author__, |
| 19 | + author_email=tagging.__author_email__, |
| 20 | + maintainer=tagging.__maintainer__, |
| 21 | + maintainer_email=tagging.__maintainer_email__, |
| 22 | + url=tagging.__url__, |
| 23 | + license=tagging.__license__, |
41 | 24 |
|
42 |
| -for dirpath, dirnames, filenames in os.walk(tagging_dir): |
43 |
| - # Ignore dirnames that start with '.' |
44 |
| - for i, dirname in enumerate(dirnames): |
45 |
| - if dirname.startswith('.'): del dirnames[i] |
46 |
| - if '__init__.py' in filenames: |
47 |
| - packages.append('.'.join(fullsplit(dirpath)[len_root_dir:])) |
48 |
| - elif filenames: |
49 |
| - data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]]) |
| 25 | + packages=find_packages(), |
| 26 | + include_package_data=True, |
| 27 | + zip_safe=False, |
50 | 28 |
|
51 |
| -setup( |
52 |
| - name = 'django-tagging', |
53 |
| - version = tagging.get_version(), |
54 |
| - description = 'Generic tagging application for Django', |
55 |
| - author = 'Jonathan Buchanan', |
56 |
| - author_email = '[email protected]', |
57 |
| - url = 'https://github.com/Fantomas42/django-tagging', |
58 |
| - packages = packages, |
59 |
| - data_files = data_files, |
60 |
| - classifiers = [ |
61 |
| - 'Development Status :: 4 - Beta', |
62 |
| - 'Environment :: Web Environment', |
| 29 | + classifiers=[ |
63 | 30 | 'Framework :: Django',
|
| 31 | + 'Environment :: Web Environment', |
| 32 | + 'Operating System :: OS Independent', |
| 33 | + 'Development Status :: 5 - Production/Stable', |
64 | 34 | 'Intended Audience :: Developers',
|
65 | 35 | 'License :: OSI Approved :: BSD License',
|
66 |
| - 'Operating System :: OS Independent', |
67 | 36 | 'Programming Language :: Python',
|
68 | 37 | 'Programming Language :: Python :: 2',
|
69 | 38 | 'Programming Language :: Python :: 2.6',
|
70 | 39 | 'Programming Language :: Python :: 2.7',
|
71 | 40 | 'Programming Language :: Python :: 3',
|
72 |
| - 'Programming Language :: Python :: 3.3', |
73 | 41 | 'Topic :: Utilities',
|
74 |
| - ], |
| 42 | + 'Topic :: Software Development :: Libraries :: Python Modules'] |
75 | 43 | )
|
0 commit comments