-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
73 lines (59 loc) · 2.1 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
import os
from setuptools import setup
import json
import glob
def readme():
with open('README.rst') as f:
return f.read()
def package_files(directory):
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
if filename.endswith("~"):
continue
paths.append(os.path.join(path, filename))
print( paths )
return paths
def get_version():
with open('version.json') as json_file:
data = json.load(json_file)
if 'dev' in data and data['dev']:
return "{}.{}.{}-dev{}".format( data['major'], data['minor'], data['patch'], data['dev'])
if 'rc' in data and data['rc']:
return "{}.{}.{}-rc{}".format( data['major'], data['minor'], data['patch'], data['rc'])
return "{}.{}.{}".format( data['major'], data['minor'], data['patch'])
def get_requirements():
file_handle = open('requirements.txt', 'r')
data = file_handle.read()
file_handle.close()
print( f"Requiremnents:\n{data}" )
# print( data.split("\n"))
return data.split("\n")
# return "{}.{}.{}".format( data['major'], data['minor'], data['patch'])
def get_scripts(directory='bin') -> list:
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
if filename.endswith("~") or filename.endswith("__"):
continue
paths.append(os.path.join(path, filename))
print( paths )
return paths
return glob.glob( directory )
setup(name='cromwell-utils',
version= get_version(),
description='python utils and tools collection',
url='https://github.com/neuromics/cromwell-utils/',
author='Kim Brugger',
author_email='[email protected]',
license='MIT',
packages=['cromwell'],
install_requires=get_requirements(),
classifiers=[
"Development Status :: {}".format( get_version()),
'License :: MIT License',
'Programming Language :: Python :: 3'
],
scripts=get_scripts(),
include_package_data=True,
zip_safe=False)