Skip to content

Commit 6602ab1

Browse files
committed
update
1 parent 845a1ad commit 6602ab1

File tree

11 files changed

+175
-180
lines changed

11 files changed

+175
-180
lines changed

.devcontainer/devcontainer.json

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@
22
"name": "Python",
33
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
44
"features": {
5-
"ghcr.io/devcontainers/features/python:1": {
6-
"version": "latest",
7-
"installTools": false,
8-
"installJupyterlab": false,
9-
"toolsToInstall": "mypy"
10-
},
11-
"ghcr.io/va-h/devcontainers-features/uv:1": {},
12-
"ghcr.io/devcontainers-contrib/features/shfmt:1": {},
13-
"ghcr.io/dhoeric/features/hadolint:1": {},
14-
"ghcr.io/michidk/devcontainers-features/typos:1": {},
5+
"ghcr.io/devcontainers-extra/features/mise:1": {},
156
"ghcr.io/devcontainers/features/common-utils:2": {
16-
"configureZshAsDefaultShell": true
7+
"configureZshAsDefaultShell": true,
8+
"installZsh": true,
9+
"installOhMyZsh": true,
10+
"installOhMyZshConfig": true,
11+
"upgradePackages": true
1712
}
1813
},
1914
"postCreateCommand": ".devcontainer/postCreateCommand.sh",
@@ -22,24 +17,20 @@
2217
"customizations": {
2318
"vscode": {
2419
"extensions": [
20+
"DavidAnson.vscode-markdownlint",
21+
"hverlin.mise-vscode",
22+
"github.copilot",
23+
"gruntfuggly.todo-tree",
24+
"streetsidesoftware.code-spell-checker",
25+
"redhat.vscode-yaml",
2526
"charliermarsh.ruff",
26-
"exiasr.hadolint",
27-
"foxundermoon.shell-format",
28-
"GitHub.copilot",
29-
"GitHub.vscode-github-actions",
30-
"Gruntfuggly.todo-tree",
31-
"ms-azuretools.vscode-docker",
32-
"ms-python.black-formatter",
33-
"ms-python.mypy-type-checker",
34-
"njpwerner.autodocstring",
35-
"oderwat.indent-rainbow",
36-
"tamasfe.even-better-toml",
37-
"tekumara.typos-vscode",
38-
"timonwong.shellcheck",
27+
"astral-sh.ty@prerelease",
28+
"tombi-toml.tombi",
3929
"-ms-python.vscode-pylance"
4030
],
4131
"settings": {
42-
"terminal.integrated.defaultProfile.linux": "zsh",
32+
// Python
33+
"python.testing.pytestEnabled": true,
4334
"python.defaultInterpreterPath": "./.venv/bin/python",
4435
"[python]": {
4536
"editor.formatOnSave": true,
@@ -48,8 +39,25 @@
4839
"source.organizeImports": "explicit"
4940
},
5041
"editor.defaultFormatter": "charliermarsh.ruff"
42+
},
43+
// Markdown
44+
"[markdown]": {
45+
"editor.formatOnSave": true,
46+
"editor.formatOnPaste": true
47+
},
48+
// Terminal
49+
"terminal.integrated.defaultProfile.linux": "zsh",
50+
"terminal.integrated.scrollback": 100000,
51+
// GitHub Copilot
52+
"github.copilot.chat.codeGeneration.useInstructionFiles": true,
53+
"github.copilot.chat.localeOverride": "ja",
54+
"chat.instructionsFilesLocations": {
55+
".github/instructions": true
5156
}
5257
}
5358
}
54-
}
55-
}
59+
},
60+
"mounts": [],
61+
"containerEnv": {},
62+
"remoteEnv": {}
63+
}

.devcontainer/postCreateCommand.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33
set -euxo pipefail
44

5-
uv sync --dev --all-extras
6-
uv run pre-commit install --allow-missing-config
5+
if ! grep -q mise ~/.zshrc; then
6+
# shellcheck disable=SC2016
7+
echo 'eval "$(mise activate zsh)"' >> ~/.zshrc
8+
fi
9+
10+
mise trust
11+
mise install
12+
mise generate git-pre-commit --write
13+
eval "$(mise activate zsh)"
714

815
cat<<'A'>> ~/.zshrc
916
eval "$(uv generate-shell-completion zsh)"
1017
eval "$(uvx --generate-shell-completion zsh)"
11-
command -v deactivate &>/dev/null || . .venv/bin/activate
1218
A
1319

1420
sed -i ~/.zshrc -e 's/^ZSH_THEME=.*/ZSH_THEME="refined"/'
15-
16-
[[ -d .venv ]] || uv venv

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,23 @@ updates:
99
dependency-type: production
1010
dev-dependencies:
1111
dependency-type: development
12+
cooldown:
13+
default-days: 7
1214
- package-ecosystem: github-actions
1315
directory: /
1416
schedule:
1517
interval: monthly
18+
cooldown:
19+
default-days: 7
20+
- package-ecosystem: "devcontainers"
21+
directory: /
22+
schedule:
23+
interval: monthly
24+
cooldown:
25+
default-days: 7
1626
- package-ecosystem: docker
1727
directory: /
1828
schedule:
1929
interval: monthly
30+
cooldown:
31+
default-days: 7

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: ci
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: ["master"]
7+
push:
8+
tags: ["*"]
9+
branches: ["master"]
10+
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
env:
20+
MISE_EXPERIMENTAL: true
21+
22+
jobs:
23+
ci:
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 10
26+
steps:
27+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
28+
- uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
29+
- run: uv sync --locked
30+
- run: mise run ci
31+
- uses: MishaKav/pytest-coverage-comment@ae0e8a539a3f310aefb3bfb6a2209778a21fa42b # v1.2.0
32+
if: github.event_name == 'pull_request'
33+
with:
34+
pytest-coverage-path: ./pytest-coverage.txt
35+
junitxml-path: ./pytest.xml

.github/workflows/docs.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
1-
name: Publish docs
1+
name: docs
22

33
on:
44
push:
55
branches:
66
- master
77

88
jobs:
9-
test:
9+
docs:
1010
runs-on: ubuntu-latest
11-
strategy:
12-
max-parallel: 1
13-
11+
permissions:
12+
contents: write
1413
steps:
15-
- uses: actions/checkout@v6
16-
- uses: astral-sh/setup-uv@v7
17-
with:
18-
enable-cache: true
19-
cache-dependency-glob: uv.lock
20-
- run: uv sync --all-extras --dev
21-
- run: uv run task gendoc
22-
- uses: peaceiris/actions-gh-pages@v4
23-
with:
24-
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
publish_dir: ./docs
14+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
15+
- uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
16+
- run: uv sync --group docs --locked
17+
- run: mise run docs
18+
- uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
publish_dir: ./docs

.github/workflows/release.yml

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,56 @@
1-
name: Release Package
2-
3-
# need to setup:
4-
# secrets.PYPI_TOKEN (See: https://pypi.org/help/#apitoken)
1+
name: release
52

63
on:
74
push:
85
tags:
9-
- v*
6+
- v*
107

118
jobs:
9+
pypi:
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
permissions:
14+
id-token: write
15+
contents: read
16+
steps:
17+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
18+
- uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1
19+
- run: uv sync --locked --no-dev
20+
- run: mise run build
21+
- run: uv publish
1222
release:
1323
runs-on: ubuntu-latest
1424
steps:
15-
- uses: actions/checkout@v6
25+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1626

1727
- id: create_release
18-
uses: actions/create-release@v1
28+
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
1929
env:
2030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2131
with:
2232
tag_name: ${{ github.ref }}
2333
release_name: Release ${{ github.ref }}
2434
draft: false
2535
prerelease: false
26-
pypi:
27-
needs: release
28-
runs-on: ubuntu-latest
29-
steps:
30-
- uses: actions/checkout@v6
31-
with:
32-
persist-credentials: false
33-
- uses: astral-sh/setup-uv@v7
34-
with:
35-
enable-cache: true
36-
cache-dependency-glob: uv.lock
37-
- run: uv build
38-
- run: uv publish --token "${{ env.PYPI_TOKEN }}"
39-
env:
40-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
4136
ghcr:
4237
needs: release
4338
runs-on: ubuntu-latest
4439
steps:
45-
- uses: actions/checkout@v6
46-
- uses: docker/metadata-action@v5
40+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
41+
- uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
4742
id: meta
4843
with:
4944
images: ghcr.io/${{ github.repository }}
5045
tags: |
5146
type=semver,pattern={{version}}
5247
type=semver,pattern={{major}}.{{minor}}
53-
- uses: docker/login-action@v3
48+
- uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
5449
with:
5550
registry: ghcr.io
5651
username: ${{ github.repository_owner }}
5752
password: ${{ secrets.GITHUB_TOKEN }}
58-
- uses: docker/build-push-action@v6
53+
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
5954
with:
6055
context: .
6156
push: true

.github/workflows/test.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)