Skip to content

Commit

Permalink
Merge branch 'main' into pr/674
Browse files Browse the repository at this point in the history
  • Loading branch information
SAKURA-CAT committed Dec 6, 2024
2 parents 890f1dc + 89130eb commit 734e378
Show file tree
Hide file tree
Showing 101 changed files with 5,768 additions and 2,336 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
with:
python-version: "3.10"

- name: Checkout Version
run: |
echo "VERSION=$(echo $GITHUB_REF | sed -n 's/refs\/tags\/v//p')" >> $GITHUB_ENV
- name: Install Dependencies
run: |
pip install -r requirements.txt
Expand All @@ -30,14 +34,15 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

run: |
python -m build
python script/build_pypi.py
python -m twine upload dist/*
# - run: cp dist/*.whl .
# - name: Release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# body: ${{ github.event.head_commit.message }}
# files: |
# *.whl
- run: cp dist/*.whl .

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
body: ${{ github.event.head_commit.message }}
files: |
*.whl
2 changes: 0 additions & 2 deletions .github/workflows/test-when-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
paths:
- swanlab/**
- test/**
branches:
- main

jobs:
test:
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
],
"console": "integratedTerminal",
"env": {
"is_skip_cloud_test": "true"
"SWANLAB_RUNTIME": "test-no-cloud"
}
},
{
Expand All @@ -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}"
Expand Down
15 changes: 13 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,22 @@ Ps: 如果你不想使用 VSCode 进行开发,可以前往`.vscode/launch.json
export PYTHONPATH=. && pytest test/unit
```

由于 swanlab 涉及与云端的交互,而云端部分是闭源的,所以如果你是第一次贡献代码,可能无法进行完整的测试
由于 swanlab 涉及与云端的交互,而云端部分是闭源的,所以如果你是第一次贡献代码,最简单的方式是只进行本地测试
针对这种情况,请在本地根目录下创建`.env`文件,并填写如下环境变量配置:

```dotenv
SWANLAB_RUNTIME=test-no-cloud
```

这样就可以跳过云端测试,只进行本地的部分功能测试。 如果想进行完整的测试,请联系项目维护者,我们会提供测试环境的配置。
这样就可以跳过云端测试,只进行本地的部分功能测试。 如果想进行完整的测试,请在`.env`中补充如下信息:

```dotenv
SWANLAB_RUNTIME=test
SWANLAB_API_KEY=<你的API KEY>
SWANLAB_API_HOST=https://swanlab.cn/api
SWANLAB_WEB_HOST=https://swanlab.cn
```

*注意:在进行云端版测试时会在您的云端账号下生成一些无用的测试实验数据,需要手动删除*

配置完后即可运行完整测试
294 changes: 134 additions & 160 deletions README.md

Large diffs are not rendered by default.

Loading

0 comments on commit 734e378

Please sign in to comment.