Skip to content

Commit c6348ad

Browse files
committed
Merge branch 'feature/review-packaging' into develop
2 parents e911659 + c651526 commit c6348ad

File tree

4 files changed

+34
-108
lines changed

4 files changed

+34
-108
lines changed

MANIFEST

Lines changed: 0 additions & 37 deletions
This file was deleted.

MANIFEST.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ include INSTALL.txt
33
include LICENSE.txt
44
include MANIFEST.in
55
include README.rst
6-
recursive-include docs *.txt
6+
include versions.cfg
7+
include buildout.cfg
8+
include bootstrap.py
9+
recursive-include docs *
710
recursive-include tagging/tests *.txt

setup.py

Lines changed: 23 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,43 @@
11
"""
22
Based entirely on Django's own ``setup.py``.
33
"""
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
76

87
import tagging
98

9+
setup(
10+
name='django-tagging',
11+
version=tagging.__version__,
1012

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',
3017

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__,
4124

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,
5028

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=[
6330
'Framework :: Django',
31+
'Environment :: Web Environment',
32+
'Operating System :: OS Independent',
33+
'Development Status :: 5 - Production/Stable',
6434
'Intended Audience :: Developers',
6535
'License :: OSI Approved :: BSD License',
66-
'Operating System :: OS Independent',
6736
'Programming Language :: Python',
6837
'Programming Language :: Python :: 2',
6938
'Programming Language :: Python :: 2.6',
7039
'Programming Language :: Python :: 2.7',
7140
'Programming Language :: Python :: 3',
72-
'Programming Language :: Python :: 3.3',
7341
'Topic :: Utilities',
74-
],
42+
'Topic :: Software Development :: Libraries :: Python Modules']
7543
)

tagging/__init__.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
"""
22
Django-tagging
33
"""
4-
VERSION = (0, 3, 6, 'final', 0)
4+
__version__ = '0.4.dev0'
5+
__license__ = 'BSD License'
56

7+
__author__ = 'Jonathan Buchanan'
8+
__author_email__ = '[email protected]'
69

7-
def get_version():
8-
if VERSION[3] == 'final':
9-
return '%s.%s.%s' % (VERSION[0], VERSION[1], VERSION[2])
10-
elif VERSION[3] == 'dev':
11-
if VERSION[2] == 0:
12-
return '%s.%s.%s%s' % (VERSION[0], VERSION[1],
13-
VERSION[3], VERSION[4])
14-
return '%s.%s.%s.%s%s' % (VERSION[0], VERSION[1],
15-
VERSION[2], VERSION[3], VERSION[4])
16-
else:
17-
return '%s.%s.%s%s' % (VERSION[0], VERSION[1],
18-
VERSION[2], VERSION[3])
10+
__maintainer__ = 'Fantomas42'
11+
__maintainer_email__ = '[email protected]'
1912

20-
21-
__version__ = get_version()
13+
__url__ = 'https://github.com/Fantomas42/django-tagging'
2214

2315

2416
class AlreadyRegistered(Exception):

0 commit comments

Comments
 (0)