From 9fa167ffada8fe2e1719f6a761db3d5a0ffa8bf4 Mon Sep 17 00:00:00 2001 From: Brendt Wohlberg Date: Wed, 19 Apr 2023 10:21:18 -0600 Subject: [PATCH] Drop support for Python 3.7 (#403) * Remove python 3.7 support * Update docs --- CHANGES.rst | 1 + README.rst | 4 ++-- docs/source/contributing.rst | 4 ++-- docs/source/install.rst | 2 +- scico/__init__.py | 2 -- scico/_python37.py | 24 ------------------------ setup.py | 2 +- 7 files changed, 7 insertions(+), 32 deletions(-) delete mode 100644 scico/_python37.py diff --git a/CHANGES.rst b/CHANGES.rst index a95a3a21d..3d79ac917 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -18,6 +18,7 @@ Version 0.0.4 (unreleased) for `flax`. • New methods and a function for computing Jacobian-vector products for `Operator` objects. +• Drop support for Python 3.7. diff --git a/README.rst b/README.rst index 4bb285922..d4ae2f61a 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ -.. image:: https://img.shields.io/badge/python-3.7+-green.svg +.. image:: https://img.shields.io/badge/python-3.8+-green.svg :target: https://www.python.org/ - :alt: Python >= 3.7 + :alt: Python >= 3.8 .. image:: https://img.shields.io/github/license/lanl/scico.svg :target: https://github.com/lanl/scico/blob/main/LICENSE diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index 38d20f351..71f652945 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -45,7 +45,7 @@ Installing a Development Version 1. Fork both the ``scico`` and ``scico-data`` repositories, creating copies of these repositories in your own git account. -2. Make sure that you have Python 3.7 or later installed in order to +2. Make sure that you have Python 3.8 or later installed in order to create a conda virtual environment. 3. Clone your fork from the source repo. @@ -54,7 +54,7 @@ Installing a Development Version git clone --recurse-submodules git@github.com:/scico.git -4. Create a conda environment using Python 3.7 or later, e.g.: +4. Create a conda environment using Python 3.8 or later, e.g.: :: diff --git a/docs/source/install.rst b/docs/source/install.rst index 4a619f36f..dba99970f 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -3,7 +3,7 @@ Installing SCICO ================ -SCICO requires Python version 3.7 or later. (Version 3.9 is +SCICO requires Python version 3.8 or later. (Version 3.9 is recommended as it is the version under which SCICO has been most thoroughly tested.) It is supported on both Linux and macOS, but is not currently supported on Windows due to the limited support for diff --git a/scico/__init__.py b/scico/__init__.py index 3afd25309..7e4755b24 100644 --- a/scico/__init__.py +++ b/scico/__init__.py @@ -13,8 +13,6 @@ import logging import sys -from . import _python37 # python 3.7 compatibility - # isort: off from ._autograd import grad, jacrev, linear_adjoint, value_and_grad, cvjp diff --git a/scico/_python37.py b/scico/_python37.py deleted file mode 100644 index d4f567c5a..000000000 --- a/scico/_python37.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (C) 2021-2022 by SCICO Developers -# All rights reserved. BSD 3-clause License. -# This file is part of the SCICO package. Details of the copyright and -# user license can be found in the 'LICENSE' file distributed with the -# package. - -""" Alter the behavior of (monkey patch) several modules so that SCICO -is compatible with Python 3.7, allowing it to run on Google Colab. -This file should be removed when/if Colab upgrades to Python 3.8. -""" - -import sys - -if sys.version_info.major == 3 and sys.version_info.minor == 7: - import typing - - typing.Literal = typing.Any # type: ignore - - import math - from functools import reduce - from operator import mul - - # math.prod = (lambda fun, op: lambda iterable: fun(op, iterable, 1))(reduce, mul) # type: ignore - math.prod = lambda iterable: reduce(mul, iterable, 1) # type: ignore diff --git a/setup.py b/setup.py index dafa23d72..30e37e751 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ lines = f.readlines() install_requires = [line.strip() for line in lines] -python_requires = ">=3.7" +python_requires = ">=3.8" tests_require = ["pytest", "pytest-runner"] extra_require_files = [