forked from OpenSourceEconomics/soepy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.py
36 lines (29 loc) · 1.2 KB
/
release.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
"""Build, test, convert and upload a conda package.
For the upload step to work you have to log into your anaconda.org account
before you run the script. The steps for this are explained here:
https://conda.io/docs/user-guide/tutorials/build-pkgs.html
"""
from conda_build.api import build, convert
from os.path import split, join
from subprocess import run
if __name__ == "__main__":
platforms = ["osx-64", "linux-64"]
built_packages = build(".", need_source_download=False)
converted_packages = []
for path in built_packages:
helper, package_name = split(path)
out_root, os = split(helper)
pfs = [pf for pf in platforms if pf != os]
convert(path, output_dir=out_root, platforms=pfs)
print(
"\n{} was converted to the following platforms: {}\n".format(
package_name, pfs
)
)
for pf in pfs:
converted_packages.append(join(out_root, pf, package_name))
all_packages = built_packages + converted_packages
for package in all_packages:
_, package_name = split(package)
run(["anaconda", "upload", package])
print("\n{} was uploaded to anaconda.org".format(package_name))