From 33966b94c1e5713b3a5bac058780610179a571e4 Mon Sep 17 00:00:00 2001 From: Gavin Crooks Date: Sun, 28 May 2023 21:34:37 -0700 Subject: [PATCH] Remove python 3.8 support (Supports python 3.9, 3.10, 3.11) (#47) --- .github/workflows/python-build.yml | 2 +- README.md | 17 +++++++---------- .../.github/workflows/python-build.yml | 2 +- example_python_project/setup.cfg | 1 - .../.github/workflows/python-build.yml | 2 +- {{cookiecutter.module_name}}/.readthedocs.yml | 2 +- {{cookiecutter.module_name}}/setup.cfg | 3 +-- 7 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index cc59706..5ab4265 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11'] os: [ubuntu-latest, macos-latest, windows-latest] steps: diff --git a/README.md b/README.md index 9a075b5..d3d4d2c 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ On our local machine the first thing we do is create a new conda environment. (Y $ conda create --name GPT $ source activate GPT (GPT) $ python --version - Python 3.8.3 + Python 3.11.0 ``` Now we clone the repo locally. @@ -172,7 +172,6 @@ classifiers= Natural Language :: English Operating System :: OS Independent Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 @@ -185,7 +184,7 @@ classifiers= [options] zip_safe = True -python_requires = >= 3.8 +python_requires = >= 3.9 packages = find: install_requires = @@ -215,9 +214,7 @@ that in the long run the metadata moves to `pyproject.toml` and follows a differ [specification](https://packaging.python.org/specifications/core-metadata/). -It's good practice to support at least two consecutive versions of python. Starting with 3.9, python is moving to an annual [release schedule](https://www.python.org/dev/peps/pep-0602/). The initial 3.x.0 release will be in early October and the first bug patch 3.x.1 in early December, second in February, and so on. Since it takes many important packages some time to upgrade (e.g. numpy and tensorflow are often bottlenecks), one should probably plan to upgrade python support around the beginning of each year. Upgrading involves changing the python version numbers in the workflow tests and `config.cfg`, and then cleaning up any `__future__` or conditional imports, or other hacks added to maintain compatibility with older python releases. If you protected the master branch on github, and added required status checks, you'll need to update those too. - -Supporting older python versions is often a good idea, if you don't need the newest wizz-bang python features. We'll default to supporting python 3.8 onwards for now (Since Google's colab currently defaults to 3.8 (Dec 2022)). +It's good practice to support at least two consecutive versions of python. Starting with 3.9, python is moving to an annual [release schedule](https://www.python.org/dev/peps/pep-0602/). The initial 3.x.0 release will be in early October and the first bug patch 3.x.1 in early December, second in February, and so on. Since it takes many important packages some time to upgrade (e.g. numpy and tensorflow are often bottlenecks), one should probably plan to upgrade python support around the beginning of each year. Upgrading involves changing the python version numbers in the workflow tests and `config.cfg`, and then cleaning up any `__future__` or conditional imports, or other hacks added to maintain compatibility with older python releases. If you protected the master branch on github, and added required status checks, you'll need to update those too. Supporting older python versions is often a good idea, if you don't need the newest wizz-bang python features. We can now install our package (as editable -e, so that the code in our repo is live). @@ -244,7 +241,7 @@ __all__ = ["__version__", "importlib_metadata", "about"] # Backwards compatibility imports try: - # python >= 3.8 + # python >= 3.9 from importlib import metadata as importlib_metadata # type: ignore except ImportError: # pragma: no cover import importlib_metadata # type: ignore # noqa: F401 @@ -275,7 +272,7 @@ One of my tricks is to add a function to print the versions of the core upstream # Configuration (> python -m example_python_project.about) platform macOS-10.16-x86_64-i386-64bit example_python_project 0.0.0 -python 3.8.8 +python 3.10.3 numpy 1.20.1 setuptools_scm 5.0.2 pytest 6.2.2 @@ -514,7 +511,7 @@ formats: [] sphinx: configuration: docs/conf.py python: - version: 3.8 + version: 3.9 ``` I've already got a readthedocs account, so setting up a new project takes but a few minutes. @@ -551,7 +548,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v2 diff --git a/example_python_project/.github/workflows/python-build.yml b/example_python_project/.github/workflows/python-build.yml index e05d88c..b9ff202 100644 --- a/example_python_project/.github/workflows/python-build.yml +++ b/example_python_project/.github/workflows/python-build.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.9', '3.10', '3.11'] os: [ubuntu-latest, macos-latest, windows-latest] steps: diff --git a/example_python_project/setup.cfg b/example_python_project/setup.cfg index 4001d5f..0e14469 100644 --- a/example_python_project/setup.cfg +++ b/example_python_project/setup.cfg @@ -36,7 +36,6 @@ classifiers= Natural Language :: English Operating System :: OS Independent Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 diff --git a/{{cookiecutter.module_name}}/.github/workflows/python-build.yml b/{{cookiecutter.module_name}}/.github/workflows/python-build.yml index b122640..428e187 100644 --- a/{{cookiecutter.module_name}}/.github/workflows/python-build.yml +++ b/{{cookiecutter.module_name}}/.github/workflows/python-build.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.9', '3.10', '3.11'] os: [ubuntu-latest, macos-latest, windows-latest] steps: diff --git a/{{cookiecutter.module_name}}/.readthedocs.yml b/{{cookiecutter.module_name}}/.readthedocs.yml index 7f13c92..94c58b4 100644 --- a/{{cookiecutter.module_name}}/.readthedocs.yml +++ b/{{cookiecutter.module_name}}/.readthedocs.yml @@ -3,4 +3,4 @@ formats: [] sphinx: configuration: docs/conf.py python: - version: 3.8 + version: 3.9 diff --git a/{{cookiecutter.module_name}}/setup.cfg b/{{cookiecutter.module_name}}/setup.cfg index 272f144..d6fe904 100644 --- a/{{cookiecutter.module_name}}/setup.cfg +++ b/{{cookiecutter.module_name}}/setup.cfg @@ -36,7 +36,6 @@ classifiers= Natural Language :: English Operating System :: OS Independent Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 @@ -51,7 +50,7 @@ classifiers= [options] zip_safe = True -python_requires = >= 3.8 +python_requires = >= 3.9 packages = find: setup_requires =