Permalink
Browse files

Prepare setup.py and MANIFEST for PyPI release

  • Loading branch information...
1 parent 002be27 commit 72fe53d0a3c2bf77cda2ad6ea8043c584514a57b @j4mie committed Jul 29, 2011
Showing with 26 additions and 1 deletion.
  1. +2 −0 MANIFEST.in
  2. +24 −1 setup.py
View
@@ -0,0 +1,2 @@
+include README.md
+include UNLICENSE
View
@@ -1,15 +1,38 @@
+import os
+import re
from setuptools import setup, find_packages
description = 'A Django template library for manipulating URLs.'
+rel_file = lambda *args: os.path.join(os.path.dirname(os.path.abspath(__file__)), *args)
+
+def read_from(filename):
+ fp = open(filename)
+ try:
+ return fp.read()
+ finally:
+ fp.close()
+
+def get_version():
+ data = read_from(rel_file('spurl', '__init__.py'))
+ return re.search(r"__version__ = '([^']+)'", data).group(1)
+
setup(
name='django-spurl',
- version='0.1',
+ version=get_version(),
description=description,
long_description=description,
author='Jamie Matthews',
author_email='jamie.matthews@gmail.com',
url='http://github.com/j4mie/django-spurl/',
packages=find_packages(),
install_requires=['urlobject==0.5.1'],
+ classifiers = [
+ 'Programming Language :: Python',
+ 'Development Status :: 3 - Alpha',
+ 'Intended Audience :: Developers',
+ 'License :: Public Domain',
+ 'Framework :: Django',
+ 'Operating System :: OS Independent',
+ ]
)

0 comments on commit 72fe53d

Please sign in to comment.