Repository: PlasmaPy/PlasmaPy

Issue:
Drop support for Python 3.7
[NEP 29](https://numpy.org/neps/nep-0029-deprecation_policy.html) suggests a community schedule for dropping support old versions of Python & NumPy.  If we follow that schedule, we would drop support for Python 3.7 in PlasmaPy 0.8.0 which will likely be released in early 2022.  Python 3.10 is due to be released in ≲1 month, so we would be supporting the last three releases of Python.  Besides that, the next release of Astropy will not include support for Python 3.7, so we'd need to update our requirements fairly soon anyway.

The most significant changes in Python 3.8 are:
 - [f-string support for self-documenting expressions](https://docs.python.org/3.8/whatsnew/3.8.html#f-strings-support-for-self-documenting-expressions-and-debugging) (I'll probably start using these immediately)
 - [walrus operators](https://docs.python.org/3.8/whatsnew/3.8.html#assignment-expressions) (will likely improve readability here & there)
 - [positional-only parameters](https://docs.python.org/3.8/whatsnew/3.8.html#positional-only-parameters) (maybe appropriate but not necessary for mathematical stuff like the plasma dispersion function?)


Discussion:
Turns out that NumPy will be dropping support for Python 3.7 in their next release too, which is extra motivation for us dropping it too.
When we address this issue, it would probably be worth making use of pyupgrade (#1438) to automate a lot of the changes from 3.7+ to 3.8+ syntax.  

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3.7
+#!/usr/bin/env python3
 #
 # PlasmaPy documentation build configuration file, created by
 # sphinx-quickstart on Wed May 31 18:16:46 2017.
diff --git a/plasmapy/__init__.py b/plasmapy/__init__.py
--- a/plasmapy/__init__.py
+++ b/plasmapy/__init__.py
@@ -20,8 +20,8 @@
 # This is the same check as the one at the top of setup.py
 import sys
 
-if sys.version_info < (3, 7):
-    raise Exception("PlasmaPy does not support Python < 3.7")
+if sys.version_info < (3, 8):  # coverage: ignore
+    raise ImportError("PlasmaPy does not support Python < 3.8")
 
 # Packages may add whatever they like to this file, but
 # should keep this content at the top.


Test patch:
diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml
--- a/.github/workflows/testing.yml
+++ b/.github/workflows/testing.yml
@@ -52,15 +52,10 @@ jobs:
       matrix:
         include:
 
-        - name: Python 3.7 with minimal dependencies
+        - name: Python 3.8 with minimal dependencies
           os: ubuntu-latest
-          python: 3.7
-          toxenv: py37-all-minimal
-
-        - name: Python 3.7
-          os: ubuntu-latest
-          python: 3.7
-          toxenv: py37-all
+          python: 3.8
+          toxenv: py38-all-minimal
 
         - name: Python 3.8, all tests, code coverage
           os: ubuntu-latest
@@ -137,10 +132,10 @@ jobs:
       run: |
         git fetch --prune --unshallow
         git fetch --depth=1 origin +refs/tags/*:refs/tags/*
-    - name: Set up Python 3.7
+    - name: Set up Python 3.8
       uses: actions/setup-python@v3
       with:
-        python-version: 3.7
+        python-version: 3.8
     - name: Install requirements
       run: |
         pip install --progress-bar off --upgrade pip