From adf12a339d5d34fc37f4ed00627fb8dc11a2d31e Mon Sep 17 00:00:00 2001 From: Iurii Kemaev Date: Thu, 23 Nov 2023 04:41:04 -0800 Subject: [PATCH] Drop support for python<3.9. PiperOrigin-RevId: 584861096 --- .github/workflows/ci.yml | 6 +++--- setup.py | 2 +- test.sh | 10 ++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 651c912..a75fdd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,12 +13,12 @@ jobs: strategy: matrix: - python-version: ["3.7", "3.8", "3.9"] + python-version: ["3.10", "3.11", "3.12"] os: [ubuntu-latest] steps: - - uses: "actions/checkout@v2" - - uses: "actions/setup-python@v1" + - uses: "actions/checkout@v4" + - uses: "actions/setup-python@v4" with: python-version: "${{ matrix.python-version }}" - name: Run CI tests diff --git a/setup.py b/setup.py index ec9891d..e8bbe76 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ def _parse_requirements(path): tests_require=_parse_requirements( os.path.join(_CURRENT_DIR, 'requirements', 'requirements-test.txt')), zip_safe=False, # Required for full installation. - python_requires='>=3.7', + python_requires='>=3.9', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', diff --git a/test.sh b/test.sh index 1d4ef26..7902162 100755 --- a/test.sh +++ b/test.sh @@ -25,7 +25,7 @@ python --version # Install dependencies. pip install --upgrade pip setuptools wheel -pip install flake8 pytest-xdist pytype pylint pylint-exit +pip install flake8 pytest-xdist pylint pylint-exit pip install -r requirements/requirements.txt pip install -r requirements/requirements-test.txt @@ -46,7 +46,13 @@ pip wheel --verbose --no-deps --no-clean dist/mctx*.tar.gz pip install mctx*.whl # Check types with pytype. -pytype `find mctx/_src/ -name "*py" | xargs` -k +# Note: pytype does not support 3.12 as of 23.11.23 +# See https://github.com/google/pytype/issues/1308 +if [ `python -c 'import sys; print(sys.version_info.minor)'` -lt 12 ]; +then + pip install pytype + pytype `find mctx/_src/ -name "*py" | xargs` -k +fi; # Run tests using pytest. # Change directory to avoid importing the package from repo root.