Skip to content

Commit 97e6b59

Browse files
authored
Merge pull request #66 from sys-bio/develop
Release 2.13.1
2 parents 51d3124 + 6ea85ae commit 97e6b59

File tree

1,137 files changed

+194011
-14776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,137 files changed

+194011
-14776
lines changed

.azurepipelines/getCheck.py

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
"""
2+
Get check from url.
3+
4+
Usage:
5+
6+
python getCheck.py <check_download_link> <check_install_prefix?
7+
8+
For example:
9+
10+
python getcheck.py https://github.com/sys-bio/check-13.x/releases/download/checkorg-13.0.0/check13-ubuntu-gcc10-rel.tar.gz /mnt/d/roadrunner/roadrunner/check-download-test/ubuntu
11+
12+
"""
13+
14+
15+
import glob
16+
import argparse
17+
import os
18+
from os.path import join, splitext, isdir, isfile
19+
import zipfile
20+
import tarfile
21+
import requests
22+
import io
23+
import shutil
24+
25+
# command line arguments
26+
parser = argparse.ArgumentParser()
27+
parser.add_argument("check_download_link", type=str, help="Url to compressed check link to download")
28+
parser.add_argument("check_install_prefix", type=str, help="Where to install check (directory that will contain bin, include, lib etc")
29+
args = parser.parse_args()
30+
31+
# filename of downloaded zip, check-[debug|release].zip
32+
compressed_check_filename = args.check_download_link.split('/')[-1]
33+
34+
# absolute path to compressed_check_filename
35+
abs_compressed_check_filename = join(args.check_install_prefix, compressed_check_filename)
36+
37+
# e.g. ('check--[debug|release]', '.zip')
38+
downloaded_check_folder, ext = splitext(compressed_check_filename)
39+
# when link is tar.gz, get rid of extra .tar
40+
if ".tar" in downloaded_check_folder:
41+
downloaded_check_folder = downloaded_check_folder.replace(".tar", "")
42+
43+
# make install prefix if not exists
44+
if not isdir(args.check_install_prefix):
45+
os.makedirs(args.check_install_prefix)
46+
47+
print("compressed_check_filename".ljust(20), compressed_check_filename)
48+
print("abs_compressed_check_filename".ljust(20), abs_compressed_check_filename)
49+
print("downloaded_check_folder".ljust(20), downloaded_check_folder)
50+
print("args.check_download_link".ljust(20), args.check_download_link)
51+
print("downloaded_check_folder, ext".ljust(20), downloaded_check_folder, ext)
52+
53+
# we expect a folder called bin in
54+
abs_downloaded_check_folder = join(args.check_install_prefix, downloaded_check_folder)
55+
56+
# Don't download if we already have it
57+
if not isdir(join(abs_downloaded_check_folder, "bin")):
58+
print("downloading check from {}".format(args.check_download_link))
59+
r = requests.get(args.check_download_link, stream=True)
60+
if ext == ".zip":
61+
z = zipfile.ZipFile(io.BytesIO(r.content))
62+
z.extractall(args.check_install_prefix)
63+
elif ext == ".gz":
64+
z = tarfile.open(fileobj=r.raw, mode="r|gz")
65+
z.extractall(args.check_install_prefix)
66+
else:
67+
raise ValueError("Unsupported extension")
68+
else :
69+
print("Found existing check, not downloading check")
70+
71+
# move from unzip dir to check_install_prefix
72+
folders = glob.glob(join(abs_downloaded_check_folder, "*"))
73+
print(folders)
74+
for f in folders:
75+
shutil.move(f, args.check_install_prefix)
76+
77+
78+
if isfile(abs_compressed_check_filename):
79+
os.remove(abs_compressed_check_filename)
80+
81+
82+
83+
84+
85+

.azurepipelines/getQt.py

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
"""
2+
Get qt from url.
3+
4+
Usage:
5+
6+
python getQt.py <qt_download_link> <qt_install_prefix?
7+
8+
For example:
9+
10+
python getQt.py https://github.com/sys-bio/antimony/releases/download/libcheck/Qt5.15.2.msvc.zip qt
11+
12+
"""
13+
14+
15+
import glob
16+
import argparse
17+
import os
18+
from os.path import join, splitext, isdir, isfile
19+
import zipfile
20+
import tarfile
21+
import requests
22+
import io
23+
import shutil
24+
25+
# command line arguments
26+
parser = argparse.ArgumentParser()
27+
parser.add_argument("qt_download_link", type=str, help="Url to compressed qt link to download")
28+
parser.add_argument("qt_install_prefix", type=str, help="Where to install qt (directory that will contain bin, include, lib etc")
29+
args = parser.parse_args()
30+
31+
# filename of downloaded zip, qt-[debug|release].zip
32+
compressed_qt_filename = args.qt_download_link.split('/')[-1]
33+
34+
# absolute path to compressed_qt_filename
35+
abs_compressed_qt_filename = join(args.qt_install_prefix, compressed_qt_filename)
36+
37+
# e.g. ('qt--[debug|release]', '.zip')
38+
downloaded_qt_folder, ext = splitext(compressed_qt_filename)
39+
# when link is tar.gz, get rid of extra .tar
40+
if ".tar" in downloaded_qt_folder:
41+
downloaded_qt_folder = downloaded_qt_folder.replace(".tar", "")
42+
43+
# make install prefix if not exists
44+
if not isdir(args.qt_install_prefix):
45+
os.makedirs(args.qt_install_prefix)
46+
47+
print("compressed_qt_filename".ljust(20), compressed_qt_filename)
48+
print("abs_compressed_qt_filename".ljust(20), abs_compressed_qt_filename)
49+
print("downloaded_qt_folder".ljust(20), downloaded_qt_folder)
50+
print("args.qt_download_link".ljust(20), args.qt_download_link)
51+
print("downloaded_qt_folder, ext".ljust(20), downloaded_qt_folder, ext)
52+
53+
# we expect a folder called bin in
54+
abs_downloaded_qt_folder = join(args.qt_install_prefix, downloaded_qt_folder)
55+
56+
# Don't download if we already have it
57+
if not isdir(join(abs_downloaded_qt_folder, "5.15.2")):
58+
print("downloading qt from {}".format(args.qt_download_link))
59+
r = requests.get(args.qt_download_link, stream=True)
60+
if ext == ".zip":
61+
z = zipfile.ZipFile(io.BytesIO(r.content))
62+
z.extractall(args.qt_install_prefix)
63+
elif ext == ".gz":
64+
z = tarfile.open(fileobj=r.raw, mode="r|gz")
65+
z.extractall(args.qt_install_prefix)
66+
else:
67+
raise ValueError("Unsupported extension")
68+
else :
69+
print("Found existing qt, not downloading qt")
70+
71+
# move from unzip dir to qt_install_prefix
72+
folders = glob.glob(join(abs_downloaded_qt_folder, "*"))
73+
print(folders)
74+
for f in folders:
75+
shutil.move(f, args.qt_install_prefix)
76+
77+
78+
if isfile(abs_compressed_qt_filename):
79+
os.remove(abs_compressed_qt_filename)
80+
81+
82+
83+
84+
85+

.azurepipelines/renameWheel.py

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""
2+
Finds and renames the local Antimony wheel file to work with any Python version.
3+
4+
Usage:
5+
6+
python renameWheel.py
7+
8+
For example:
9+
10+
python renameWheel.py
11+
12+
"""
13+
14+
15+
from os import walk, rename
16+
17+
wfiles = []
18+
for __, _, files in walk("."):
19+
wfiles += files
20+
21+
for file in wfiles:
22+
if ".whl" not in file:
23+
continue
24+
fvec = file.split("-")
25+
fvec[2] = "py3"
26+
fvec[3] = "none"
27+
if "linux_" in fvec[4]:
28+
fvec[4] = fvec[4].replace("linux_", "manylinux2014_")
29+
newname = ""
30+
for fpart in fvec:
31+
newname += "-" + fpart
32+
newname = newname[1:]
33+
rename(file, newname)
34+

0 commit comments

Comments
 (0)