Skip to content

Commit

Permalink
Merge branch 'feature/review-packaging' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed May 14, 2015
2 parents e911659 + c651526 commit c6348ad
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 108 deletions.
37 changes: 0 additions & 37 deletions MANIFEST

This file was deleted.

5 changes: 4 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ include INSTALL.txt
include LICENSE.txt
include MANIFEST.in
include README.rst
recursive-include docs *.txt
include versions.cfg
include buildout.cfg
include bootstrap.py
recursive-include docs *
recursive-include tagging/tests *.txt
78 changes: 23 additions & 55 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,75 +1,43 @@
"""
Based entirely on Django's own ``setup.py``.
"""
import os
from distutils.command.install import INSTALL_SCHEMES
from distutils.core import setup
from setuptools import setup
from setuptools import find_packages

import tagging

setup(
name='django-tagging',
version=tagging.__version__,

def fullsplit(path, result=None):
"""
Split a pathname into components (the opposite of os.path.join) in a
platform-neutral way.
"""
if result is None:
result = []
head, tail = os.path.split(path)
if head == '':
return [tail] + result
if head == path:
return result
return fullsplit(head, [tail] + result)

# Tell distutils to put the data_files in platform-specific installation
# locations. See here for an explanation:
# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']
description='Generic tagging application for Django',
long_description='\n'.join([open('README.rst').read(),
open('CHANGELOG.txt').read()]),
keywords='django, tag, tagging',

# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
tagging_dir = os.path.join(root_dir, 'tagging')
pieces = fullsplit(root_dir)
if pieces[-1] == '':
len_root_dir = len(pieces) - 1
else:
len_root_dir = len(pieces)
author=tagging.__author__,
author_email=tagging.__author_email__,
maintainer=tagging.__maintainer__,
maintainer_email=tagging.__maintainer_email__,
url=tagging.__url__,
license=tagging.__license__,

for dirpath, dirnames, filenames in os.walk(tagging_dir):
# Ignore dirnames that start with '.'
for i, dirname in enumerate(dirnames):
if dirname.startswith('.'): del dirnames[i]
if '__init__.py' in filenames:
packages.append('.'.join(fullsplit(dirpath)[len_root_dir:]))
elif filenames:
data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
packages=find_packages(),
include_package_data=True,
zip_safe=False,

setup(
name = 'django-tagging',
version = tagging.get_version(),
description = 'Generic tagging application for Django',
author = 'Jonathan Buchanan',
author_email = 'jonathan.buchanan@gmail.com',
url = 'https://github.com/Fantomas42/django-tagging',
packages = packages,
data_files = data_files,
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
classifiers=[
'Framework :: Django',
'Environment :: Web Environment',
'Operating System :: OS Independent',
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Utilities',
],
'Topic :: Software Development :: Libraries :: Python Modules']
)
22 changes: 7 additions & 15 deletions tagging/__init__.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
"""
Django-tagging
"""
VERSION = (0, 3, 6, 'final', 0)
__version__ = '0.4.dev0'
__license__ = 'BSD License'

__author__ = 'Jonathan Buchanan'
__author_email__ = 'jonathan.buchanan@gmail.com'

def get_version():
if VERSION[3] == 'final':
return '%s.%s.%s' % (VERSION[0], VERSION[1], VERSION[2])
elif VERSION[3] == 'dev':
if VERSION[2] == 0:
return '%s.%s.%s%s' % (VERSION[0], VERSION[1],
VERSION[3], VERSION[4])
return '%s.%s.%s.%s%s' % (VERSION[0], VERSION[1],
VERSION[2], VERSION[3], VERSION[4])
else:
return '%s.%s.%s%s' % (VERSION[0], VERSION[1],
VERSION[2], VERSION[3])
__maintainer__ = 'Fantomas42'
__maintainer_email__ = 'fantomas42@gmail.com'


__version__ = get_version()
__url__ = 'https://github.com/Fantomas42/django-tagging'


class AlreadyRegistered(Exception):
Expand Down

0 comments on commit c6348ad

Please sign in to comment.