Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: drop py39 support and bump min package versions #2380

Merged
merged 1 commit into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, '3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12']
use-network: [true]
include:
- os: ubuntu-latest
Expand All @@ -37,11 +37,11 @@ jobs:

- name: Minimum packages
if: |
matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest' &&
matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' &&
(github.event_name == 'push' || github.event_name == 'pull_request')
id: minimum-packages
run: |
pip install cython==0.29.24 matplotlib==3.5.3 numpy==1.21 owslib==0.24.1 pyproj==3.3.1 scipy==1.6.3 shapely==1.7.1 pyshp==2.3.1
pip install cython==0.29.28 matplotlib==3.6 numpy==1.23 owslib==0.27 pyproj==3.3.1 scipy==1.9 shapely==1.8 pyshp==2.3.1

- name: Coverage packages
id: coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
)
echo "include=$MATRIX" >> $GITHUB_OUTPUT
env:
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
CIBW_BUILD: "cp310-* cp311-* cp312-*"
# Skip 32 bit builds and musllinux due to lack of numpy wheels
CIBW_SKIP: "*-win32 *_i686 *-musllinux*"
CIBW_ARCHS_MACOS: x86_64 arm64
Expand Down
12 changes: 6 additions & 6 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ To use it::

Further information about the required dependencies can be found here:

**Python** 3.9 or later (https://www.python.org/)
**Python** 3.10 or later (https://www.python.org/)
Python 2 support was removed in v0.19.

**Matplotlib** 3.5 or later (https://matplotlib.org/)
**Matplotlib** 3.6 or later (https://matplotlib.org/)
Python package for 2D plotting. Python package required for any
graphical capabilities.

**Shapely** 1.7.1 or later (https://github.com/shapely/shapely)
**Shapely** 1.8 or later (https://github.com/shapely/shapely)
Python package for the manipulation and analysis of planar geometric objects.

**pyshp** 2.3 or later (https://pypi.python.org/pypi/pyshp)
Expand All @@ -83,17 +83,17 @@ to install these optional dependencies. They are also included in some of the
optional groups when installing. For example, use `pip install .[ows]` to install
the optional OWS libraries.

**Pillow** 6.1.0 or later (https://python-pillow.org)
**Pillow** 9.1 or later (https://python-pillow.org)
A popular fork of PythonImagingLibrary.

**pykdtree** 1.2.2 or later (https://github.com/storpipfugl/pykdtree)
A fast kd-tree implementation that is used for faster warping
of images than SciPy.

**SciPy** 1.6.3 or later (https://www.scipy.org/)
**SciPy** 1.9 or later (https://www.scipy.org/)
A Python package for scientific computing.

**OWSLib** 0.24.1 or later (https://pypi.python.org/pypi/OWSLib)
**OWSLib** 0.27 or later (https://pypi.python.org/pypi/OWSLib)
A Python package for client programming with the Open Geospatial
Consortium (OGC) web service, and which gives access to Cartopy ogc
clients.
Expand Down
16 changes: 8 additions & 8 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ name: cartopy-dev
channels:
- conda-forge
dependencies:
- cython>=0.29.24
- numpy>=1.21
- shapely>=1.7.1
- cython>=0.29.28
- numpy>=1.23
- shapely>=1.8
- pyshp>=2.3
- pyproj>=3.3.1
- packaging>=21
# The testing label has the proper version of freetype included
- conda-forge/label/testing::matplotlib-base>=3.5
- conda-forge/label/testing::matplotlib-base>=3.6

# OWS
- owslib>=0.24.1
- pillow>=6.1.0
- owslib>=0.27
- pillow>=9.1
# Plotting
- scipy>=1.6.3
- scipy>=1.9
# Testing
- packaging>=20
- pytest
- pytest-mpl
- pytest-xdist
Expand Down
2 changes: 1 addition & 1 deletion lib/cartopy/mpl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@


_MPL_VERSION = packaging.version.parse(matplotlib.__version__)
_MPL_36 = _MPL_VERSION.release[:2] >= (3, 6)
_MPL_37 = _MPL_VERSION.release[:2] >= (3, 7)
_MPL_38 = _MPL_VERSION.release[:2] >= (3, 8)
17 changes: 5 additions & 12 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,18 +580,11 @@ def __clear(self):
self.dataLim.intervalx = self.projection.x_limits
self.dataLim.intervaly = self.projection.y_limits

if mpl.__version__ >= '3.6':
def clear(self):
"""Clear the current Axes and add boundary lines."""
result = super().clear()
self.__clear()
return result
else:
def cla(self):
"""Clear the current Axes and add boundary lines."""
result = super().cla()
self.__clear()
return result
def clear(self):
"""Clear the current Axes and add boundary lines."""
result = super().clear()
self.__clear()
return result

def format_coord(self, x, y):
"""
Expand Down
6 changes: 3 additions & 3 deletions lib/cartopy/tests/mpl/test_crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import pytest

import cartopy.crs as ccrs
from cartopy.mpl import _MPL_36
from cartopy.mpl import _MPL_37


@pytest.mark.natural_earth
@pytest.mark.mpl_image_compare(
filename="igh_land.png", tolerance=0.5 if _MPL_36 else 3.6)
filename="igh_land.png", tolerance=0.5 if _MPL_37 else 3.6)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did this last time too, based on failures in the min version test. I'm starting to think maybe it's not the mpl version making the difference. I don't think I want to start digging into that today though.

def test_igh_land():
crs = ccrs.InterruptedGoodeHomolosine(emphasis="land")
ax = plt.axes(projection=crs)
Expand All @@ -23,7 +23,7 @@ def test_igh_land():

@pytest.mark.natural_earth
@pytest.mark.mpl_image_compare(filename="igh_ocean.png",
tolerance=0.5 if _MPL_36 else 4.5)
tolerance=0.5 if _MPL_37 else 4.5)
def test_igh_ocean():
crs = ccrs.InterruptedGoodeHomolosine(
central_longitude=-160, emphasis="ocean"
Expand Down
6 changes: 1 addition & 5 deletions lib/cartopy/tests/mpl/test_gridliner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from shapely.geos import geos_version

import cartopy.crs as ccrs
from cartopy.mpl import _MPL_36
from cartopy.mpl.geoaxes import GeoAxes
from cartopy.mpl.gridliner import (
LATITUDE_FORMATTER,
Expand Down Expand Up @@ -537,10 +536,7 @@ def test_gridliner_title_adjust():
plt.rcParams['axes.titley'] = None

fig = plt.figure(layout='constrained')
if _MPL_36:
fig.get_layout_engine().set(h_pad=1/8)
else:
fig.set_constrained_layout_pads(h_pad=1/8)
fig.get_layout_engine().set(h_pad=1/8)
for n, proj in enumerate(projs, 1):
ax = fig.add_subplot(2, 2, n, projection=proj)
ax.coastlines()
Expand Down
16 changes: 7 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ authors = [
]
description = "A Python library for cartographic visualizations with Matplotlib"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
keywords = ["cartography", "map", "transform", "projection", "pyproj", "shapely", "shapefile"]
license = {file = "LICENSE"}
classifiers = [
Expand All @@ -36,7 +36,6 @@ classifiers = [
'Programming Language :: C++',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
Expand All @@ -46,10 +45,10 @@ classifiers = [
'Topic :: Scientific/Engineering :: Visualization',
]
dependencies = [
"numpy>=1.21",
"matplotlib>=3.5",
"shapely>=1.7",
"packaging>=20",
"numpy>=1.23",
"matplotlib>=3.6",
"shapely>=1.8",
"packaging>=21",
"pyshp>=2.3",
"pyproj>=3.3.1",
]
Expand All @@ -58,8 +57,8 @@ dynamic = ["version"]
[project.optional-dependencies]
doc = ["pydata-sphinx-theme", "sphinx", "sphinx-gallery"]
speedups = ["pykdtree", "fiona"]
ows = ["OWSLib>=0.20.0", "pillow>=6.1.0"]
plotting = ["pillow>=6.1.0", "scipy>=1.3.1"]
ows = ["OWSLib>=0.27.0", "pillow>=9.1"]
plotting = ["pillow>=9.1", "scipy>=1.9"]
srtm = ["beautifulsoup4"]
test = ["pytest>=5.1.2", "pytest-mpl>=0.11", "pytest-xdist", "pytest-cov", "coveralls"]

Expand Down Expand Up @@ -99,7 +98,6 @@ testpaths = ["lib"]
python_files = ["test_*.py"]

[tool.ruff]
target-version = "py39"
lint.select = ["E", "F", "I", "W"]

[tool.ruff.lint.isort]
Expand Down
Loading