mirror of
https://github.com/Refound-445/nonebot-plugin-nailongremove.git
synced 2025-11-04 21:22:43 +08:00
up
This commit is contained in:
parent
f5ac064996
commit
66a4c2e9f8
@ -33,3 +33,5 @@ install-cpu = { composite = ["install-base", "install-cpu"] }
|
||||
install-gpu = { composite = ["install-base", "install-gpu"] }
|
||||
|
||||
lock-base = { shell = "cd packages/nonebot-plugin-nailongremove-base && pdm lock && cd ../.." }
|
||||
|
||||
pub-all = { call = "scripts.pub_all:main" }
|
||||
|
||||
0
scripts/__init__.py
Normal file
0
scripts/__init__.py
Normal file
10
scripts/pub_all.py
Normal file
10
scripts/pub_all.py
Normal file
@ -0,0 +1,10 @@
|
||||
from .utils import PACKAGES_PATH, system_no_fail
|
||||
|
||||
|
||||
def main():
|
||||
for p in PACKAGES_PATH.iterdir():
|
||||
system_no_fail("pdm", "publish", cwd=p)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@ -7,8 +7,8 @@ import httpx
|
||||
import tomllib
|
||||
from packaging.version import Version
|
||||
|
||||
ROOT_PATH = Path(__file__).parent.parent
|
||||
PACKAGES_PATH = ROOT_PATH / "packages"
|
||||
from .utils import PACKAGES_PATH
|
||||
|
||||
SUFFIX = ".template.toml"
|
||||
TORCH_BASE = "https://download.pytorch.org"
|
||||
TORCH_INDEX = f"{TORCH_BASE}/whl/cu124"
|
||||
|
||||
18
scripts/utils.py
Normal file
18
scripts/utils.py
Normal file
@ -0,0 +1,18 @@
|
||||
from pathlib import Path
|
||||
from subprocess import run
|
||||
from typing import Any
|
||||
|
||||
ROOT_PATH = Path(__file__).parent.parent
|
||||
PACKAGES_PATH = ROOT_PATH / "packages"
|
||||
|
||||
|
||||
def system(*args: str, **kwargs: Any):
|
||||
kwargs.setdefault("cwd", str(ROOT_PATH))
|
||||
r = run(args, **kwargs) # noqa: S603
|
||||
return r.returncode
|
||||
|
||||
|
||||
def system_no_fail(*args: str, **kwargs: Any):
|
||||
c = system(*args, **kwargs)
|
||||
if c:
|
||||
raise RuntimeError(f"command {args} failed with code {c}")
|
||||
Loading…
Reference in New Issue
Block a user