Skip to content

Commit

Permalink
Update dependencies and update project
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCat467 committed Dec 23, 2024
1 parent ec1c6fa commit 901d330
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 101 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/autodeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup python
uses: actions/setup-python@v5
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ jobs:
}}
steps:
- name: Checkout
with:
persist-credentials: false
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/codeql.yml

This file was deleted.

16 changes: 11 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
rev: v0.8.4
hooks:
- id: ruff
types: [file]
Expand All @@ -39,16 +39,22 @@ repos:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/crate-ci/typos
rev: v1.28.4
hooks:
- id: typos
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v0.9.2
hooks:
- id: zizmor
- repo: local
hooks:
- id: project-requirements
name: regenerate requirements.in
language: system
entry: python tools/project_requirements.py
language: python
entry: tools/project_requirements.py
pass_filenames: false
files: ^(test-requirements.in)|(pyproject.toml)$
- repo: local
hooks:
- id: regenerate-files
name: regenerate generated files
language: system
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies = [
"hypercorn[trio]~=0.17.3",
"Pillow~=11.0.0",
"python-sane~=2.9.1",
"quart~=0.19.4",
"quart~=0.20.0",
"quart-trio~=0.11.1",
"trio~=0.27.0",
"Werkzeug~=3.1.3",
Expand Down
2 changes: 2 additions & 0 deletions src/sanescansrv/generate_pages.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

"""Generate pages for the sane scanner web server.
Copyright (C) 2022-2024 CoolCat467
Expand Down
16 changes: 8 additions & 8 deletions src/sanescansrv/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def progress(current: int, total: int) -> None:
return filename


@app.get("/scan/<scan_filename>") # type: ignore[type-var]
@app.get("/scan/<scan_filename>")
@pretty_exception
async def handle_scan_get(
scan_filename: str,
Expand All @@ -529,7 +529,7 @@ async def handle_scan_get(
return await send_file(temp_file, attachment_filename=scan_filename)

Check failure on line 529 in src/sanescansrv/server.py

View workflow job for this annotation

GitHub Actions / Ubuntu (3.12, check formatting)

Mypy-Linux+Mac+Windows

src/sanescansrv/server.py:(516:2 - 529:72): Value of type variable "T_route" of function cannot be "Callable[[str], Awaitable[tuple[AsyncIterator[str], int] | Response]]" [type-var]


@app.get("/scan-status") # type: ignore[type-var]
@app.get("/scan-status")
@pretty_exception
async def scan_status_get() -> (
AsyncIterator[str] | tuple[AsyncIterator[str], int] | WerkzeugResponse
Expand Down Expand Up @@ -593,7 +593,7 @@ async def scan_status_get() -> (
)

Check failure on line 593 in src/sanescansrv/server.py

View workflow job for this annotation

GitHub Actions / Ubuntu (3.12, check formatting)

Mypy-Linux+Mac+Windows

src/sanescansrv/server.py:(532:2 - 593:5): Value of type variable "T_route" of function cannot be "Callable[[], Awaitable[AsyncIterator[str] | tuple[AsyncIterator[str], int] | Response]]" [type-var]


@app.get("/") # type: ignore[type-var]
@app.get("/")
async def root_get() -> AsyncIterator[str]:
"""Handle main page GET request."""
scanners = {}
Expand All @@ -617,7 +617,7 @@ async def root_get() -> AsyncIterator[str]:
)

Check failure on line 617 in src/sanescansrv/server.py

View workflow job for this annotation

GitHub Actions / Ubuntu (3.12, check formatting)

Mypy-Linux+Mac+Windows

src/sanescansrv/server.py:(596:2 - 617:5): Value of type variable "T_route" of function cannot be "Callable[[], Coroutine[Any, Any, AsyncIterator[str]]]" [type-var]


@app.post("/") # type: ignore[type-var]
@app.post("/")
@pretty_exception
async def root_post() -> (
WerkzeugResponse | AsyncIterator[str] | tuple[AsyncIterator[str], int]
Expand Down Expand Up @@ -675,7 +675,7 @@ async def update_scanners_async() -> bool:
return True


@app.get("/update_scanners") # type: ignore[type-var]
@app.get("/update_scanners")
@pretty_exception
async def update_scanners_get() -> (
WerkzeugResponse | AsyncIterator[str] | tuple[AsyncIterator[str], int]
Expand All @@ -692,7 +692,7 @@ async def update_scanners_get() -> (
return app.redirect("scanners")

Check failure on line 692 in src/sanescansrv/server.py

View workflow job for this annotation

GitHub Actions / Ubuntu (3.12, check formatting)

Mypy-Linux+Mac+Windows

src/sanescansrv/server.py:(678:2 - 692:35): Value of type variable "T_route" of function cannot be "Callable[[], Awaitable[Response | AsyncIterator[str] | tuple[AsyncIterator[str], int]]]" [type-var]


@app.get("/scanners") # type: ignore[type-var]
@app.get("/scanners")
async def scanners_get() -> AsyncIterator[str]:
"""Scanners page get handling."""
scanners = {}
Expand Down Expand Up @@ -803,7 +803,7 @@ def get_setting_radio(setting: DeviceSetting) -> str | None:
)


@app.get("/settings") # type: ignore[type-var]
@app.get("/settings")
async def settings_get() -> AsyncIterator[str] | WerkzeugResponse:
"""Handle settings page GET."""
scanner = request.args.get("scanner", "none")
Expand All @@ -827,7 +827,7 @@ async def settings_get() -> AsyncIterator[str] | WerkzeugResponse:
)

Check failure on line 827 in src/sanescansrv/server.py

View workflow job for this annotation

GitHub Actions / Ubuntu (3.12, check formatting)

Mypy-Linux+Mac+Windows

src/sanescansrv/server.py:(806:2 - 827:5): Value of type variable "T_route" of function cannot be "Callable[[], Coroutine[Any, Any, AsyncIterator[str] | Response]]" [type-var]


@app.post("/settings") # type: ignore[type-var]
@app.post("/settings")
async def settings_post() -> tuple[AsyncIterator[str], int] | WerkzeugResponse:
"""Handle settings page POST."""
scanner = request.args.get("scanner", "none")
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exceptiongroup >= 1.2.0; python_version < "3.11"
hypercorn[trio]~=0.17.3
python-sane~=2.9.1
quart-trio~=0.11.1
quart~=0.19.4
quart~=0.20.0
tomli >= 2.0.1; python_version < "3.11"
trio~=0.27.0
#</TOML_DEPENDENCIES>
23 changes: 12 additions & 11 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# uv pip compile --universal --python-version=3.9 test-requirements.in -o test-requirements.txt
aiofiles==24.1.0
# via quart
attrs==24.2.0
attrs==24.3.0
# via
# outcome
# trio
Expand All @@ -14,18 +14,18 @@ blinker==1.9.0
# quart
cffi==1.17.1 ; implementation_name != 'pypy' and os_name == 'nt'
# via trio
click==8.1.7
click==8.1.8
# via
# black
# flask
# quart
codespell==2.3.0
# via -r test-requirements.in
colorama==0.4.6 ; sys_platform == 'win32' or platform_system == 'Windows'
colorama==0.4.6 ; sys_platform == 'win32'
# via
# click
# pytest
coverage==7.6.8
coverage==7.6.9
# via
# -r test-requirements.in
# pytest-cov
Expand Down Expand Up @@ -66,7 +66,7 @@ itsdangerous==2.2.0
# via
# flask
# quart
jinja2==3.1.4
jinja2==3.1.5
# via
# flask
# quart
Expand All @@ -75,7 +75,7 @@ markupsafe==3.0.2
# jinja2
# quart
# werkzeug
mypy==1.13.0
mypy==1.14.0
# via -r test-requirements.in
mypy-extensions==1.0.0
# via
Expand Down Expand Up @@ -104,7 +104,7 @@ priority==2.0.0
# via hypercorn
pycparser==2.22 ; implementation_name != 'pypy' and os_name == 'nt'
# via cffi
pytest==8.3.3
pytest==8.3.4
# via
# -r test-requirements.in
# pytest-cov
Expand All @@ -115,19 +115,19 @@ pytest-trio==0.8.0
# via -r test-requirements.in
python-sane==2.9.1
# via -r test-requirements.in
quart==0.19.9
quart==0.20.0
# via
# -r test-requirements.in
# quart-trio
quart-trio==0.11.1
# via -r test-requirements.in
ruff==0.8.1
ruff==0.8.4
# via -r test-requirements.in
sniffio==1.3.1
# via trio
sortedcontainers==2.4.0
# via trio
taskgroup==0.0.0a4 ; python_full_version < '3.11'
taskgroup==0.2.1 ; python_full_version < '3.11'
# via hypercorn
tomli==2.2.1 ; python_full_version <= '3.11'
# via
Expand All @@ -150,7 +150,8 @@ typing-extensions==4.12.2
# hypercorn
# mypy
# quart
uv==0.5.5
# taskgroup
uv==0.5.11
# via -r test-requirements.in
werkzeug==3.1.3
# via
Expand Down

0 comments on commit 901d330

Please sign in to comment.