From a49195ddbe85a0468a805ba1df1eba10d22ad3c9 Mon Sep 17 00:00:00 2001 From: Aparup Roy <24f3001874@ds.study.iitm.ac.in> Date: Sat, 3 Jan 2026 00:44:40 +0530 Subject: [PATCH 1/9] Fix lxml and distutils compatibility for Python 3.13 --- evalai/utils/updates.py | 3 +-- requirements.txt | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/evalai/utils/updates.py b/evalai/utils/updates.py index 3c08818f0..c29dd2d1e 100644 --- a/evalai/utils/updates.py +++ b/evalai/utils/updates.py @@ -1,7 +1,6 @@ import requests -from distutils.version import StrictVersion - +from packaging.version import Version as StrictVersion def get_latest_version(): url = "https://pypi.org/pypi/evalai/json" diff --git a/requirements.txt b/requirements.txt index 48e9fbc17..325caa970 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 From bcc998b7599c4d0ac039bae04b0e233eb3d4470a Mon Sep 17 00:00:00 2001 From: Aparup Roy <24f3001874@ds.study.iitm.ac.in> Date: Sat, 3 Jan 2026 01:04:59 +0530 Subject: [PATCH 2/9] Fix CI build: replace distutils with setuptools and add packaging --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 862118f8a..6e52ece04 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand -from distutils.util import convert_path +from setuptools import convert_path # Changed from distutils to setuptools class PyTest(TestCommand): @@ -34,6 +34,7 @@ def run_tests(self): tests_require = [ "coverage", + "packaging", # Added to fix the Travis CI ModuleNotFoundError "coveralls==1.3.0", "flake8==3.0.4", "pytest==3.5.1", @@ -68,4 +69,4 @@ def run_tests(self): include_package_data=True, entry_points={"console_scripts": ["evalai=evalai.main:main"]}, zip_safe=False, -) +) \ No newline at end of file From 9075f3916e829e123db83e21b11bb1dc82316c33 Mon Sep 17 00:00:00 2001 From: Aparup Roy <24f3001874@ds.study.iitm.ac.in> Date: Sat, 3 Jan 2026 01:15:19 +0530 Subject: [PATCH 3/9] Fix: Add compatibility fallback from convert_path and add packaging to tests --- setup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6e52ece04..7762e940c 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,12 @@ from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand -from setuptools import convert_path # Changed from distutils to setuptools + +# Safe import for convert_path to support Python 3.8 through 3.13 +try: + from setuptools import convert_path +except ImportError: + from distutils.util import convert_path class PyTest(TestCommand): @@ -34,7 +39,7 @@ def run_tests(self): tests_require = [ "coverage", - "packaging", # Added to fix the Travis CI ModuleNotFoundError + "packaging", # Required for version parsing in updates.py "coveralls==1.3.0", "flake8==3.0.4", "pytest==3.5.1", From 99d98feeafd354fad788b25e4785b0f5ab34054d Mon Sep 17 00:00:00 2001 From: Aparup Roy <24f3001874@ds.study.iitm.ac.in> Date: Sat, 3 Jan 2026 01:21:24 +0530 Subject: [PATCH 4/9] Final fix: Add compatibility fallbacks and packaging for CI --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7762e940c..14cf3a47f 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ from setuptools.command.test import test as TestCommand # Safe import for convert_path to support Python 3.8 through 3.13 +# This fixes the removal of distutils in 3.12+ while maintaining 3.8 support try: from setuptools import convert_path except ImportError: @@ -37,9 +38,10 @@ def run_tests(self): with open(version_file_path) as version_file: exec(version_file.read(), package_config) +# Added 'packaging' here to ensure Travis CI installs it for the test environment tests_require = [ "coverage", - "packaging", # Required for version parsing in updates.py + "packaging", "coveralls==1.3.0", "flake8==3.0.4", "pytest==3.5.1", From 76a0d08424b383cf5047fe9b530ca96511885cc6 Mon Sep 17 00:00:00 2001 From: Aparup Roy <24f3001874@ds.study.iitm.ac.in> Date: Sat, 3 Jan 2026 01:29:35 +0530 Subject: [PATCH 5/9] Final attempt: Removing convert_path dependancy to fix CI --- setup.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 14cf3a47f..41fcc1a93 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +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 -# Safe import for convert_path to support Python 3.8 through 3.13 -# This fixes the removal of distutils in 3.12+ while maintaining 3.8 support -try: - from setuptools import convert_path -except ImportError: - from distutils.util import convert_path - +# We are removing 'convert_path' entirely to fix the Travis CI crash. +# This manual path join is safe for all Python versions (3.8 - 3.13). +def get_version_path(*paths): + return os.path.join(os.path.dirname(__file__), *paths) class PyTest(TestCommand): def finalize_options(self): @@ -21,13 +19,11 @@ 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() @@ -38,7 +34,6 @@ def run_tests(self): with open(version_file_path) as version_file: exec(version_file.read(), package_config) -# Added 'packaging' here to ensure Travis CI installs it for the test environment tests_require = [ "coverage", "packaging", From fa86dae851a8a971ca817094168c983eea1ddf7d Mon Sep 17 00:00:00 2001 From: Aparup Roy <24f3001874@ds.study.iitm.ac.in> Date: Sat, 3 Jan 2026 01:41:48 +0530 Subject: [PATCH 6/9] Updated dependancy to fix CI --- setup.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 41fcc1a93..9fce21107 100644 --- a/setup.py +++ b/setup.py @@ -6,11 +6,6 @@ from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand -# We are removing 'convert_path' entirely to fix the Travis CI crash. -# This manual path join is safe for all Python versions (3.8 - 3.13). -def get_version_path(*paths): - return os.path.join(os.path.dirname(__file__), *paths) - class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) @@ -23,7 +18,10 @@ def run_tests(self): PROJECT = "evalai" package_config = {} -version_file_path = get_version_path("evalai", "version.py") + +# Use a totally manual way to find the version file path +base_dir = os.path.abspath(os.path.dirname(__file__)) +version_file_path = os.path.join(base_dir, "evalai", "version.py") with io.open("README.md", encoding="utf-8") as f: long_description = f.read() @@ -31,6 +29,7 @@ def run_tests(self): with open("requirements.txt") as f: requirements = f.read().splitlines() +# Load version manually with open(version_file_path) as version_file: exec(version_file.read(), package_config) From e22a0e5bb724671c17dda2bf139214eb496f91cb Mon Sep 17 00:00:00 2001 From: Aparup Roy <24f3001874@ds.study.iitm.ac.in> Date: Sat, 3 Jan 2026 01:46:59 +0530 Subject: [PATCH 7/9] Updated dependancy check for CI --- setup.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 9fce21107..06b830341 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,12 @@ from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand + +# 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): def finalize_options(self): TestCommand.finalize_options(self) @@ -16,12 +22,10 @@ def run_tests(self): import pytest sys.exit(pytest.main(self.test_args)) + PROJECT = "evalai" package_config = {} - -# Use a totally manual way to find the version file path -base_dir = os.path.abspath(os.path.dirname(__file__)) -version_file_path = os.path.join(base_dir, "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() @@ -29,7 +33,6 @@ def run_tests(self): with open("requirements.txt") as f: requirements = f.read().splitlines() -# Load version manually with open(version_file_path) as version_file: exec(version_file.read(), package_config) From 7ad7b1d6e3e7caf33bebd59fac8f9b2b0c50b8e8 Mon Sep 17 00:00:00 2001 From: Aparup Roy <24f3001874@ds.study.iitm.ac.in> Date: Sat, 3 Jan 2026 01:56:09 +0530 Subject: [PATCH 8/9] Fix: PEP 8 style fixes for spacing and newlines --- evalai/utils/updates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evalai/utils/updates.py b/evalai/utils/updates.py index c29dd2d1e..edb0917f3 100644 --- a/evalai/utils/updates.py +++ b/evalai/utils/updates.py @@ -2,10 +2,11 @@ from packaging.version import Version as StrictVersion + def get_latest_version(): url = "https://pypi.org/pypi/evalai/json" response = requests.get(url) data = response.json() versions = list(data["releases"].keys()) versions.sort(key=StrictVersion) - return versions[-1] + return versions[-1] \ No newline at end of file From 9f4f5c492a31ccc07b566d0a69ae5e1795b85845 Mon Sep 17 00:00:00 2001 From: Aparup Roy <24f3001874@ds.study.iitm.ac.in> Date: Sat, 3 Jan 2026 02:03:39 +0530 Subject: [PATCH 9/9] Fix: W292 style errors --- evalai/utils/updates.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/evalai/utils/updates.py b/evalai/utils/updates.py index edb0917f3..4d9d11e96 100644 --- a/evalai/utils/updates.py +++ b/evalai/utils/updates.py @@ -9,4 +9,4 @@ def get_latest_version(): data = response.json() versions = list(data["releases"].keys()) versions.sort(key=StrictVersion) - return versions[-1] \ No newline at end of file + return versions[-1] diff --git a/setup.py b/setup.py index 06b830341..5c0cbaed4 100644 --- a/setup.py +++ b/setup.py @@ -73,4 +73,4 @@ def run_tests(self): include_package_data=True, entry_points={"console_scripts": ["evalai=evalai.main:main"]}, zip_safe=False, -) \ No newline at end of file +)