forked from datirium/workflows
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
130 lines (107 loc) · 4.4 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#! /usr/bin/env python3
"""
****************************************************************************
Copyright (C) 2018 Datirium. LLC.
All rights reserved.
Contact: Datirium, LLC ([email protected])
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
****************************************************************************"""
from setuptools import setup
from os import symlink, path
from subprocess import check_output, CalledProcessError
from time import strftime, gmtime
from setuptools.command.egg_info import egg_info
import pkg_resources
SETUP_DIR = path.dirname(__file__)
README = path.join(SETUP_DIR, 'README.md')
SETUPTOOLS_VER = pkg_resources.get_distribution(
"setuptools").version.split('.')
RECENT_SETUPTOOLS = int(SETUPTOOLS_VER[0]) > 40 or (
int(SETUPTOOLS_VER[0]) == 40 and int(SETUPTOOLS_VER[1]) > 0) or (
int(SETUPTOOLS_VER[0]) == 40 and int(SETUPTOOLS_VER[1]) == 0 and
int(SETUPTOOLS_VER[2]) > 0)
class EggInfoFromGit(egg_info):
"""Tag the build with git commit timestamp.
If a build tag has already been set (e.g., "egg_info -b", building
from source package), leave it alone.
"""
def git_timestamp_tag(self):
gitinfo = check_output(
['git', 'log', '--first-parent', '--max-count=1',
'--format=format:%ct', '.']).strip()
return strftime('.%Y%m%d%H%M%S', gmtime(int(gitinfo)))
def tags(self):
if self.tag_build is None:
try:
self.tag_build = self.git_timestamp_tag()
except CalledProcessError:
pass
return egg_info.tags(self)
if RECENT_SETUPTOOLS:
vtags = property(tags)
tagger = EggInfoFromGit
setup(
name='biowardrobe-cwl-workflows',
description="Wrapped BioWardrobe's CWL files",
long_description=open(README, 'r+', encoding="utf-8").read(),
long_description_content_type="text/markdown",
version='1.0',
url='https://github.com/datirium/workflows',
download_url='https://github.com/datirium/workflows',
author='Datirium, LLC',
author_email='[email protected]',
# license='Apache-2.0',
packages=["biowardrobe_cwl_workflows"],
package_dir={'biowardrobe_cwl_workflows': '.'},
install_requires=[
'setuptools',
'jsonmerge'
'cwl_airflow'
],
zip_safe=True,
entry_points={
'console_scripts': [
"workflows-init=biowardrobe_cwl_workflows.workflows_init:generate_biowardrobe_workflow"
]
},
include_package_data=True,
package_data={
'biowardrobe_cwl_workflows': ['workflows/*.cwl',
'metadata/*.cwl',
'tools/*.cwl',
'tools/metadata/*.yaml',
'tools/metadata/*.yml']
},
cmdclass={'egg_info': tagger},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: Other Environment',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Intended Audience :: Healthcare Industry',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Operating System :: POSIX :: Linux',
'Operating System :: OS Independent',
'Operating System :: Microsoft :: Windows',
'Operating System :: Microsoft :: Windows :: Windows 10',
'Operating System :: Microsoft :: Windows :: Windows 8.1',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Scientific/Engineering :: Medical Science Apps.'
]
)