From 600dcb3714b3042377183c8fdb6db5fc9365cd5b Mon Sep 17 00:00:00 2001 From: Vivek Miglani Date: Fri, 20 Dec 2024 15:05:53 -0800 Subject: [PATCH] Update minimum Python version for Captum to 3.9 Summary: Python 3.8 has reached EOL in Oct 2024, so we can upgrade minimum python required for Captum to 3.9. We are seeing test failures due to dependencies when running with Python 3.8, so upgrading minimum version to resolve these. Differential Revision: D67545940 --- .conda/meta.yaml | 2 +- .github/workflows/test-conda-cpu.yml | 2 +- .github/workflows/test-pip-cpu.yml | 2 +- CONTRIBUTING.md | 2 +- README.md | 2 +- setup.py | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.conda/meta.yaml b/.conda/meta.yaml index 5217866af7..72bdb990bb 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -13,7 +13,7 @@ build: requirements: host: - - python>=3.8 + - python>=3.9 run: - numpy<2.0 - pytorch>=1.10 diff --git a/.github/workflows/test-conda-cpu.yml b/.github/workflows/test-conda-cpu.yml index 3295edcca8..9d6643c79f 100644 --- a/.github/workflows/test-conda-cpu.yml +++ b/.github/workflows/test-conda-cpu.yml @@ -15,7 +15,7 @@ jobs: tests: strategy: matrix: - python_version: ["3.8", "3.9", "3.10", "3.11"] + python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] fail-fast: false uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: diff --git a/.github/workflows/test-pip-cpu.yml b/.github/workflows/test-pip-cpu.yml index a83f18e05d..9459831457 100644 --- a/.github/workflows/test-pip-cpu.yml +++ b/.github/workflows/test-pip-cpu.yml @@ -14,7 +14,7 @@ jobs: matrix: pytorch_args: ["-v 1.10", "-v 1.11", "-v 1.12", "-v 1.13", "-v 2.0.0", "-v 2.1.0", "-v 2.2.0", "-v 2.3.0"] transformers_args: ["-t 4.38.0", "-t 4.39.0", "-t 4.41.0", "-t 4.43.0", "-t 4.45.2"] - docker_img: ["cimg/python:3.8", "cimg/python:3.9", "cimg/python:3.10", "cimg/python:3.11"] + docker_img: ["cimg/python:3.9", "cimg/python:3.10", "cimg/python:3.11", "cimg/python:3.12", "cimg/python:3.13"] exclude: - pytorch_args: "-v 1.10" docker_img: "cimg/python:3.10" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4342e18ec4..3cdca2e4f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ Then run this script from the repository root: ``` Note that we expect mypy to have version 0.760 or higher, and when type checking, use PyTorch 1.4 or higher due to fixes to PyTorch type hints available in 1.4. We also use the Literal feature which is -available only in Python 3.8 or above. If type-checking using a previous version of Python, you will +available only in Python 3.9 or above. If type-checking using a previous version of Python, you will need to install the typing-extension package which can be done with pip using `pip install typing-extensions`. #### Unit Tests diff --git a/README.md b/README.md index 17e14fe6c0..be7a3db68d 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Captum can also be used by application engineers who are using trained models in ## Installation **Installation Requirements** -- Python >= 3.8 +- Python >= 3.9 - PyTorch >= 1.10 diff --git a/setup.py b/setup.py index d29e05b108..5effc53d72 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ from setuptools import find_packages, setup REQUIRED_MAJOR = 3 -REQUIRED_MINOR = 8 +REQUIRED_MINOR = 9 # Check for python version if sys.version_info < (REQUIRED_MAJOR, REQUIRED_MINOR): @@ -148,7 +148,7 @@ def get_package_files(root, subdirs): ], long_description=long_description, long_description_content_type="text/markdown", - python_requires=">=3.8", + python_requires=">=3.9", install_requires=[ "matplotlib", "numpy<2.0",