forked from vmlaker/mpipe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
68 lines (63 loc) · 2.39 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
"""Distutils file for MPipe."""
from distutils.core import setup, Command
import subprocess
import inspect
import shutil
import os
import sys
class Clean2(Command):
"""A more thorough clean command."""
description = 'clean everything generated by the build command'
user_options = []
def initialize_options(self): pass # Must override.
def finalize_options(self): pass # Must override.
def run(self):
to_remove = ('build','dist','MANIFEST',)
this_dir = os.path.dirname(inspect.getfile(inspect.currentframe()))
this_dir = os.path.normpath(this_dir)
for entry in os.listdir(this_dir):
if entry not in to_remove:
continue
entry = os.path.join(this_dir, entry)
print('erasing {0}'.format(entry))
if os.path.isfile(entry):
os.remove(entry)
elif os.path.isdir(entry):
shutil.rmtree(entry)
class Test(Command):
"""A custom test command."""
description = 'run custom test suite'
user_options = []
def initialize_options(self): pass # Must override.
def finalize_options(self): pass # Must override.
def run(self):
this_dir = os.path.dirname(inspect.getfile(inspect.currentframe()))
this_dir = os.path.normpath(this_dir)
args = os.path.join(this_dir, 'test', 'test.py')
command = '{0} {1}'.format(sys.executable, args)
print(command)
subprocess.call(command, shell=True)
from src import __version__
setup(
name = 'mpipe',
version = __version__,
description = 'Multiprocess pipeline toolkit',
url = 'http://vmlaker.github.io/mpipe',
author = 'Velimir Mlaker',
author_email = '[email protected]',
license = 'MIT',
long_description = open('README.rst').read(),
package_dir = {'mpipe' : 'src'},
packages = ['mpipe'],
cmdclass = { 'clean2' : Clean2, 'test' : Test, },
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: Freeware',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)