forked from cookiecutter/cookiecutter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·106 lines (88 loc) · 3.08 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
#!/usr/bin/env python
import os
import sys
try:
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
version = "1.0.0"
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.exit()
if sys.argv[-1] == 'tag':
os.system("git tag -a %s -m 'version %s'" % (version, version))
os.system("git push --tags")
sys.exit()
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = ['binaryornot>=0.2.0', 'jinja2>=2.7', 'PyYAML>=3.10', 'click<4.0']
test_requirements = ['pytest']
# Add Python 2.6-specific dependencies
if sys.version_info[:2] < (2, 7):
requirements.append('ordereddict')
requirements.append('simplejson')
test_requirements.append('unittest2')
# Add Python 2.6 and 2.7-specific dependencies
if sys.version < '3':
requirements.append('mock')
# There are no Python 3-specific dependencies to add
long_description = readme + '\n\n' + history
if sys.argv[-1] == 'readme':
print(long_description)
sys.exit()
class PyTest(Command):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
self.pytest_args = []
def finalize_options(self):
pass
def run(self):
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup(
name='cookiecutter',
version=version,
description=('A command-line utility that creates projects from project '
'templates, e.g. creating a Python package project from a Python '
'package project template.'),
long_description=long_description,
author='Audrey Roy',
author_email='audreyr@gmail.com',
url='https://github.com/audreyr/cookiecutter',
packages=[
'cookiecutter',
],
package_dir={'cookiecutter': 'cookiecutter'},
entry_points={
'console_scripts': [
'cookiecutter = cookiecutter.cli:main',
]
},
include_package_data=True,
install_requires=requirements,
license='BSD',
zip_safe=False,
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development',
],
keywords='cookiecutter, Python, projects, project templates, Jinja2, \
skeleton, scaffolding, project directory, setup.py, package, packaging',
cmdclass = {'test': PyTest},
test_suite='tests',
tests_require=test_requirements
)