Repository: thriftrw/thriftrw-python (language: python)

Issue:
Update to a Cython version that supports Python 3.10+
Depends on #167 

Part of #166 

Support Python 3.10+
The versions of thriftrw-python uploaded to PyPI do not contain any built with new enough releases of Cython to support Python 3.10+.  There should be a new release of thriftrw-python to support Python 3.10+.


Discussion / hints:

Fix patch:
diff --git a/setup.cfg b/setup.cfg
index 3abd70c..f25e2b4 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,5 +2,5 @@
 create-wheel = yes
 python-file-with-version = thriftrw/__init__.py
 
-[pytest]
+[tool:pytest]
 addopts = --tb short --benchmark-autosave --benchmark-save-data


Test patch:
diff --git a/requirements-test.txt b/requirements-test.txt
index cf349d7..45d0a21 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1,3 +1,3 @@
-pytest==2.7.3
-pytest-cov==2.1.0
-pytest-benchmark[histogram]==3.0.0b1
+pytest==7.2.1
+pytest-cov==4.0.0
+pytest-benchmark[histogram]==4.0.0
diff --git a/tests/conftest.py b/tests/conftest.py
index e44abfd..23c122c 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -29,6 +29,12 @@
 from thriftrw.protocol import BinaryProtocol
 
 
+def pytest_configure(config):
+    config.addinivalue_line(
+        "markers", "unimport: unimport module for test"
+    )
+
+
 def unimport(*names):
     """Removes imported modules from ``sys.modules``.
 
@@ -68,8 +74,7 @@ def test_something():
 
             # ...
     """
-    marker = item.get_marker('unimport')
-    if marker:
+    for marker in item.iter_markers('unimport'):
         unimport(*marker.args)
 
 
diff --git a/tests/protocol/test_binary.py b/tests/protocol/test_binary.py
index 05d4cc8..f83d9c7 100644
--- a/tests/protocol/test_binary.py
+++ b/tests/protocol/test_binary.py
@@ -30,6 +30,7 @@
 from thriftrw.wire import value
 from thriftrw.wire import Message
 from thriftrw.wire.mtype import CALL, REPLY, EXCEPTION, ONEWAY
+from thriftrw.spec.base import TypeSpec
 from thriftrw.spec.primitive import (
     BinaryTypeSpec as sbin,
     BoolTypeSpec as sbool,
@@ -54,6 +55,8 @@
 def reader_writer_ids(x):
     if isinstance(x, (list, value.Value)):
         return None
+    if isinstance(x, TypeSpec):
+        return None
     return ttype.name_of(x)