diff --git a/MANIFEST.in b/MANIFEST.in index 2f1ad105..8e568c21 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,3 @@ recursive-include survey * +include readme.md +include requirements*txt diff --git a/setup.py b/setup.py index 879a4425..47f7b953 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,17 @@ -import os import sys +from os import path -from setuptools import find_packages, setup - -ROOT = os.path.abspath(os.path.dirname(__file__)) +import setuptools if sys.version_info < (3, 0): sys.exit('Sorry, Python < 3.0 is not supported') +description = "A django survey app, based on and compatible with " +"\"django-survey\". You will be able to migrate your data from an ancient " +"version of django-survey, but it has been ported to python 3 and you can " +"export results as CSV or PDF using your native language." + def add_package(package_list, package): package = package.replace("\n", "").split("#")[0] @@ -16,20 +19,30 @@ def add_package(package_list, package): package_list.append(package) -setup( +this_directory = path.abspath(path.dirname(__file__)) +with open(path.join(this_directory, 'readme.md'), encoding='utf-8') as f: + long_description = f.read() + +with open("requirements.txt", "r") as fh: + require = fh.readlines() +require = [x.strip() for x in require] + +with open("requirements_dev.txt", "r") as fh: + extras_require = fh.readlines() +# Remove the first two line (-r requirements.txt and a blank line) +extras_require = {'dev': [x.strip() for x in extras_require[2:]]} + +setuptools.setup( name="django-survey-and-report", - version="1.3.0", - description="A django survey app, based on and compatible with " -"\"django-survey\". You will be able to migrate your data from an ancient " -"version of django-survey, but it has been ported to python 3 and you can " -"export results as CSV or PDF using your native language.", - long_description=open(os.path.join(ROOT, 'readme.md')).read(), + version="1.3.1", + description=description, + long_description=long_description, long_description_content_type="text/markdown", author="Pierre SASSOULAS", author_email="pierre.sassoulas@gmail.com", license="AGPL", url="https://github.com/Pierre-Sassoulas/django-survey", - packages=find_packages(), + packages=setuptools.find_packages(), include_package_data=True, classifiers=[ "Development Status :: 5 - Production/Stable", @@ -44,12 +57,6 @@ def add_package(package_list, package): 'Programming Language :: Python :: 3', "Framework :: Django", ], - install_requires=[ - "Django", "django-bootstrap-form", "django-tastypie", - "django-registration", "pytz", "future", "ordereddict", "PyYAML", - "matplotlib", "seaborn", "numpy" - ], - extras_require={ - 'dev': ["django-rosetta", "pylint", "coverage", "mock"], - }, + install_requires=require, + extras_require=extras_require, )