Skip to content

Commit a4fa5a8

Browse files
committed
update python project to pdm
1 parent 211c196 commit a4fa5a8

File tree

2 files changed

+39
-14
lines changed

2 files changed

+39
-14
lines changed

.github/workflows/publish.yaml

+37-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
1-
steps:
2-
- uses: actions/checkout@v4
3-
- name: Setup PDM
4-
uses: pdm-project/setup-pdm@v4
5-
# You are now able to use PDM in your workflow
6-
- name: Install dependencies
7-
run: pdm install
8-
- name: publish docs
9-
run: pdm docs-deploy
1+
name: build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.10", "3.11"]
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
19+
- name: Install pdm
20+
run: pipx install pdm
21+
22+
- name: Set up cache
23+
uses: actions/cache@v4.0.2
24+
with:
25+
path: .venv
26+
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
27+
- name: Install dependencies
28+
run: |
29+
pdm install
30+
31+
- name: Run test and code styles
32+
run: |
33+
pdm test
34+
pdm cleanup
35+
36+
- name: deploy docs
37+
run: pdm docs-deploy

template/pyproject.toml.jinja

+2-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ dependencies = [
4242
]
4343

4444
[tool.pdm.scripts]
45-
# ss-python-cli = "ss_python.cli:app"
4645
lint = "ruff ."
4746
fmt = "ruff format . --check"
4847
test = "pytest "
@@ -51,8 +50,8 @@ docs-deploy ="mkdocs gh-deploy --force"
5150
cleanup = "sh scripts/cleanup.sh"
5251

5352
[project.urls]
54-
issue = "https://github.com/{{organization_name}}/{{repo_name}}/issues"
55-
repository = "https://github.com/{{organization_name}}/{{repo_name}}"
53+
issue = "https://github.com/{{organization_name}}/{{project_name}}/issues"
54+
repository = "https://github.com/{{organization_name}}/{{project_name}}"
5655

5756
[tool.pdm]
5857
distribution = true
@@ -148,5 +147,3 @@ url = "https://pypi.tuna.tsinghua.edu.cn/simple/"
148147
[[tool.pdm.source]]
149148
name = "douban"
150149
url = "https://pypi.doubanio.com/simple/"
151-
152-

0 commit comments

Comments
 (0)