ionelmc / pytest-benchmark

py.test fixture for benchmarking code
BSD 2-Clause "Simplified" License
1.22k stars 115 forks source link

4.0.0: pytest is failing #228

Closed kloczek closed 1 year ago

kloczek commented 1 year ago

I'm trying to package 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-pytest-benchmark-4.0.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-benchmark-4.0.0-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.15, pytest-7.1.3, pluggy-1.0.0 benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-benchmark-4.0.0, configfile: pytest.ini, testpaths: tests plugins: benchmark-4.0.0, forked-1.4.0, xdist-2.5.0, aspectlib-1.5.2 collected 225 items / 2 errors ================================================================================== ERRORS ================================================================================== ___________________________________________________________ ERROR collecting tests/test_elasticsearch_storage.py ___________________________________________________________ /usr/lib/python3.8/site-packages/requests/__init__.py:105: in check_compatibility( /usr/lib/python3.8/site-packages/requests/__init__.py:84: in check_compatibility assert (2, 0, 0) <= (major, minor, patch) < (3, 0, 0) E AssertionError During handling of the above exception, another exception occurred: tests/test_elasticsearch_storage.py:9: in import elasticsearch /usr/lib/python3.8/site-packages/elasticsearch/__init__.py:24: in from elastic_transport import __version__ as _elastic_transport_version /usr/lib/python3.8/site-packages/elastic_transport/__init__.py:22: in from ._async_transport import AsyncTransport as AsyncTransport /usr/lib/python3.8/site-packages/elastic_transport/_async_transport.py:41: in from ._node import AiohttpHttpNode, BaseAsyncNode /usr/lib/python3.8/site-packages/elastic_transport/_node/__init__.py:21: in from ._http_requests import RequestsHttpNode /usr/lib/python3.8/site-packages/elastic_transport/_node/_http_requests.py:39: in import requests /usr/lib/python3.8/site-packages/requests/__init__.py:109: in warnings.warn( E requests.exceptions.RequestsDependencyWarning: urllib3 (1.26.12) or chardet (None)/charset_normalizer (3.0.0) doesn't match a supported version! ___________________________________________________________ ERROR collecting tests/test_elasticsearch_storage.py ___________________________________________________________ /usr/lib/python3.8/site-packages/requests/__init__.py:105: in check_compatibility( /usr/lib/python3.8/site-packages/requests/__init__.py:84: in check_compatibility assert (2, 0, 0) <= (major, minor, patch) < (3, 0, 0) E AssertionError During handling of the above exception, another exception occurred: tests/test_elasticsearch_storage.py:9: in import elasticsearch /usr/lib/python3.8/site-packages/elasticsearch/__init__.py:24: in from elastic_transport import __version__ as _elastic_transport_version /usr/lib/python3.8/site-packages/elastic_transport/__init__.py:22: in from ._async_transport import AsyncTransport as AsyncTransport /usr/lib/python3.8/site-packages/elastic_transport/_async_transport.py:41: in from ._node import AiohttpHttpNode, BaseAsyncNode /usr/lib/python3.8/site-packages/elastic_transport/_node/__init__.py:21: in from ._http_requests import RequestsHttpNode /usr/lib/python3.8/site-packages/elastic_transport/_node/_http_requests.py:39: in import requests /usr/lib/python3.8/site-packages/requests/__init__.py:109: in warnings.warn( E requests.exceptions.RequestsDependencyWarning: urllib3 (1.26.12) or chardet (None)/charset_normalizer (3.0.0) doesn't match a supported version! ========================================================================= short test summary info ========================================================================== ERROR tests/test_elasticsearch_storage.py - requests.exceptions.RequestsDependencyWarning: urllib3 (1.26.12) or chardet (None)/charset_normalizer (3.0.0) doesn't match a... ERROR tests/test_elasticsearch_storage.py - requests.exceptions.RequestsDependencyWarning: urllib3 (1.26.12) or chardet (None)/charset_normalizer (3.0.0) doesn't match a... !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ============================================================================ 2 errors in 0.65s ============================================================================= ```

Here is list of installed modules in build env

```console Package Version ----------------------------- ----------------- alabaster 0.7.12 appdirs 1.4.4 aspectlib 1.5.2 attrs 22.1.0 Babel 2.10.2 Brlapi 0.8.3 build 0.8.0 certifi 2021.10.8 charset-normalizer 3.0.0 codespell 2.2.1 cssselect 1.1.0 distro 1.7.0 dnspython 2.2.1 docutils 0.18.1 elastic-transport 8.4.0 elasticsearch 8.4.3 execnet 1.9.0 extras 1.0.0 fields 5.0.0 fixtures 4.0.0 freezegun 1.2.1 gpg 1.17.1-unknown idna 3.4 imagesize 1.4.1 importlib-metadata 5.0.0 iniconfig 1.1.1 Jinja2 3.1.1 libcomps 0.1.19 louis 3.23.0 lxml 4.9.1 MarkupSafe 2.1.1 numpy 1.23.1 packaging 21.3 pbr 5.9.0 pep517 0.13.0 pip 22.2.2 pluggy 1.0.0 py 1.11.0 py-cpuinfo 8.0.0 pygal 3.0.0 Pygments 2.13.0 PyGObject 3.42.2 pyparsing 3.0.9 pytest 7.1.3 pytest-forked 1.4.0 pytest-xdist 2.5.0 python-dateutil 2.8.2 pytz 2022.4 requests 2.28.1 rpm 4.17.0 scour 0.38.2 setuptools 65.5.0 six 1.16.0 snowballstemmer 2.2.0 Sphinx 5.3.0 sphinx-py3doc-enhanced-theme 2.4.0 sphinxcontrib-applehelp 1.0.2.dev20220730 sphinxcontrib-devhelp 1.0.2.dev20220730 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1.dev20220730 sphinxcontrib-qthelp 1.0.3.dev20220730 sphinxcontrib-serializinghtml 1.1.5 testtools 2.5.0 tomli 2.0.1 urllib3 1.26.12 wheel 0.37.1 zipp 3.9.0 ```
ionelmc commented 1 year ago

I can't do anything here. It's up to you to resolve this dependency conflict.

kloczek commented 1 year ago

Closing I've opened https://github.com/psf/requests/issues/6272

ionelmc commented 1 year ago

Either way the solution appears to avoid installing requests in the test env. Nothing in pytest-benchmark needs it.

On Thu, Oct 27, 2022 at 4:09 PM Tomasz Kłoczko @.***> wrote:

Closed #228 https://github.com/ionelmc/pytest-benchmark/issues/228 as completed.

— Reply to this email directly, view it on GitHub https://github.com/ionelmc/pytest-benchmark/issues/228#event-7682160728, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7TXKNTKQOEQBLQZ3Y3X3WFJ5HHANCNFSM6AAAAAARQAZZBQ . You are receiving this because you commented.Message ID: @.***>