python-attrs / cattrs

Composable custom class converters for attrs, dataclasses and friends.
https://catt.rs
MIT License
779 stars 108 forks source link

23.2.3: test suite fails with pytest 8.2.1 #539

Closed kloczek closed 1 month ago

kloczek commented 1 month ago

Description

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-cattrs-23.2.3-5.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-cattrs-23.2.3-5.fc37.x86_64/usr/lib/python3.10/site-packages + /usr/bin/pytest -ra -m 'not network' ImportError while loading conftest '/home/tkloczko/rpmbuild/BUILD/cattrs-23.2.3/tests/conftest.py'. tests/__init__.py:6: in from cattrs import UnstructureStrategy ../../BUILDROOT/python-cattrs-23.2.3-5.fc37.x86_64/usr/lib/python3.10/site-packages/cattrs/__init__.py:1: in from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy ../../BUILDROOT/python-cattrs-23.2.3-5.fc37.x86_64/usr/lib/python3.10/site-packages/cattrs/converters.py:25: in from ._compat import ( ../../BUILDROOT/python-cattrs-23.2.3-5.fc37.x86_64/usr/lib/python3.10/site-packages/cattrs/_compat.py:51: in assert sys.version_info >= (3, 11) E AssertionError ```
List of installed modules in build env: ```console Package Version ----------------------------- ----------- alabaster 0.7.16 attrs 23.2.0 Babel 2.15.0 bson 0.5.10 build 1.2.1 cbor2 5.6.3 charset-normalizer 3.3.2 defusedxml 0.7.1 docutils 0.20.1 exceptiongroup 1.1.3 hatch-vcs 0.4.0 hatchling 1.24.2 hypothesis 6.100.0 idna 3.7 imagesize 1.4.1 immutables 0.20 importlib_metadata 7.1.0 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.4 markdown-it-py 3.0.0 MarkupSafe 2.1.5 mdit-py-plugins 0.4.1 mdurl 0.1.2 msgpack 1.0.8 myst-parser 3.0.1 orjson 3.10.3 packaging 24.0 pathspec 0.12.1 pluggy 1.5.0 py-cpuinfo 9.0.0 Pygments 2.18.0 pyproject_hooks 1.0.0 pytest 8.2.1 pytest-benchmark 4.0.0 python-dateutil 2.9.0.post0 PyYAML 6.0.1 requests 2.32.2 setuptools 69.4.0 setuptools-scm 8.1.0 snowballstemmer 2.2.0 sortedcontainers 2.4.0 Sphinx 7.3.7 sphinx-copybutton 0.5.2 sphinxcontrib-applehelp 1.0.8 sphinxcontrib-devhelp 1.0.6 sphinxcontrib-htmlhelp 2.0.5 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.7 sphinxcontrib-serializinghtml 1.1.10 tokenize_rt 5.2.0 tomli 2.0.1 tomlkit 0.12.5 trove-classifiers 2024.5.24 ujson 5.10.0 urllib3 2.2.1 wheel 0.43.0 zipp 3.18.2 ```

Please let me know if you need more details or want me to perform some diagnostics.

Tinche commented 1 month ago

Judging from the pasted output, you're using Python 3.10 to run the tests, right?

kloczek commented 1 month ago

Yes typo .. 3.10.14.

Tinche commented 1 month ago

On 3.10 we require typing_extensions (see https://github.com/python-attrs/cattrs/blob/23.2/pyproject.toml#L54), but it doesn't seem to be present in your package list.

kloczek commented 1 month ago

3.10 comes with typing which should be used instead typing_extensions.

Tinche commented 1 month ago

Unfortunately it's much more complicated than that, and there may be various reasons to use typing_extensions on any python version. In any case, your build setup isn't bringing in the required dependencies.