ionelmc / python-hunter

Hunter is a flexible code tracing toolkit.
https://python-hunter.readthedocs.io/
BSD 2-Clause "Simplified" License
800 stars 46 forks source link

4 errors during tests: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. #114

Closed yurivict closed 1 year ago

yurivict commented 1 year ago
===>  Testing for py39-hunter-3.5.1
===>   py39-hunter-3.5.1 depends on package: py39-pytest>=7,1 - found
===>   py39-hunter-3.5.1 depends on file: /usr/local/bin/python3.9 - found
cd /usr/ports/devel/py-hunter/work-py39/hunter-3.5.1 && /usr/bin/env XDG_DATA_HOME=/usr/ports/devel/py-hunter/work-py39  XDG_CONFIG_HOME=/usr/ports/devel/py-hunter/work-py39  XDG_CACHE_HOME=/usr/ports/devel/py-hunter/work-py39/.cache  HOME=/usr/ports/devel/py-hunter/work-py39 PATH=/usr/local/libexec/ccache:/usr/ports/devel/py-hunter/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/devel/py-hunter/work-py39/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" PYTHONPATH=/usr/ports/devel/py-hunter/work-py39/stage/usr/local/lib/python3.9/site-packages /usr/local/bin/python3.9 -m pytest -k '' -rs -v -o addopts= 
========================================================================================== test session starts ==========================================================================================
platform freebsd13 -- Python 3.9.16, pytest-7.2.0, pluggy-1.0.0 -- /usr/local/bin/python3.9
cachedir: .pytest_cache
Using --randomly-seed=3727744318
rootdir: /usr/ports/devel/py-hunter/work-py39/hunter-3.5.1, configfile: pytest.ini, testpaths: tests
plugins: cov-2.9.0, randomly-3.12.0, flaky-3.7.0, env-0.6.2, freezegun-0.4.2, mock-1.10.4, timeout-2.1.0, forked-1.4.0, anyio-3.6.2, rerunfailures-10.1, xdist-2.5.0, nbval-0.10.0
collected 98 items / 4 errors                                                                                                                                                                           
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 270, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 334, in pytest_collection
INTERNALERROR>     session.perform_collect()
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 667, in perform_collect
INTERNALERROR>     hook.pytest_collection_modifyitems(
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pytest_freezegun.py", line 55, in pytest_collection_modifyitems
INTERNALERROR>     if get_closest_marker(item, MARKER_NAME):
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pytest_freezegun.py", line 17, in get_closest_marker
INTERNALERROR>     if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'):
INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/version.py", line 55, in __init__
INTERNALERROR>     warnings.warn(
INTERNALERROR> DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

=========================================================================================== 4 errors in 1.27s ===========================================================================================
*** Error code 3

Version: 3.5.1 Python-3.9 FreeBSD 13.1

ionelmc commented 1 year ago

This is a pytest-freezegun issue:

INTERNALERROR>   File "/usr/local/lib/python3.9/site-packages/pytest_freezegun.py", line 17, in get_closest_marker
INTERNALERROR>     if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'):

I think they fixed cause I don't see this warning.