-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
104 lines (78 loc) · 2.74 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
# -*- coding: utf-8 -*-
#! /usr/bin/env python3
from setuptools import setup, Command, find_packages
from setuptools.command.test import test as TestCommand
import os
import sys
import glob
import shutil
here = os.path.abspath(os.path.dirname(__file__))
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to 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
import multiprocessing
procs = multiprocessing.cpu_count()
if procs > 1:
if type(self.pytest_args) == list:
self.pytest_args.append("-n " + str(procs))
elif type(self.pytest_args) == str:
self.pytest_args += " -n " + str(procs)
errcode = pytest.main(self.pytest_args)
sys.exit(errcode)
class BetterClean(Command):
"""Custom clean command to remove other stuff from project root."""
user_options=[]
def initialize_options(self):
pass
def finalize_options(self):
pass
@staticmethod
def handle_remove_errors(*args):
print("Issue removing '" + args[1] + "' (probably does not exist), skipping...")
def run(self):
egg_info = glob.glob('*.egg-info')
for entry in egg_info:
print("removing " + entry)
shutil.rmtree(entry)
shutil.rmtree('build', onerror = BetterClean.handle_remove_errors)
shutil.rmtree('dist', onerror = BetterClean.handle_remove_errors)
#with open("README.md") as f:
# readme = f.read()
#with open("LICENSE") as f:
# license = f.read()
setup(
name="memento_test",
version="0.1.3",
description="A Memento Test Suite",
keywords="memento http test",
#long_description=readme,
author="Harihar Shankar",
author_email="hariharshankar@gmail.com",
url="https://github.com/mementoweb/memento_test",
#license=license,
zip_safe=False,
packages=find_packages(exclude=("tests", "docs")),
scripts=["bin/memento_test_server"],
include_package_data=True,
install_requires=["werkzeug>=0.12"],
test_requires=["pytest"],
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Scientific/Engineering',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4'
]
)