-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
113 lines (98 loc) · 3.7 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
107
108
109
110
111
112
113
#!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# Copyright (C) University of Manchester 2011
# Julian Selley <[email protected]>
################################################################################
"""
Proteomics module setup
=======================
This module setup's the package for installation -- it implements the distutils
of python.
"""
# Metadata
__version__ = '0.1.0'
__author__ = 'Julian Selley <[email protected]>'
__copyright__ = 'Copyright 2012 University of Manchester, Julian Selley <[email protected]>'
__license__ = 'The Artistic License 2.0 (see the file LICENSE included with the distribution)'
# Imports
from __init__ import __version__
from distutils.core import setup, Command
from unittest import TextTestRunner, TestLoader
from glob import glob
from os.path import splitext, basename, join as pjoin, walk
import os
class TestCommand(Command):
user_options = [ ]
def initialize_options(self):
self._dir = os.getcwd()
def finalize_options(self):
pass
def run(self):
'''
Finds all the tests modules in tests/, and runs them.
'''
testfiles = [ ]
for t in glob(pjoin(self._dir, 'tests', '*.py')):
if not t.endswith('__init__.py'):
testfiles.append('.'.join(
['tests', splitext(basename(t))[0]])
)
tests = TestLoader().loadTestsFromNames(testfiles)
t = TextTestRunner(verbosity = 1)
t.run(tests)
class CleanCommand(Command):
user_options = [ ]
def initialize_options(self):
self._clean_me = [ ]
for root, dirs, files in os.walk('.'):
for f in files:
if f.endswith('.pyc'):
self._clean_me.append(pjoin(root, f))
def finalize_options(self):
pass
def run(self):
for clean_me in self._clean_me:
try:
os.unlink(clean_me)
except:
pass
setup(name = 'proteomics',
version = __version__,
description = 'A library of Proteomic class and methods',
long_description = 'A library of Proteomic class and methods',
author = 'Julian Selley',
author_email = '[email protected]',
maintainer = 'Julian Selley',
maintainer_email = '[email protected]',
url = 'http://fls-bioinformatics-core.github.com/proteomics-python2.7-proteomics-lib/',
license = 'The Artistic License 2.0',
#install_requires = [],
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Artistic License',
'Programming Language :: Python :: 2.7',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
],
packages = ['proteomics'],
package_dir = {'proteomics' : '.'},
package_data = {'' : ['README.md', 'CHANGES', 'epydoc.conf', 'LICENSE', 'INSTALL']},
#data_files = [('config', ['epydoc.conf']),],
cmdclass = {'test': TestCommand, 'clean': CleanCommand},
#entry_points = {'' : [''],},
)
# patch distutils if it can't cope with the "classifiers" or
# "download_url" keywords
from sys import version
if version < '2.2.3':
from distutils.dist import DistributionMetadata
DistributionMetadata.classifiers = None
DistributionMetadata.download_url = None