From 0951f060e3d4fc111a53a0ec81091bfd3a3cb109 Mon Sep 17 00:00:00 2001 From: TAKANO Mitsuhiro Date: Fri, 27 Oct 2023 22:31:01 +0900 Subject: [PATCH 1/2] Support Python v3.12.x --- .github/workflows/workflow.yml | 2 +- docker/Dockerfile | 2 +- shingetsu/config.py | 2 +- shingetsu/mch/datd.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 379e914..69f75e2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 diff --git a/docker/Dockerfile b/docker/Dockerfile index bfcd0c4..894b4a8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim +FROM python:3.12-slim COPY . /saku WORKDIR /saku diff --git a/shingetsu/config.py b/shingetsu/config.py index be2132e..f5d52cb 100644 --- a/shingetsu/config.py +++ b/shingetsu/config.py @@ -60,7 +60,7 @@ def _get_version(): # External config files. -_extconf = configparser.SafeConfigParser() +_extconf = configparser.ConfigParser() _extconf.read(['file/saku.ini', '/usr/local/etc/saku/saku.ini', '/etc/saku/saku.ini', diff --git a/shingetsu/mch/datd.py b/shingetsu/mch/datd.py index dcb62ac..e8cefff 100644 --- a/shingetsu/mch/datd.py +++ b/shingetsu/mch/datd.py @@ -210,7 +210,7 @@ def subject_app(env, resp): # example: 2ch_E99B91E8AB87(雑談) board = env['mch.path_match'].group(1) - m = re.match('2ch_(\S+)', board) + m = re.match(r'2ch_(\S+)', board) if not (board.startswith('2ch') or m): resp("404 Not Found", [('Content-Type', 'text/plain')]) return [b'404 Not Found'] From 3c6b1671e0d1b097b4afa2d3e389ef6b505cbabc Mon Sep 17 00:00:00 2001 From: TAKANO Mitsuhiro Date: Fri, 27 Oct 2023 22:37:16 +0900 Subject: [PATCH 2/2] run `ruff` without `--format=github` option --- .github/workflows/workflow.yml | 2 +- Pipfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 69f75e2..72db19e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -25,7 +25,7 @@ jobs: pipenv install ruff pytest - name: Lint with ruff run: | - pipenv run ruff --format=github --select=E9,F63,F7,F82 . + pipenv run ruff --select=E9,F63,F7,F82 . - name: Test with pytest run: | pipenv run pytest diff --git a/Pipfile b/Pipfile index 4623256..fca171f 100644 --- a/Pipfile +++ b/Pipfile @@ -6,6 +6,7 @@ name = "pypi" [packages] jinja2 = "*" pillow = "*" +ruff = "*" [dev-packages]