From 6edcaddd8e4f4e53c4ba0998306dde4b3d877617 Mon Sep 17 00:00:00 2001 From: James Butler Date: Thu, 13 Nov 2025 10:54:35 -0500 Subject: [PATCH 1/5] ENH: Update Logging filter type Python logging should have filter functions that return a boolean instead of int. --- src/dicomweb_client/log.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dicomweb_client/log.py b/src/dicomweb_client/log.py index 746e1c8..512e0e2 100644 --- a/src/dicomweb_client/log.py +++ b/src/dicomweb_client/log.py @@ -3,7 +3,7 @@ import logging -def _filter_header_parsing_error(record: logging.LogRecord) -> int: +def _filter_header_parsing_error(record: logging.LogRecord) -> bool: """Filters warnings of ``urllib3.exceptions.HeaderParsingError``. Parameters @@ -13,13 +13,13 @@ def _filter_header_parsing_error(record: logging.LogRecord) -> int: Returns ------- - int - zero if the record should be filtered, non-zero otherwise + bool + False if the record should be filtered, True otherwise """ if 'Failed to parse headers' in record.getMessage(): - return 0 - return 1 + return False + return True def _map_logging_verbosity(verbosity: int) -> int: From bd5ad5d8b64412c73ef760afbffacb978922cf01 Mon Sep 17 00:00:00 2001 From: James Butler Date: Thu, 13 Nov 2025 10:58:35 -0500 Subject: [PATCH 2/5] BUG: Fix unreachable code The type hint was too specific indicating the tuple required 2 strings, however there is code logic with an assumption that the tuple has a single element string. --- src/dicomweb_client/file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dicomweb_client/file.py b/src/dicomweb_client/file.py index 612c1f1..b1a421d 100644 --- a/src/dicomweb_client/file.py +++ b/src/dicomweb_client/file.py @@ -461,7 +461,7 @@ class _QueryResourceType(Enum): def _build_acceptable_media_type_lut( - media_types: Tuple[Union[str, Tuple[str, str]], ...], + media_types: Tuple[Union[str, Tuple[str, ...]], ...], supported_media_type_lut: Mapping[str, Iterable[str]] ) -> Mapping[str, Iterable[str]]: # If no acceptable transfer syntax has been specified, then we just return From 90206114d27582ca41f51b3b4b45eba8d081c852 Mon Sep 17 00:00:00 2001 From: James Butler Date: Thu, 13 Nov 2025 09:19:26 -0500 Subject: [PATCH 3/5] ENH: Bump mypy to latest version This includes support for Python 3.14 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 09993c3..2770083 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ gcp = ["dataclasses>=0.8; python_version=='3.6'", "google-auth>=1.6"] [dependency-groups] test = [ - "mypy==0.982", + "mypy==1.18.2", "flake8==6.1.0", "pytest==7.1.3", "pytest-cov==3.0.0", From 5076ef5bc9ea1c545a4487a803bd6d0146886b63 Mon Sep 17 00:00:00 2001 From: James Butler Date: Thu, 13 Nov 2025 11:04:05 -0500 Subject: [PATCH 4/5] ENH: Bump pytest to latest version This update adds support for Python 3.14. --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2770083..1600c09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,8 +43,8 @@ gcp = ["dataclasses>=0.8; python_version=='3.6'", "google-auth>=1.6"] test = [ "mypy==1.18.2", "flake8==6.1.0", - "pytest==7.1.3", - "pytest-cov==3.0.0", + "pytest==9.0.1", + "pytest-cov==7.0.0", "pytest-flake8==1.1.3", "pytest-localserver==0.5.0", "types-requests==2.27.14", From f695f5fcb5a0d4d884bb62b7e54330ae97b43fb3 Mon Sep 17 00:00:00 2001 From: James Butler Date: Wed, 12 Nov 2025 22:34:01 -0500 Subject: [PATCH 5/5] ENH: Specify explicit support for Python 3.14 --- .github/workflows/run_unit_tests.yml | 3 ++- pyproject.toml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index 5b6258a..927d04c 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -19,7 +19,8 @@ jobs: "3.10", "3.11", "3.12", - "3.13" + "3.13", + "3.14" ] steps: diff --git a/pyproject.toml b/pyproject.toml index 1600c09..dcabe36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] dependencies = [ "numpy>=1.19",