forked from django-pylibmc/django-pylibmc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
95 lines (81 loc) · 2.92 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
"""django-pylibmc packaging."""
from __future__ import unicode_literals
from codecs import open
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
import django_pylibmc
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import tox
errno = tox.cmdline(self.test_args)
sys.exit(errno)
def get_long_description(title):
"""Create the long_description from other files."""
ROOT = os.path.abspath(os.path.dirname(__file__))
readme = open(os.path.join(ROOT, 'README.rst'), 'r', 'utf8').read()
body_tag = ".. Omit badges from docs"
readme_body_start = readme.index(body_tag)
assert readme_body_start
readme_body = readme[readme_body_start + len(body_tag):]
changelog = open(os.path.join(ROOT, 'CHANGELOG.rst'), 'r', 'utf8').read()
old_tag = ".. Omit older changes from package"
changelog_body_end = changelog.index(old_tag)
assert changelog_body_end
changelog_body = changelog[:changelog_body_end]
bars = '=' * len(title)
long_description = """
%(bars)s
%(title)s
%(bars)s
%(readme_body)s
%(changelog_body)s
_(Older changes can be found in the full documentation)._
""" % locals()
return long_description
setup(
name='django-pylibmc',
version=django_pylibmc.__version__,
description='Django cache backend using pylibmc',
long_description=get_long_description('django-pylibmc'),
author='Jeff Balogh',
author_email='[email protected]',
url='https://github.com/django-pylibmc/django-pylibmc',
license='BSD',
packages=['django_pylibmc'],
include_package_data=True,
zip_safe=False,
install_requires=['pylibmc>=1.4.1'],
tests_require=['tox'],
cmdclass={'test': Tox},
keywords='django cache pylibmc memcached',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
# I don't know what exactly this means, but why not?
'Environment :: Web Environment :: Mozilla',
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development :: Libraries :: Python Modules',
]
)