From 2b919107b5fefef8d99e26359ea4f2e37d157593 Mon Sep 17 00:00:00 2001 From: Holger Nahrstaedt Date: Mon, 11 Mar 2024 08:42:07 +0100 Subject: [PATCH] Remove distutils --- conftest.py | 8 ++++---- pyproject.toml | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/conftest.py b/conftest.py index b52739e..03d7841 100644 --- a/conftest.py +++ b/conftest.py @@ -7,16 +7,16 @@ import platform import sys -from distutils.version import LooseVersion +from packaging.version import Version, parse import pytest from _pytest.doctest import DoctestItem from skopt import _IS_32BIT -PYTEST_MIN_VERSION = '3.3.0' +PYTEST_MIN_VERSION = '3.6.0' -if LooseVersion(pytest.__version__) < PYTEST_MIN_VERSION: +if parse(pytest.__version__) < Version(PYTEST_MIN_VERSION): raise ImportError( 'Your version of pytest is too old, you should have ' 'at least pytest >= {} installed.'.format(PYTEST_MIN_VERSION) @@ -52,7 +52,7 @@ def pytest_collection_modifyitems(config, items): try: import numpy as np - if LooseVersion(np.__version__) < LooseVersion('1.14'): + if parse(np.__version__) < Version('1.14'): reason = 'doctests are only run for numpy >= 1.14' skip_doctests = True elif _IS_32BIT: diff --git a/pyproject.toml b/pyproject.toml index 221f539..55fba54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ dependencies = [ "numpy>=1.20.3", "scipy>=1.1.0", "scikit-learn>=1.0.0", + "packaging>=21.3", ] version = "0.10.0rc1"