-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
64 lines (52 loc) · 1.83 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
import re
import os
from setuptools import setup
from setuptools.command.test import test as TestCommand
def get_version(filepath):
with open(filepath) as f:
match = re.search("__version__ = '(.*?)'", f.read(8192))
if not match:
raise RuntimeError('Could not find version.')
version = match.group(1)
return version
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.pytest_args)
raise SystemExit(errno)
version = get_version(os.path.join('caching', '__init__.py'))
setup(
name='caching',
version=version,
packages=['caching'],
author='bofm',
author_email='bofm@github.com',
description=(
'Python utils and decorators for cаching with TTL, '
'maxsize and file-based storage.'
),
long_description=open('README.rst').read(),
url='https://github.com/bofm/python-caching',
download_url='https://github.com/bofm/python-caching/tarball/%s' % version,
keywords=['cache', 'caching'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
tests_require=['pytest'],
cmdclass={'test': PyTest},
)