-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·83 lines (66 loc) · 2.6 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·83 lines (66 loc) · 2.6 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
#!/usr/bin/env python
# coding=utf-8
import os
import sys
from setuptools import setup, Command
from setuptools.command.test import test as TestCommand
from setuptools import find_packages
import python_bootstrap
class BootstrapTest(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)
sys.exit(errno)
class BootstrapClean(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system('rm -vrf ./.cache ./.eggs ./build ./dist')
os.system('rm -vrf ./*.tgz ./*.egg-info')
os.system('find . -name "*.pyc" -exec rm -vrf {} \;')
os.system('find . -name "__pycache__" -exec rm -rf {} \;')
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme_file:
README = readme_file.read()
with open(os.path.join(os.path.dirname(__file__), 'LICENSE')) as license_file:
LICENSE = license_file.read()
if __name__ == "__main__":
setup(name="python-project-bootstrap",
version=python_bootstrap.__version__,
description="Start your new python project with a ready to install"
"directory and scripts structure",
author="Ricardo Oyarzun",
author_email="royarzun@gmail.com",
url="https://github.com/royarzun/Python-project-bootstrap",
license=LICENSE,
long_description=README,
test_suite="tests",
tests_require=['pytest'],
cmdclass={
'test': BootstrapTest,
'clean': BootstrapClean,
},
include_package_data=True,
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*"]),
package_dir={"python-bootstrap": "python-bootstrap"},
classifiers=(
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
),
scripts=["python_bootstrap/scripts/python_project"],)