Skip to content

Commit

Permalink
Remove python 3.8 support (Supports python 3.9, 3.10, 3.11) (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
gecrooks committed May 29, 2023
1 parent 9a00d98 commit 33966b9
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -185,7 +184,7 @@ classifiers=
[options]
zip_safe = True
python_requires = >= 3.8
python_requires = >= 3.9
packages = find:
install_requires =
Expand Down Expand Up @@ -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).
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example_python_project/.github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion example_python_project/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.module_name}}/.readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ formats: []
sphinx:
configuration: docs/conf.py
python:
version: 3.8
version: 3.9
3 changes: 1 addition & 2 deletions {{cookiecutter.module_name}}/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -51,7 +50,7 @@ classifiers=

[options]
zip_safe = True
python_requires = >= 3.8
python_requires = >= 3.9
packages = find:

setup_requires =
Expand Down

0 comments on commit 33966b9

Please sign in to comment.