forked from anthony-wang/CrabNet
-
Notifications
You must be signed in to change notification settings - Fork 5
/
run_grayskull.py
32 lines (28 loc) · 1003 Bytes
/
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
"""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 crabnet 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"].append("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"].append("pytorch >=1.9.0")
my_recipe["requirements"]["run"].append("cudatoolkit <=11.6")
my_recipe.save(fpath)
my_recipe.save(fpath2)
copyfile("LICENSE", join("scratch", "LICENSE"))