Skip to content

Commit a00aeed

Browse files
authored
Initial commit
0 parents  commit a00aeed

21 files changed

+756
-0
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig
2+
# https://editorconfig.org/
3+
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.{py,sh,ipynb}]
15+
indent_size = 4
16+
17+
[*{.md,rst}]
18+
indent_size = 3

.github/FUNDING.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
patreon: SigureMo
2+
custom:
3+
[
4+
"https://afdian.net/@siguremo",
5+
"https://img.nyakku.moe/sponsor/alipay.png",
6+
"https://img.nyakku.moe/sponsor/wechat.png",
7+
]

.github/renovate.json5

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// https://docs.renovatebot.com/configuration-options/
2+
{
3+
extends: ["github>SigureMo/renovate-config"],
4+
}

.github/workflows/lint-and-fmt.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Lint and Format
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
merge_group:
8+
workflow_dispatch:
9+
10+
jobs:
11+
lint-and-fmt:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
# Only run linter and formatter on minimum supported Python version
16+
python-version: ['3.9']
17+
architecture: ['x64']
18+
name: lint and fmt - Python ${{ matrix.python-version }} on ${{ matrix.architecture }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Install prettier
24+
run: |
25+
npm install -g prettier
26+
27+
- name: Install uv
28+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
29+
30+
- name: Install python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
architecture: ${{ matrix.architecture }}
35+
36+
- name: Install just
37+
uses: extractions/setup-just@v2
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Install dependencies
42+
run: |
43+
just ci-install
44+
45+
- name: lint
46+
run: |
47+
just ci-lint
48+
49+
- name: format check
50+
run: |
51+
just ci-fmt-check

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
workflow_dispatch:
7+
8+
jobs:
9+
release-build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
18+
19+
- name: Install python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.x'
23+
24+
- name: Install just
25+
uses: extractions/setup-just@v2
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: build release distributions
30+
run: |
31+
just ci-install
32+
just build
33+
34+
- name: upload dists
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: release-dists
38+
path: dist/
39+
40+
publish-pypi:
41+
runs-on: ubuntu-latest
42+
name: Publish to PyPI
43+
if: "startsWith(github.ref, 'refs/tags/')"
44+
needs:
45+
- release-build
46+
permissions:
47+
id-token: write
48+
49+
steps:
50+
- name: Retrieve release distributions
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: release-dists
54+
path: dist/
55+
56+
- name: Publish release distributions to PyPI
57+
uses: pypa/gh-action-pypi-publish@release/v1
58+
59+
publish-release:
60+
runs-on: ubuntu-latest
61+
name: Publish to GitHub
62+
if: "startsWith(github.ref, 'refs/tags/')"
63+
needs:
64+
- release-build
65+
permissions:
66+
contents: write
67+
steps:
68+
- uses: actions/download-artifact@v4
69+
with:
70+
name: release-dists
71+
path: dist/
72+
- name: Get tag name
73+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
74+
- name: Publish to GitHub
75+
uses: softprops/action-gh-release@v2
76+
with:
77+
draft: true
78+
files: dist/*
79+
tag_name: ${{ env.RELEASE_VERSION }}

.github/workflows/unit-test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Unit Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
merge_group:
8+
workflow_dispatch:
9+
10+
jobs:
11+
unit-test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ['3.9', '3.10', '3.11', '3.12']
16+
architecture: ['x64']
17+
name: unittest - Python ${{ matrix.python-version }} on ${{ matrix.architecture }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Install uv
23+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
24+
25+
- name: Install python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
architecture: ${{ matrix.architecture }}
30+
31+
- name: Install just
32+
uses: extractions/setup-just@v2
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Install dependencies
37+
run: |
38+
just ci-install
39+
40+
- name: unit test
41+
run: |
42+
just ci-test

.gitignore

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
.hypothesis/
50+
.pytest_cache/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
61+
# Flask stuff:
62+
instance/
63+
.webassets-cache
64+
65+
# Scrapy stuff:
66+
.scrapy
67+
68+
# Sphinx documentation
69+
docs/_build/
70+
71+
# PyBuilder
72+
target/
73+
74+
# Jupyter Notebook
75+
.ipynb_checkpoints
76+
77+
# IPython
78+
profile_default/
79+
ipython_config.py
80+
81+
# pyenv
82+
.python-version
83+
84+
# celery beat schedule file
85+
celerybeat-schedule
86+
87+
# SageMath parsed files
88+
*.sage.py
89+
90+
# Environments
91+
.env
92+
.venv
93+
env/
94+
venv/
95+
ENV/
96+
env.bak/
97+
venv.bak/
98+
99+
# Spyder project settings
100+
.spyderproject
101+
.spyproject
102+
103+
# Rope project settings
104+
.ropeproject
105+
106+
# mkdocs documentation
107+
/site
108+
109+
# mypy
110+
.mypy_cache/
111+
.dmypy.json
112+
dmypy.json
113+
114+
# Pyre type checker
115+
.pyre/
116+
117+
# macOS
118+
.DS_Store
119+
120+
# test files
121+
*.test.py
122+
123+
# logs
124+
log

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.html
2+
dist/
3+
node_modules/
4+
*.min.js
5+
pnpm-lock.yaml
6+
.venv/

.prettierrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"trailingComma": "es5",
6+
"semi": false,
7+
"arrowParens": "always",
8+
"overrides": [
9+
{
10+
"files": "*.md",
11+
"options": {
12+
"tabWidth": 3
13+
}
14+
},
15+
{
16+
"files": "*.json5",
17+
"options": {
18+
"singleQuote": false
19+
}
20+
}
21+
]
22+
}

.vscode/extensions.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"recommendations": [
3+
"ms-python.python",
4+
"ms-python.vscode-pylance",
5+
"charliermarsh.ruff",
6+
"esbenp.prettier-vscode",
7+
"EditorConfig.EditorConfig",
8+
"aaron-bond.better-comments",
9+
"usernamehw.errorlens",
10+
"GitHub.copilot",
11+
"seatonjiang.gitmoji-vscode",
12+
"skellock.just",
13+
"yzhang.markdown-all-in-one"
14+
]
15+
}

0 commit comments

Comments
 (0)