From 6efcdcf9a391150703113355363eafafb53ac69d Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 1 Jan 2025 16:18:36 -1000 Subject: [PATCH] fix for py 3.13 --- pyproject.toml | 11 ++++++----- tests/test_model.py | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b43e6d9c..e09d4df3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,10 +57,10 @@ test = [ "pytest-mypy-plugins", "pytest", "ruff", - "xmlschema <2.5", # FIXME: determine why + "xmlschema <2.5", # FIXME: determine why "xsdata[cli]", "types-lxml", - "pdbpp; sys_platform != 'win32'", # for debugging + "pdbpp; sys_platform != 'win32'", # for debugging ] test-qt = ["qtpy", "pytest-qt"] # pin ruff for builds because it changes often @@ -158,9 +158,10 @@ filterwarnings = [ "ignore:Casting invalid AnnotationID:UserWarning", # FIXME: i think this might be an xsdata issue? "ignore::ResourceWarning", - "ignore:pkg_resources is deprecated", # paquo tests - "ignore:::paquo", # paquo tests - "ignore:the imp module is deprecated", # omero tests + "ignore:pkg_resources is deprecated", # paquo tests + "ignore:::paquo", # paquo tests + "ignore:the imp module is deprecated", # omero tests + "ignore:Failing to pass a value:DeprecationWarning", # xsdata ] # https://mypy.readthedocs.io/en/stable/config_file.html diff --git a/tests/test_model.py b/tests/test_model.py index 1ed196f1..7406043f 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -3,6 +3,7 @@ import copy import datetime import io +import sys import warnings from pathlib import Path from typing import Any @@ -235,6 +236,9 @@ def test_transformations() -> None: # should not warn with warnings.catch_warnings(): warnings.simplefilter("error") + # this is needed for xsdata usage of private typing attribute + if sys.version_info >= (3, 13): + warnings.simplefilter("ignore", DeprecationWarning) from_xml(DATA / "MMStack.ome.xml", transformations=etree_fixes.ALL_FIXES) # SHOULD warn