forked from saxix/django-concurrency
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·74 lines (63 loc) · 2.46 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
#!/usr/bin/env python
import ast
import os
import re
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
init = os.path.join(ROOT, 'src', 'concurrency', '__init__.py')
_version_re = re.compile(r'__version__\s+=\s+(.*)')
_name_re = re.compile(r'NAME\s+=\s+(.*)')
with open(init, 'rb') as f:
content = f.read().decode('utf-8')
VERSION = str(ast.literal_eval(_version_re.search(content).group(1)))
NAME = str(ast.literal_eval(_name_re.search(content).group(1)))
base_url = 'https://github.com/saxix/django-concurrency/'
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['tests']
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
import sys
sys.path.insert(0, os.path.join(ROOT, 'tests', 'demoapp'))
errno = pytest.main(self.test_args)
sys.exit(errno)
setup(
name=NAME,
version=VERSION,
url='https://github.com/saxix/django-concurrency',
author='Stefano Apostolico',
author_email='[email protected]',
package_dir={'': 'src'},
packages=find_packages('src'),
include_package_data=True,
description='Optimistic lock implementation for Django. Prevents users from doing concurrent editing.',
long_description=open('README.rst').read(),
license='MIT License',
keywords='django',
setup_requires=['pytest-runner', ],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
],
# platforms=['any']
)