Skip to content

Commit

Permalink
update python project to pdm
Browse files Browse the repository at this point in the history
  • Loading branch information
qdriven committed Jul 4, 2024
1 parent 211c196 commit a4fa5a8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 14 deletions.
46 changes: 37 additions & 9 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
# You are now able to use PDM in your workflow
- name: Install dependencies
run: pdm install
- name: publish docs
run: pdm docs-deploy
name: build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install pdm
run: pipx install pdm

- name: Set up cache
uses: actions/[email protected]
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: |
pdm install
- name: Run test and code styles
run: |
pdm test
pdm cleanup
- name: deploy docs
run: pdm docs-deploy
7 changes: 2 additions & 5 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ dependencies = [
]

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

[project.urls]
issue = "https://github.com/{{organization_name}}/{{repo_name}}/issues"
repository = "https://github.com/{{organization_name}}/{{repo_name}}"
issue = "https://github.com/{{organization_name}}/{{project_name}}/issues"
repository = "https://github.com/{{organization_name}}/{{project_name}}"

[tool.pdm]
distribution = true
Expand Down Expand Up @@ -148,5 +147,3 @@ url = "https://pypi.tuna.tsinghua.edu.cn/simple/"
[[tool.pdm.source]]
name = "douban"
url = "https://pypi.doubanio.com/simple/"


0 comments on commit a4fa5a8

Please sign in to comment.