-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
121 lines (101 loc) · 3.04 KB
/
Copy pathsetup.py
File metadata and controls
121 lines (101 loc) · 3.04 KB
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
DESCRIPTION = 'Python Project Management Tool to Simplify teammate Py Life'
URL = 'https://github.com/chuter/pycake'
EMAIL = 'topgun.chuter@gmail.com'
AUTHOR = 'chuter'
VERSION = None
REQUIRED = [
'click',
'crayons',
'cookiecutter'
]
TEST_REQUIREMENTS = [
'click',
'pytest-cov',
'pytest-mock',
'pytest-xdist',
'pytest==3.9.2'
]
here = os.path.abspath(os.path.dirname(__file__))
src = os.path.join(here, 'src')
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
try:
from multiprocessing import cpu_count
self.pytest_args = ['-n', str(cpu_count())]
except (ImportError, NotImplementedError):
self.pytest_args = ['-n', '1']
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)
sys.exit(errno)
if sys.argv[-1] == 'publish':
os.system('python3 setup.py sdist')
os.system('twine upload dist/*')
sys.exit()
with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = '\n' + f.read()
meta = {}
if VERSION is None:
with open(os.path.join(src, 'pycake', 'meta.py')) as f:
exec(f.read(), meta)
else:
meta['__version__'] = VERSION
setup(
name=meta['__name__'],
version=meta['__version__'],
description=DESCRIPTION,
license='BSD',
long_description=long_description,
author=AUTHOR,
author_email=EMAIL,
url=URL,
packages=find_packages('src'),
python_requires=">=3.4",
package_dir={'': 'src'},
install_requires=REQUIRED,
include_package_data=True,
zip_safe=False,
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: Chinese (Simplified)',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development',
],
keywords=[
'python', 'develop', 'starter', 'manage tool', 'lifecycle'
],
entry_points={
'console_scripts': [
'pycake=pycake:cli',
'py.cake=pycake:cli',
],
},
cmdclass={'test': PyTest},
tests_require=TEST_REQUIREMENTS,
setup_requires=['pytest-runner'],
extras_require={
'dev': ['check-manifest'],
'test': ['coverage'],
},
)