File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -30,21 +30,30 @@ jobs:
3030 with :
3131 python-version : ' 3.10'
3232
33+ - name : Create virtual environment
34+ run : python -m venv .venv
35+
3336 - name : Install dependencies
3437 run : |
38+ source .venv/bin/activate
3539 python -m pip install --upgrade pip
3640 pip install build twine
3741
3842 - name : Run tests
3943 run : |
44+ source .venv/bin/activate
4045 pip install -r requirements.txt
4146 python test/test_basic.py
4247
4348 - name : Build package
44- run : python -m build
49+ run : |
50+ source .venv/bin/activate
51+ python -m build
4552
4653 - name : Check distribution
47- run : twine check dist/*
54+ run : |
55+ source .venv/bin/activate
56+ twine check dist/*
4857
4958 - name : Upload artifacts
5059 uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change 1010import sys
1111import os
1212
13- # 添加src目录到Python路径
14- sys .path .insert (0 , os .path .join (os .path .dirname (__file__ ), "." ))
13+ # 添加python目录到Python路径(test的上一级目录)
14+ sys .path .insert (0 , os .path .join (os .path .dirname (__file__ ), ".. " ))
1515
1616try :
1717 from src .service .serversvc .server_service import MeterServerService
You can’t perform that action at this time.
0 commit comments