-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
executable file
·127 lines (103 loc) · 3.76 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import distutils
import subprocess
from os.path import dirname, join
from setuptools import find_packages, setup
from setuptools.command.sdist import sdist
from wheel.bdist_wheel import bdist_wheel
def read(*args, **kwargs):
return open(join(dirname(__file__), *args), **kwargs).read()
class ToxTestCommand(distutils.cmd.Command):
"""Distutils command to run tests via tox with 'python setup.py test'.
Please note that in our standard configuration tox uses the dependencies in
`requirements/dev.txt`, the list of dependencies in `tests_require` in
`setup.py` is ignored!
See https://docs.python.org/3/distutils/apiref.html#creating-a-new-distutils-command
for more documentation on custom distutils commands.
"""
description = "Run tests via 'tox'."
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
self.announce("Running tests with 'tox'...", level=distutils.log.INFO)
return subprocess.call(['tox'])
def run_wrapper(self):
"""
Wrapper around the `run` method of distutils or setuptools commands.
The method creates the Javascript bundle file before the `run` method of the superclass is run.
"""
self.announce("Creating the javascript bundle file...", level=distutils.log.INFO)
return_code = subprocess.call(['npm', 'run', 'build'])
if return_code != 0:
msg = "Error creating the javascript bundle file. Command exited with return code {}".format(return_code)
self.announce(msg, level=distutils.log.ERROR)
raise RuntimeError(msg)
super(self.__class__, self).run()
def command_factory(name, base_class):
"""Factory method to create a distutils or setuptools command with a patched `run` method."""
return type(str(name), (base_class, object), {'run': run_wrapper})
exec(read('planning_poker', 'version.py'))
classifiers = """\
Development Status :: 5 - Production/Stable
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 3.0
Framework :: Django :: 3.1
Framework :: Django :: 3.2
Intended Audience :: Developers
Intended Audience :: End Users/Desktop
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: JavaScript
Programming Language :: Python
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Internet
"""
install_requires = [
'channels>=3',
'Django>=3',
'django-channels-presence>=1',
]
tests_require = [
'coverage',
'flake8',
'pydocstyle',
'pylint',
'pytest-asyncio',
'pytest-django',
'pytest-cov',
'pytest-pythonpath',
'pytest',
]
setup(
name='planning-poker',
version=__version__, # noqa
description='A Django app which allows teams to perform a remote planning poker session',
long_description=read('README.rst', encoding='utf-8'),
author='Rheinwerk Webteam',
author_email='webteam@rheinwerk-verlag.de',
maintainer='Rheinwerk Verlag GmbH Webteam',
maintainer_email='webteam@rheinwerk-verlag.de',
url='https://github.com/rheinwerk-verlag/planning-poker',
license='BSD-3-Clause',
classifiers=[c.strip() for c in classifiers.splitlines()
if c.strip() and not c.startswith('#')],
packages=find_packages(include=['planning_poker*']),
include_package_data=True,
test_suite='tests',
install_requires=install_requires,
tests_require=tests_require,
cmdclass={
'test': ToxTestCommand,
'sdist': command_factory('SDistCommand', sdist),
'bdist_wheel': command_factory('BDistWheelCommand', bdist_wheel),
}
)