-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(api): Update type hints and docstrings for clarity and consi…
…stency Update type hints and docstrings across various modules to improve code readability and maintainability. Signed-off-by: longhao <[email protected]>
- Loading branch information
Showing
15 changed files
with
505 additions
and
2,178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,40 @@ | ||
name: Deploy Documentation | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'docs/**' | ||
- 'mkdocs.yml' | ||
- '.github/workflows/publish_docs.yml' | ||
- 'pyproject.toml' | ||
- 'poetry.lock' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry config virtualenvs.create false | ||
poetry install --only docs | ||
- name: Configure Git | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
- name: Deploy documentation | ||
run: | | ||
mkdocs gh-deploy --force | ||
name: Deploy Documentation | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'docs/**' | ||
- 'mkdocs.yml' | ||
- '.github/workflows/publish_docs.yml' | ||
- 'pyproject.toml' | ||
- 'poetry.lock' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install nox | ||
- name: Configure Git | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
- name: Build and deploy documentation | ||
run: | | ||
nox -s docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,25 +19,32 @@ jobs: | |
token: "${{ secrets.GITHUB_TOKEN }}" | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
- uses: olegtarasov/[email protected] | ||
id: get_tag_name | ||
with: | ||
tagRegex: "v(?<version>.*)" | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip poetry mkdocs mkdocs-material | ||
poetry --version | ||
poetry build | ||
# Note that we don't need credentials. | ||
# We rely on https://docs.pypi.org/trusted-publishers/. | ||
python -m pip install --upgrade pip | ||
pip install nox build | ||
- name: Build package | ||
run: | | ||
python -m build | ||
- name: Upload to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: dist | ||
|
||
- name: Generate changelog | ||
id: changelog | ||
uses: jaywcjlove/changelog-generator@main | ||
|
@@ -50,12 +57,22 @@ jobs: | |
{{fix}} | ||
## Feature | ||
{{feat}} | ||
## Improve | ||
{{refactor,perf,clean}} | ||
## Misc | ||
{{chore,style,ci||🔶 Nothing change}} | ||
## Unknown | ||
{{__unknown__}} | ||
## Breaking Changes | ||
{{breaking}} | ||
## Updates | ||
{{chore}} | ||
## Document | ||
{{docs}} | ||
## Dependency | ||
{{deps}} | ||
## Style | ||
{{style}} | ||
## Test | ||
{{test}} | ||
## CI | ||
{{ci}} | ||
## Other | ||
{{other}} | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "dist/*.whl" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,22 +17,13 @@ jobs: | |
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip poetry | ||
poetry --version | ||
poetry install | ||
python -m pip install --upgrade pip | ||
pip install nox | ||
- name: Run tests and linters | ||
- name: Run linting checks | ||
run: | | ||
#!/bin/sh -e | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Action" | ||
export PREFIX="poetry run python -m " | ||
if [ -d 'venv' ] ; then | ||
export PREFIX="venv/bin/" | ||
fi | ||
${PREFIX}black photoshop --check | ||
${PREFIX}isort --check-only photoshop | ||
${PREFIX}flake8 photoshop --max-line-length 120 | ||
nox -s pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
tests: | ||
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
os: [windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install nox | ||
- name: Run tests | ||
run: | | ||
nox -s tests |
Oops, something went wrong.