From c4d800ef326b1e5b571a41d5f6258f15d2652b79 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 2 Jun 2011 12:17:21 +0100 Subject: [PATCH] proper manifest. setup groks version from __init__ --- MANIFEST.in | 5 +++++ djangorestframework/__init__.py | 4 +++- setup.py | 17 +++++++++-------- 3 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 000000000..fc9ce9769 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include djangorestframework/static *.ico *.txt +recursive-include djangorestframework/templates *.txt *.html +recursive-include examples .keep *.py *.txt +recursive-include docs *.py *.rst *.html *.txt +include AUTHORS LICENSE requirements.txt tox.ini diff --git a/djangorestframework/__init__.py b/djangorestframework/__init__.py index 522771b5b..f85a516e5 100644 --- a/djangorestframework/__init__.py +++ b/djangorestframework/__init__.py @@ -1 +1,3 @@ -VERSION="0.1.1" +__version__ = '0.1.1' + +VERSION = __version__ # synonym diff --git a/setup.py b/setup.py index 1aa6e1908..2ee0628ca 100644 --- a/setup.py +++ b/setup.py @@ -3,13 +3,19 @@ from setuptools import setup +import os, re + +path = os.path.join(os.path.dirname(__file__), 'djangorestframework', '__init__.py') +init_py = open(path).read() +VERSION = re.match("__version__ = '([^']+)'", init_py).group(1) + setup( - name = "djangorestframework", - version = "0.1", + name = 'djangorestframework', + version = VERSION, url = 'https://bitbucket.org/tomchristie/django-rest-framework/wiki/Home', download_url = 'https://bitbucket.org/tomchristie/django-rest-framework/downloads', license = 'BSD', - description = "A lightweight REST framework for Django.", + description = 'A lightweight REST framework for Django.', author = 'Tom Christie', author_email = 'tom@tomchristie.com', packages = ['djangorestframework', @@ -30,8 +36,3 @@ setup( 'Topic :: Internet :: WWW/HTTP', ] ) - -import os, shutil -shutil.rmtree(os.path.join(os.path.dirname(__file__), 'djangorestframework.egg-info'), True) - -