-
Notifications
You must be signed in to change notification settings - Fork 9
/
run_grayskull.py
33 lines (29 loc) · 1.07 KB
/
run_grayskull.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
"""Touch up the conda recipe from grayskull using conda-souschef."""
from souschef.recipe import Recipe
import os
from warnings import warn
from os.path import join
from pathlib import Path
from shutil import copyfile
import mat_discover as module
name, version = module.__name__, module.__version__
os.system(f"grayskull pypi {name}=={version}")
Path("scratch").mkdir(exist_ok=True)
fpath = join(name, "meta.yaml")
fpath2 = join("scratch", "meta.yaml")
my_recipe = Recipe(load_file=fpath)
my_recipe["requirements"]["host"].replace("flit_core >=3.2,<4", "flit")
my_recipe["build"].add_section("noarch")
my_recipe["build"]["noarch"] = "python"
try:
del my_recipe["requirements"]["build"]
except Exception as e:
print(e)
warn("couldn't delete build section (probably because it didn't exist)")
pass
my_recipe["requirements"]["run"].replace("kaleido", "python-kaleido")
my_recipe["requirements"]["run"].append("pytorch >=1.9.0")
my_recipe["requirements"]["run"].append("cudatoolkit <11.4")
my_recipe.save(fpath)
my_recipe.save(fpath2)
copyfile("LICENSE", join("scratch", "LICENSE"))