From 1a5a49544d1389b9acf6f087dfc5d0ee999c5a3e Mon Sep 17 00:00:00 2001 From: Ryan May Date: Thu, 27 Jan 2022 16:31:05 -0700 Subject: [PATCH 1/4] MNT: Drop support for Python 3.7 (Fixes #2217) --- README.md | 2 +- docs/index.rst | 2 +- docs/userguide/installguide.rst | 2 +- setup.cfg | 4 +--- setup.py | 1 - src/metpy/_version.py | 5 +---- 6 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index df6cf5feeba..c591063e5bf 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ on a future ``1.x`` version. For additional MetPy examples not included in this repository, please see the [Unidata Python Gallery](https://unidata.github.io/python-gallery/). -We support Python >= 3.7. +We support Python >= 3.8. Need Help? ---------- diff --git a/docs/index.rst b/docs/index.rst index f0a24a83de6..773d81045ba 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,7 +14,7 @@ MetPy ===== MetPy is a collection of tools in Python for reading, visualizing, and performing calculations -with weather data. MetPy supports Python >= 3.7 and is freely available under a permissive +with weather data. MetPy supports Python >= 3.8 and is freely available under a permissive `open source license `_. If you're new to MetPy, check out our :doc:`Getting Started ` guide. diff --git a/docs/userguide/installguide.rst b/docs/userguide/installguide.rst index 337ded87ec0..2c293cffeab 100644 --- a/docs/userguide/installguide.rst +++ b/docs/userguide/installguide.rst @@ -7,7 +7,7 @@ Requirements ------------ In general, MetPy tries to support minor versions of dependencies released within the last two years. For Python itself, that generally means supporting the last two minor releases; MetPy -currently supports Python >= 3.7. +currently supports Python >= 3.8. .. literalinclude:: ../../setup.cfg :start-after: importlib_resources diff --git a/setup.cfg b/setup.cfg index b61b45145e5..0316ae574da 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,6 @@ classifiers = Development Status :: 5 - Production/Stable Framework :: Matplotlib Programming Language :: Python - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 @@ -38,9 +37,8 @@ package_dir = packages = find: include_package_data = True setup_requires = setuptools_scm -python_requires = >=3.7 +python_requires = >=3.8 install_requires = - importlib_metadata>=1.0.0; python_version < '3.8' importlib_resources>=1.3.0; python_version < '3.9' matplotlib>=3.3.0 numpy>=1.17.0 diff --git a/setup.py b/setup.py index d7ea28fe97a..51a3bdd5e6c 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,6 @@ if sys.version_info[0] < 3: error = """ - MetPy v1.1 and greater requires Python 3.7 or above. If you're using Python 2.7, please install MetPy v0.11.1, which is the last release of MetPy that supports Python 2.7, but it is no longer maintained. diff --git a/src/metpy/_version.py b/src/metpy/_version.py index 938fc859520..1497d3af88d 100644 --- a/src/metpy/_version.py +++ b/src/metpy/_version.py @@ -15,10 +15,7 @@ def get_version(): return get_version(root='../..', relative_to=__file__, version_scheme='post-release') except (ImportError, LookupError): - try: - from importlib.metadata import PackageNotFoundError, version - except ImportError: # Can remove when we require Python > 3.7 - from importlib_metadata import PackageNotFoundError, version + from importlib.metadata import PackageNotFoundError, version try: return version(__package__) From cd720dd318e49b1fa469dcaaf449a0147b3948db Mon Sep 17 00:00:00 2001 From: Ryan May Date: Thu, 27 Jan 2022 16:37:46 -0700 Subject: [PATCH 2/4] CI: Update CI configuration to match supported Python versions --- .github/actions/install-conda/action.yml | 7 +------ .github/workflows/docs-conda.yml | 5 +---- .github/workflows/docs.yml | 2 +- .github/workflows/tests-conda.yml | 2 +- .github/workflows/tests-pypi.yml | 6 +++--- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/actions/install-conda/action.yml b/.github/actions/install-conda/action.yml index 45845297fd5..c340b212705 100644 --- a/.github/actions/install-conda/action.yml +++ b/.github/actions/install-conda/action.yml @@ -42,9 +42,4 @@ runs: - name: Install shell: bash -l {0} - # For some reason on Windows 3.7 building the wheel fails to properly include our extra - # stuff. Executing the egg_info beforehand for some reason fixes it. No idea why. We're - # deep in territory where googling for answers helps not at all. - run: | - python setup.py egg_info - python -m pip install --no-deps . + run: python -m pip install --no-deps . diff --git a/.github/workflows/docs-conda.yml b/.github/workflows/docs-conda.yml index de1b0a2b28d..2ca323726db 100644 --- a/.github/workflows/docs-conda.yml +++ b/.github/workflows/docs-conda.yml @@ -10,9 +10,6 @@ concurrency: cancel-in-progress: true jobs: - # - # Build our docs on macOS and Windows on Python 3.8 and 3.7, respectively. - # Docs: name: ${{ matrix.os }} ${{ matrix.python-version }} runs-on: ${{ matrix.os }}-latest @@ -25,7 +22,7 @@ jobs: include: - python-version: 3.8 os: macOS - - python-version: 3.7 + - python-version: 3.9 os: Windows steps: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1a06984eeea..d4af668a6cb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -81,7 +81,7 @@ jobs: - name: Download doc build uses: actions/download-artifact@v2 with: - name: Linux-3.9-docs + name: Linux-3.10-docs path: ./docs/build/html # This overrides the version "dev" with the proper version if we're building off a diff --git a/.github/workflows/tests-conda.yml b/.github/workflows/tests-conda.yml index c229febc1c2..31b467ba34d 100644 --- a/.github/workflows/tests-conda.yml +++ b/.github/workflows/tests-conda.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9, '3.10'] + python-version: [3.8, 3.9, '3.10'] os: [macOS, Windows] steps: diff --git a/.github/workflows/tests-pypi.yml b/.github/workflows/tests-pypi.yml index 078319b5641..99a943d9643 100644 --- a/.github/workflows/tests-pypi.yml +++ b/.github/workflows/tests-pypi.yml @@ -21,14 +21,14 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9, "3.10"] + python-version: [3.8, 3.9, '3.10'] dep-versions: [requirements.txt] no-extras: [''] include: - - python-version: 3.7 + - python-version: 3.8 dep-versions: Minimum no-extras: 'No Extras' - - python-version: 3.9 + - python-version: '3.10' dep-versions: requirements.txt no-extras: 'No Extras' From dbd14b3cae4b0e6991ff3ccac256a25732a6e74e Mon Sep 17 00:00:00 2001 From: Ryan May Date: Fri, 28 Jan 2022 17:52:32 -0700 Subject: [PATCH 3/4] MNT: Bump minimum Numpy to 1.18 This is the first release cycle that has wheels and support for 3.8 (technically 1.17.3 would be enough but...meh) --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 0316ae574da..0e42188f2f7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,7 +41,7 @@ python_requires = >=3.8 install_requires = importlib_resources>=1.3.0; python_version < '3.9' matplotlib>=3.3.0 - numpy>=1.17.0 + numpy>=1.18.0 pandas>=0.24.0 pint>=0.10.1 pooch>=1.2.0 From c860f838d566c711762fde2804880c56651effa9 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Tue, 1 Feb 2022 21:11:19 -0700 Subject: [PATCH 4/4] CI: Always install our cached PROJ May be necessary so CartoPy and PyProj use the same one. Also possible to have a cached pyproj wheel that is linked against it. --- .github/actions/install-pypi/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/install-pypi/action.yml b/.github/actions/install-pypi/action.yml index b79cfb9e472..2a263ed7bb0 100644 --- a/.github/actions/install-pypi/action.yml +++ b/.github/actions/install-pypi/action.yml @@ -29,7 +29,6 @@ runs: ci/${{ inputs.version-file }} - name: Setup PROJ - if: ${{ inputs.need-cartopy == 'true' }} uses: ./.github/actions/setup-proj # This installs the stuff needed to build and install Shapely and CartoPy from source.