diff --git a/evalai/utils/updates.py b/evalai/utils/updates.py index 3c08818f..4d9d11e9 100644 --- a/evalai/utils/updates.py +++ b/evalai/utils/updates.py @@ -1,6 +1,6 @@ import requests -from distutils.version import StrictVersion +from packaging.version import Version as StrictVersion def get_latest_version(): diff --git a/requirements.txt b/requirements.txt index 48e9fbc1..325caa97 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,8 @@ beautifultable==0.7.0 boto3>=1.9.88 click==6.7 docker==3.6.0 -lxml==4.6.2 +lxml>=4.6.2,<5.0; python_version < "3.12" +lxml>=5.0.0; python_version >= "3.12" python-dateutil==2.7.3 requests==2.25.1 validators==0.12.6 diff --git a/setup.py b/setup.py index 862118f8..5c0cbaed 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,15 @@ #!/usr/bin/env python import io +import os import sys from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand -from distutils.util import convert_path + + +# We use a manual way to find the version file path for CI compatibility +def get_version_path(*paths): + return os.path.join(os.path.dirname(__file__), *paths) class PyTest(TestCommand): @@ -15,13 +20,12 @@ def finalize_options(self): def run_tests(self): import pytest - sys.exit(pytest.main(self.test_args)) PROJECT = "evalai" package_config = {} -version_file_path = convert_path("evalai/version.py") +version_file_path = get_version_path("evalai", "version.py") with io.open("README.md", encoding="utf-8") as f: long_description = f.read() @@ -34,6 +38,7 @@ def run_tests(self): tests_require = [ "coverage", + "packaging", "coveralls==1.3.0", "flake8==3.0.4", "pytest==3.5.1",