diff --git a/demo/README b/demo/README.rst similarity index 95% rename from demo/README rename to demo/README.rst index 73d11cc..dc9a78d 100644 --- a/demo/README +++ b/demo/README.rst @@ -10,7 +10,7 @@ Demo project Documentation includes code from the demo ***************************************** -Almost every example in this documentation comes from the demo: +Almost every example in the documentation comes from the demo: * discover examples in the documentation; * browse related code and tests in demo project. diff --git a/demo/setup.py b/demo/setup.py index 40122f7..810b219 100644 --- a/demo/setup.py +++ b/demo/setup.py @@ -1,46 +1,47 @@ -# coding=utf-8 +# -*- coding: utf-8 -*- """Python packaging.""" import os + from setuptools import setup -def read_relative_file(filename): - """Returns contents of the given file, which path is supposed relative - to this module.""" - with open(os.path.join(os.path.dirname(__file__), filename)) as f: - return f.read() +here = os.path.abspath(os.path.dirname(__file__)) +project_root = os.path.dirname(here) NAME = 'django-downloadview-demo' -README = read_relative_file('README') -VERSION = '0.1' +DESCRIPTION = 'Serve files with Django and reverse-proxies.' +README = open(os.path.join(here, 'README.rst')).read() +VERSION = open(os.path.join(project_root, 'VERSION')).read().strip() +AUTHOR = u'BenoƮt Bryon' +EMAIL = u'benoit@marmelune.net' +URL = 'https://{name}.readthedocs.org/'.format(name=NAME) +CLASSIFIERS = ['Development Status :: 4 - Beta', + 'License :: OSI Approved :: BSD License', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 2.6', + 'Framework :: Django'] +KEYWORDS = [] PACKAGES = ['demoproject'] -REQUIRES = ['django-downloadview', - 'django-nose'] +REQUIREMENTS = ['django-downloadview', 'django-nose'] +ENTRY_POINTS = { + 'console_scripts': ['demo = demoproject.manage:main'] +} -setup(name=NAME, - version=VERSION, - description='Demo project for Django-DownloadView.', - long_description=README, - classifiers=['Development Status :: 1 - Planning', - 'License :: OSI Approved :: BSD License', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 2.6', - 'Framework :: Django', - ], - keywords='class-based view, generic view, download', - author='Benoit Bryon', - author_email='benoit@marmelune.net', - url='https://github.com/benoitbryon/%s' % NAME, - license='BSD', - packages=PACKAGES, - include_package_data=True, - zip_safe=False, - install_requires=REQUIRES, - entry_points={ - 'console_scripts': [ - 'demo = demoproject.manage:main', - ] - }, - ) +if __name__ == '__main__': # Don't run setup() when we import this module. + setup(name=NAME, + version=VERSION, + description=DESCRIPTION, + long_description=README, + classifiers=CLASSIFIERS, + keywords=' '.join(KEYWORDS), + author=AUTHOR, + author_email=EMAIL, + url=URL, + license='BSD', + packages=PACKAGES, + include_package_data=True, + zip_safe=False, + install_requires=REQUIREMENTS, + entry_points=ENTRY_POINTS) diff --git a/docs/demo.txt b/docs/demo.txt index e5dd96e..9fdd6d7 100644 --- a/docs/demo.txt +++ b/docs/demo.txt @@ -1 +1 @@ -.. include:: ../demo/README +.. include:: ../demo/README.rst