From 097b4243dfb8cb854d4d3365031823aa25ec95fa Mon Sep 17 00:00:00 2001 From: KAAANG <79990647+SAKURA-CAT@users.noreply.github.com> Date: Sun, 18 Aug 2024 13:09:47 +0800 Subject: [PATCH] change script --- .github/workflows/publish-to-pypi.yml | 2 +- .vscode/launch.json | 2 +- build_pypi.py => script/build_pypi.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename build_pypi.py => script/build_pypi.py (83%) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 55d1305e6..f9e72dcbb 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -34,7 +34,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | - python -m build_pypi.py + python -m script/build_pypi.py # python -m twine upload dist/* - run: cp dist/*.whl . diff --git a/.vscode/launch.json b/.vscode/launch.json index 02238d78c..eff7c520f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -70,7 +70,7 @@ "name": "构建项目", "type": "debugpy", "request": "launch", - "program": "${workspaceFolder}/build_pypi.py", + "program": "${workspaceFolder}/script/build_pypi.py", "console": "integratedTerminal", "justMyCode": true, "cwd": "${workspaceFolder}" diff --git a/build_pypi.py b/script/build_pypi.py similarity index 83% rename from build_pypi.py rename to script/build_pypi.py index c07ac04d5..f7d6f08fc 100644 --- a/build_pypi.py +++ b/script/build_pypi.py @@ -13,14 +13,14 @@ import os # 如果dist文件夹存在则删除 -if os.path.exists("dist"): - shutil.rmtree("dist") +if os.path.exists("../dist"): + shutil.rmtree("../dist") # 设置版本号 version = os.getenv("VERSION") if not version: raise ValueError("尚未指定构建版本号") -with open("swanlab/package.json", 'r+') as f: +with open("../swanlab/package.json", 'r+') as f: p = json.load(f) p["version"] = version json.dump(p, f, indent=4)