1import os 2import re 3import codecs 4from setuptools import setup, find_packages 5 6 7def read(*parts): 8 filename = os.path.join(os.path.dirname(__file__), *parts) 9 with codecs.open(filename, encoding='utf-8') as fp: 10 return fp.read() 11 12 13def find_version(*file_paths): 14 version_file = read(*file_paths) 15 version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", 16 version_file, re.M) 17 if version_match: 18 return version_match.group(1) 19 raise RuntimeError("Unable to find version string.") 20 21 22setup( 23 name='django-constance', 24 version=find_version("constance", "__init__.py"), 25 url="https://github.com/jazzband/django-constance", 26 description='Django live settings with pluggable backends, including Redis.', 27 long_description=read('README.rst'), 28 author='Jannis Leidel', 29 author_email='jannis@leidel.info', 30 license='BSD', 31 keywords='django libraries settings redis'.split(), 32 platforms=['any'], 33 classifiers=[ 34 'Development Status :: 5 - Production/Stable', 35 'Environment :: Web Environment', 36 'Framework :: Django', 37 'Framework :: Django :: 2.2', 38 'Framework :: Django :: 3.0', 39 'Framework :: Django :: 3.1', 40 'Intended Audience :: Developers', 41 'License :: OSI Approved :: BSD License', 42 'Natural Language :: English', 43 'Operating System :: OS Independent', 44 'Programming Language :: Python', 45 'Programming Language :: Python :: 3', 46 'Programming Language :: Python :: 3.6', 47 'Programming Language :: Python :: 3.7', 48 'Programming Language :: Python :: 3.8', 49 'Programming Language :: Python :: 3.9', 50 'Programming Language :: Python :: 3 :: Only', 51 'Programming Language :: Python :: Implementation :: CPython', 52 'Programming Language :: Python :: Implementation :: PyPy', 53 'Topic :: Utilities', 54 ], 55 packages=find_packages(exclude=['tests', 'tests.*']), 56 include_package_data=True, 57 zip_safe=False, 58 python_requires='>=3.6', 59 extras_require={ 60 'database': ['django-picklefield'], 61 'redis': ['redis'], 62 }, 63 entry_points={ 64 'pytest11': [ 65 'pytest-django-constance = constance.test.pytest', 66 ], 67 }, 68) 69