-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpublish
executable file
·64 lines (56 loc) · 1.83 KB
/
publish
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
#!/bin/bash
set -e
set -x
# http://peterdowns.com/posts/first-time-with-pypi.html
write_setup_config () {
cat <<EOF > setup.py
from distutils.core import setup
#from pip.req import parse_requirements
def parse_requirements(filename):
""" load requirements from a pip requirements file """
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]
install_reqs = parse_requirements("greent/requirements.txt") #, session="i")
requirements = [str(r) for r in install_reqs]
setup(
name = 'greent',
packages = [ 'greent' ], # this must be the same as the name above
package_data={ 'greent' : [
'greent.conf',
'greent-stars.conf',
'rosetta.yml',
'identifiers.org.json',
'requirements.txt',
'jsonld/*',
'query/*.sparql'
]},
version = '${version}',
description = 'Green Team BioMedical Data Translator',
author = 'Steve Cox',
author_email = '[email protected]',
install_requires = requirements,
include_package_data=True,
url = 'https://github.com/NCATS-Tangerine/greent.git',
download_url = 'http://github.com/NCATS-Tangerine/greent/archive/0.1.tar.gz',
keywords = [ 'biomedical', 'environmental', 'exposure', 'clinical' ],
classifiers = [ ],
)
EOF
}
publish () {
version=$(echo $(cat version) 0.01 | awk '{printf "%G", $1 + $2}' )
echo "Publishing version: $version"
write_setup_config
git tag
if [ -z "$( git tag --list $version )" ]; then
python setup.py sdist
tar tf dist/greent-${version}.tar.gz
twine upload --skip-existing dist/greent-${version}.tar.gz
echo $version > version
git commit -am "api version $version"
git push origin master
git tag $version -m "publishing version $version"
git push --tags origin master
fi
}
publish $*