Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test against Python 3.13 #16

Merged
merged 11 commits into from
Jul 24, 2024
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion brother_ql_web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion stubs/bottle.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ...): ...
Expand Down