diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9096ea1..c94d8e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,7 @@ jobs: - python: '3.10' - python: '3.11' - python: '3.12' + - python: '3.13-dev' runs-on: ubuntu-latest name: Python ${{ matrix.python }} steps: @@ -38,15 +39,24 @@ jobs: - name: install package run: | python -m pip install .[dev,mypy] + # Bottle still depends on the old `cgi` module removed in Python 3.13, + # thus provide it here. + # Avoid the additional error: + # RuntimeError: 'cgi' was slated for removal after Python 3.13 alpha + - name: prepare cgi module (Python 3.13) + run: | + wget https://github.com/python/cpython/raw/3.12/Lib/cgi.py + sed --in-place 's/warnings._deprecated(__name__, remove=(3,13))//' cgi.py + if: ${{ matrix.python == '3.13-dev' }} - name: run tests run: python -m unittest discover --verbose --start-directory tests - name: run flake8 run: - python -m flake8 . + python -m flake8 --extend-exclude "cgi.py" . - name: run black run: - black --check --diff . + black --check --diff --extend-exclude "cgi.py" . - name: run mypy run: mypy brother_ql_web/ tests/ diff --git a/brother_ql_web/__init__.py b/brother_ql_web/__init__.py index de9521f..5285cd6 100644 --- a/brother_ql_web/__init__.py +++ b/brother_ql_web/__init__.py @@ -20,7 +20,7 @@ def warn(message: str, *args: Any, **kwargs: Any) -> None: return original_logger(message, *args, **kwargs) - logging.getLogger("brother_ql.devicedependent").warn = warn # type: ignore[assignment,method-assign] # noqa: E501 + logging.getLogger("brother_ql.devicedependent").warn = warn # type: ignore[assignment,method-assign,attr-defined,unused-ignore] # noqa: E501 patch_deprecation_warning() diff --git a/pyproject.toml b/pyproject.toml index 8b266d5..70339c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,5 +84,5 @@ strict = true files = "brother_ql_web,tests" [tool.codespell] -skip = "*.min.js*,*.min.css*,venv*" +skip = "*.min.js*,*.min.css*,venv*,cgi.py" ignore-words-list = "assertIn" diff --git a/stubs/bottle.pyi b/stubs/bottle.pyi index ec2d5e8..2dd3716 100644 --- a/stubs/bottle.pyi +++ b/stubs/bottle.pyi @@ -431,7 +431,7 @@ class ConfigDict(dict): def load_config(self, filename, **options): ... def load_dict(self, source, namespace: str = ...): ... def update(self, *a, **ka) -> None: ... - def setdefault(self, key, value): ... + def setdefault(self, key: Any, value: Any = None): ... def __setitem__(self, key, value): ... def __delitem__(self, key) -> None: ... def meta_get(self, key, metafield, default: Incomplete | None = ...): ...