-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
90 lines (75 loc) · 2.59 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
"""
A script to setup the package.
Created on Fri Mar 11 11:27:39 2016
@author: dangeles
"""
# -*- coding: utf-8 -*-
from distutils.core import setup
from setuptools import setup, find_packages
import os
import sys
version = '0.17.6'
# just type in python setup.py publish and
# this takes care of publishing to pypi!
# tag with git
if sys.argv[1] == 'tag':
if len(sys.argv) > 2:
if sys.argv[2] == '-m':
print(sys.argv[2])
print('please input your commit message')
message = sys.stdin.readline().strip()
print("git tag -a %s -m '%s'" % (version, message))
os.system("git tag -a %s -m '%s'" % (version, message))
else:
os.system("git tag -a %s -m 'version %s'" % (version, version))
os.system("git push --tags")
sys.exit()
# publish to pypi
if sys.argv[-1] == 'publish':
os.system("python setup.py sdist upload")
os.system("python setup.py bdist_wheel upload")
# print("You probably want to also tag the version now:")
# print(" git tag -a %s -m 'version %s'" % (version, version))
# print(" git push --tags")
sys.exit()
# for pytest.py purposes -- just type in python setup.py test!
if sys.argv[-1] == 'test':
test_requirements = [
'pytest',
'flake8',
'coverage'
]
try:
modules = map(__import__, test_requirements)
except ImportError as e:
err_msg = e.message.replace("No module named ", "")
msg = "%s is not installed. Install your test requirements." % err_msg
raise ImportError(msg)
os.system('py.test')
sys.exit()
# Below this point is the rest of the setup() function
def readme():
"""A function to open a readme.rst file."""
with open('README.rst') as f:
return f.read()
setup(
name='tissue_enrichment_analysis',
packages=find_packages(exclude=("tests",)),
version=version,
description='This package contains all the software used to implement\
TEA in WormBase and remotely',
author='David Angeles-Albores',
author_email='dangeles@caltech.edu',
url='https://github.com/dangeles/TissueEnrichmentAnalysis', # github repo
download_url='https://github.com/dangeles/TissueEnrichmentAnalysis/tarball/{0}'.format(version),
keywords=['tissue enrichment analysis', 'TEA',
'RNAseq', 'celegans', 'biology'], # arbitrary keywords
install_requires=[
'matplotlib', 'scipy', 'numpy', 'pandas', 'seaborn'
],
classifiers=['License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.5'
],
licenses='MIT',
scripts=['bin/tea']
)