Skip to content

Commit c931d01

Browse files
Vivek Miglanifacebook-github-bot
authored andcommitted
Update minimum Python version for Captum to 3.9 (#1460)
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
1 parent 2b9f4ae commit c931d01

File tree

7 files changed

+22
-10
lines changed

7 files changed

+22
-10
lines changed

.conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ build:
1313

1414
requirements:
1515
host:
16-
- python>=3.8
16+
- python>=3.9
1717
run:
1818
- numpy<2.0
1919
- pytorch>=1.10

.github/workflows/test-conda-cpu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
tests:
1616
strategy:
1717
matrix:
18-
python_version: ["3.8", "3.9", "3.10", "3.11"]
18+
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1919
fail-fast: false
2020
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
2121
with:

.github/workflows/test-pip-cpu.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
matrix:
1515
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"]
1616
transformers_args: ["-t 4.38.0", "-t 4.39.0", "-t 4.41.0", "-t 4.43.0", "-t 4.45.2"]
17-
docker_img: ["cimg/python:3.8", "cimg/python:3.9", "cimg/python:3.10", "cimg/python:3.11"]
17+
docker_img: ["cimg/python:3.9", "cimg/python:3.10", "cimg/python:3.11", "cimg/python:3.12"]
1818
exclude:
1919
- pytorch_args: "-v 1.10"
2020
docker_img: "cimg/python:3.10"
@@ -24,6 +24,18 @@ jobs:
2424
docker_img: "cimg/python:3.11"
2525
- pytorch_args: "-v 1.12"
2626
docker_img: "cimg/python:3.11"
27+
- pytorch_args: "-v 1.10"
28+
docker_img: "cimg/python:3.12"
29+
- pytorch_args: "-v 1.11"
30+
docker_img: "cimg/python:3.12"
31+
- pytorch_args: "-v 1.12"
32+
docker_img: "cimg/python:3.12"
33+
- pytorch_args: "-v 1.13"
34+
docker_img: "cimg/python:3.12"
35+
- pytorch_args: "-v 2.0.0"
36+
docker_img: "cimg/python:3.12"
37+
- pytorch_args: "-v 2.1.0"
38+
docker_img: "cimg/python:3.12"
2739
fail-fast: false
2840
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
2941
with:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Then run this script from the repository root:
6363
```
6464
Note that we expect mypy to have version 0.760 or higher, and when type checking, use PyTorch 1.4 or
6565
higher due to fixes to PyTorch type hints available in 1.4. We also use the Literal feature which is
66-
available only in Python 3.8 or above. If type-checking using a previous version of Python, you will
66+
available only in Python 3.9 or above. If type-checking using a previous version of Python, you will
6767
need to install the typing-extension package which can be done with pip using `pip install typing-extensions`.
6868

6969
#### Unit Tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Captum can also be used by application engineers who are using trained models in
4747
## Installation
4848

4949
**Installation Requirements**
50-
- Python >= 3.8
50+
- Python >= 3.9
5151
- PyTorch >= 1.10
5252

5353

scripts/install_via_conda.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ while getopts 'nf' flag; do
1919
conda update -q --all --yes
2020

2121
# required to use conda develop
22-
conda install -q -y conda-build
22+
#conda install -q -y conda-build
2323

2424
# install other frameworks if asked for and make sure this is before pytorch
2525
if [[ $FRAMEWORKS == true ]]; then
@@ -35,8 +35,8 @@ else
3535
fi
3636

3737
# install other deps
38-
conda install -q -y pytest ipywidgets ipython scikit-learn parameterized werkzeug==2.2.2
39-
conda install -q -y -c conda-forge matplotlib pytest-cov flask flask-compress
38+
conda install -q -y pytest ipywidgets ipython scikit-learn parameterized werkzeug
39+
conda install -q -y -c conda-forge matplotlib pytest-cov flask flask-compress conda-build
4040
conda install -q -y transformers
4141

4242
# install captum

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from setuptools import find_packages, setup
1717

1818
REQUIRED_MAJOR = 3
19-
REQUIRED_MINOR = 8
19+
REQUIRED_MINOR = 9
2020

2121
# Check for python version
2222
if sys.version_info < (REQUIRED_MAJOR, REQUIRED_MINOR):
@@ -148,7 +148,7 @@ def get_package_files(root, subdirs):
148148
],
149149
long_description=long_description,
150150
long_description_content_type="text/markdown",
151-
python_requires=">=3.8",
151+
python_requires=">=3.9",
152152
install_requires=[
153153
"matplotlib",
154154
"numpy<2.0",

0 commit comments

Comments
 (0)