Skip to content

Commit 44841a1

Browse files
authored
Merge pull request #7 from SongshGeo/dev
项目模板现代化升级
2 parents de66b17 + f68f78b commit 44841a1

File tree

16 files changed

+3015
-73
lines changed

16 files changed

+3015
-73
lines changed

.github/workflows/docs.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.11'
27+
28+
- name: Install uv
29+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
30+
31+
- name: Install dependencies
32+
run: |
33+
source $HOME/.cargo/env
34+
uv sync --all-extras
35+
36+
- name: Build documentation
37+
run: |
38+
source $HOME/.cargo/env
39+
uv run mkdocs build
40+
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v4
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: ./site
48+
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.github/workflows/release-please.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,17 @@ jobs:
3737
with:
3838
python-version: '3.x'
3939

40-
- name: Install poetry
40+
- name: Install uv
4141
run: |
42-
curl -sSL https://install.python-poetry.org | python3 -
43-
44-
- name: Configure poetry
45-
run: |
46-
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
42+
curl -LsSf https://astral.sh/uv/install.sh | sh
4743
4844
- name: Build and publish
45+
env:
46+
UV_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
4947
run: |
50-
poetry build
51-
poetry publish
48+
source "$HOME/.cargo/env"
49+
uv build
50+
uv publish
5251
5352
# 打包源码, 上传到 release 中
5453
# build-and-attach-assets:

.pre-commit-config.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: '24.10.0'
3+
rev: '25.9.0'
44
hooks:
55
- id: black
66
- id: black-jupyter
77
- repo: https://github.com/PyCQA/flake8
8-
rev: '7.1.1'
8+
rev: '7.3.0'
99
hooks:
1010
- id: flake8
1111
args: ['--max-line-length=88', '--extend-ignore=E203,E501,W503', '--exclude=.venv']
1212
- repo: https://github.com/PyCQA/isort
13-
rev: '5.13.2'
13+
rev: '7.0.0'
1414
hooks:
1515
- id: isort
1616
args: ['--profile=black']
1717
- repo: https://github.com/kynan/nbstripout
1818
rev: 0.8.1
1919
hooks:
2020
- id: nbstripout
21+
args: ['--keep-output']
2122
- repo: https://github.com/astral-sh/ruff-pre-commit
2223
# Ruff version.
23-
rev: v0.8.1
24+
rev: v0.14.2
2425
hooks:
2526
# Run the linter.
2627
- id: ruff
2728
args: [ --fix ]
2829
# Run the formatter.
2930
- id: ruff-format
3031
- repo: https://github.com/pre-commit/pre-commit-hooks
31-
rev: 'v5.0.0'
32+
rev: 'v6.0.0'
3233
hooks:
3334
- id: check-ast
3435
- id: end-of-file-fixer
3536
- id: trailing-whitespace
36-
- repo: https://github.com/python-poetry/poetry
37-
rev: '1.8.0' # add version here
38-
hooks:
39-
- id: poetry-export
40-
args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements.txt"]
37+
- repo: https://github.com/econchick/interrogate
38+
rev: 1.7.0
39+
hooks:
40+
- id: interrogate
41+
args: [--verbose, --fail-under=80]
4142
- repo: https://github.com/pre-commit/mirrors-mypy
42-
rev: 'v1.13.0' # Use the sha / tag you want to point at
43+
rev: 'v1.18.2' # Use the sha / tag you want to point at
4344
hooks:
4445
- id: mypy
4546
args: [--ignore-missing-imports]

0 commit comments

Comments
 (0)