DiamondLightSource / DiamondLightSource/observability-utils

Support Python3.12

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Currently causes the following test failures:

```shell
______________________ ERROR collecting tests/test_cli.py ______________________
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/runner.py", line 341, in from_call
result: TResult | None = func()
^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/runner.py", line 389, in collect
return list(collector.collect())
^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/python.py", line 549, in collect
self._register_setup_module_fixture()
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/python.py", line 562, in _register_setup_module_fixture
self.obj, ("setUpModule", "setup_module")
^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/python.py", line 284, in obj
self._obj = obj = self._getobj()
^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/python.py", line 546, in _getobj
return importtestmodule(self.path, self.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/python.py", line 493, in importtestmodule
mod = import_path(
^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/pathlib.py", line 582, in import_path
importlib.import_module(module_name)
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 174, in exec_module
exec(co, module.__dict__)
File "/home/runner/work/observability-utils/observability-utils/tests/test_cli.py", line 4, in
from observability_utils import __version__
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/observability_utils/__init__.py", line 10, in
from .tracing import (
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/observability_utils/tracing.py", line 3, in
from fastapi import FastAPI
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fastapi/__init__.py", line 7, in
from .applications import FastAPI as FastAPI
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fastapi/applications.py", line 16, in
from fastapi import routing
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fastapi/routing.py", line 22, in
from fastapi import params
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fastapi/params.py", line 4, in
from pydantic.fields import FieldInfo, Undefined
File "pydantic/__init__.py", line 2, in init pydantic.__init__
File "pydantic/dataclasses.py", line 48, in init pydantic.dataclasses
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/typing_extensions.py", line 1174, in
class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type
____________________ ERROR collecting tests/test_tracing.py ____________________
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/runner.py", line 341, in from_call
result: TResult | None = func()
^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/runner.py", line 389, in collect
return list(collector.collect())
^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/python.py", line 549, in collect
self._register_setup_module_fixture()
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/python.py", line 562, in _register_setup_module_fixture
self.obj, ("setUpModule", "setup_module")
^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/python.py", line 284, in obj
self._obj = obj = self._getobj()
^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/python.py", line 546, in _getobj
return importtestmodule(self.path, self.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/python.py", line 493, in importtestmodule
mod = import_path(
^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/pathlib.py", line 582, in import_path
importlib.import_module(module_name)
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 174, in exec_module
exec(co, module.__dict__)
File "/home/runner/work/observability-utils/observability-utils/tests/test_tracing.py", line 3, in
from fastapi import FastAPI
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fastapi/__init__.py", line 7, in
from .applications import FastAPI as FastAPI
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fastapi/applications.py", line 16, in
from fastapi import routing
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fastapi/routing.py", line 22, in
from fastapi import params
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fastapi/params.py", line 4, in
from pydantic.fields import FieldInfo, Undefined
File "pydantic/__init__.py", line 2, in init pydantic.__init__
File "pydantic/dataclasses.py", line 48, in init pydantic.dataclasses
File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/typing_extensions.py", line 1174, in
class TypeVar(typing.TypeVar, _DefaultMixin, _root=True):
TypeError: type 'typing.TypeVar' is not an acceptable base type
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.