Skip to content

Commit a7f00bc

Browse files
authored
Initial commit
0 parents  commit a7f00bc

31 files changed

Lines changed: 3599 additions & 0 deletions

.github/FUNDING.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# These are supported funding model platforms
2+
3+
github: [SongshGeo]
4+
# patreon: # Replace with a single Patreon username
5+
# open_collective: # Replace with a single Open Collective username
6+
# ko_fi: # Replace with a single Ko-fi username
7+
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
# liberapay: # Replace with a single Liberapay username
10+
# issuehunt: # Replace with a single IssueHunt username
11+
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
# polar: # Replace with a single Polar username
13+
buy_me_a_coffee: usgxyspyw4
14+
# thanks_dev: # Replace with a single thanks.dev username
15+
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.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
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: release-please
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
id-token: write
12+
13+
jobs:
14+
# 创建 release
15+
release-please:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
release_created: ${{ steps.release.outputs.release_created }}
19+
tag_name: ${{ steps.release.outputs.tag_name }}
20+
steps:
21+
- uses: google-github-actions/release-please-action@v3
22+
id: release
23+
with:
24+
release-type: python
25+
package-name: ${project_name}
26+
27+
# 发布到 pypi
28+
publish-pypi:
29+
needs: release-please
30+
runs-on: ubuntu-latest
31+
if: ${{ needs.release-please.outputs.release_created }}
32+
steps:
33+
- uses: actions/checkout@v3
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: '3.x'
39+
40+
- name: Install uv
41+
run: |
42+
curl -LsSf https://astral.sh/uv/install.sh | sh
43+
44+
- name: Build and publish
45+
env:
46+
UV_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
47+
run: |
48+
source "$HOME/.cargo/env"
49+
uv build
50+
uv publish
51+
52+
# 打包源码, 上传到 release 中
53+
# build-and-attach-assets:
54+
# needs: release-please
55+
# runs-on: ubuntu-latest
56+
# if: ${{ needs.release-please.outputs.release_created }}
57+
# steps:
58+
# - uses: actions/checkout@v3
59+
60+
# - name: Zip src folder
61+
# run: zip -r src.zip src/
62+
63+
# - name: Upload Release Asset
64+
# env:
65+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
# run: |
67+
# gh release upload ${{ needs.release-please.outputs.tag_name }} src.zip --clobber

.gitignore

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
.idea/
131+
*.lock
132+
133+
# Temporary files
134+
tmp

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: '25.9.0'
4+
hooks:
5+
- id: black
6+
- id: black-jupyter
7+
- repo: https://github.com/PyCQA/flake8
8+
rev: '7.3.0'
9+
hooks:
10+
- id: flake8
11+
args: ['--max-line-length=88', '--extend-ignore=E203,E501,W503', '--exclude=.venv']
12+
- repo: https://github.com/PyCQA/isort
13+
rev: '7.0.0'
14+
hooks:
15+
- id: isort
16+
args: ['--profile=black']
17+
- repo: https://github.com/kynan/nbstripout
18+
rev: 0.8.1
19+
hooks:
20+
- id: nbstripout
21+
args: ['--keep-output']
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
# Ruff version.
24+
rev: v0.14.2
25+
hooks:
26+
# Run the linter.
27+
- id: ruff
28+
args: [ --fix ]
29+
# Run the formatter.
30+
- id: ruff-format
31+
- repo: https://github.com/pre-commit/pre-commit-hooks
32+
rev: 'v6.0.0'
33+
hooks:
34+
- id: check-ast
35+
- id: end-of-file-fixer
36+
- id: trailing-whitespace
37+
- repo: https://github.com/econchick/interrogate
38+
rev: 1.7.0
39+
hooks:
40+
- id: interrogate
41+
args: [--verbose, --fail-under=80]
42+
- repo: https://github.com/pre-commit/mirrors-mypy
43+
rev: 'v1.18.2' # Use the sha / tag you want to point at
44+
hooks:
45+
- id: mypy
46+
args: [--ignore-missing-imports]

0 commit comments

Comments
 (0)