Skip to content

Commit 65335fa

Browse files
authored
drop py37 py38 and update dependencies (#88)
* drop suport for python 3.7 and 3.8 * update required versions * remove setuptools * changelog * fix min deps check
1 parent a28596f commit 65335fa

File tree

8 files changed

+29
-27
lines changed

8 files changed

+29
-27
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525
include:
2626
- env: "min-all-deps"
27-
python-version: "3.7"
27+
python-version: "3.9"
2828
steps:
2929
- uses: actions/checkout@v4
3030
with:
@@ -98,4 +98,4 @@ jobs:
9898
9999
- name: minimum versions policy
100100
run: |
101-
python ci/min_deps_check.py ci/requirements/py37-min-all-deps.yml
101+
python ci/min_deps_check.py ci/requirements/py39-min-all-deps.yml

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
matrix:
2424
os: ["ubuntu-latest"]
2525
# Bookend python versions
26-
python-version: ["3.7", "3.10", "3.11"]
26+
python-version: ["3.9", "3.10", "3.11"]
2727
steps:
2828
- uses: actions/checkout@v4
2929
with:

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66

77
### Breaking changes
88

9+
- Removed support for python 3.7 and python 3.8 ([#88](https://github.com/mathause/mplotutils/pull/88)).
10+
- The minimum versions of some dependencies were changed ([#88](https://github.com/mathause/mplotutils/pull/88)).
11+
12+
| Package | Old | New |
13+
| ------------ | ----- | ----- |
14+
| cartopy | 0.18 | 0.20 |
15+
| matplotlib* | 3.4 | 3.5 |
16+
| numpy | 1.17 | 1.23 |
17+
| seaborn | 1.2 | 1.3 |
18+
| xarray | 0.15 | 2022.12 |
19+
20+
921
- `sample_data_map` now offsets the lon data such that the first grid cell does not wrap
1022
around ([#87](https://github.com/mathause/mplotutils/pull/87)).
1123

ci/min_deps_check.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
import itertools
1111
import sys
12+
from collections.abc import Iterator
1213
from datetime import datetime
13-
from typing import Dict, Iterator, Optional, Tuple
14+
from typing import Optional
1415

1516
import conda.api # type: ignore[import]
1617
import yaml
@@ -56,7 +57,7 @@ def warning(msg: str) -> None:
5657
print("WARNING:", msg)
5758

5859

59-
def parse_requirements(fname) -> Iterator[Tuple[str, int, int, Optional[int]]]:
60+
def parse_requirements(fname) -> Iterator[tuple[str, int, int, Optional[int]]]:
6061
"""Load requirements/py*-min-all-deps.yml
6162
6263
Yield (package name, major version, minor version, [patch version])
@@ -88,7 +89,7 @@ def parse_requirements(fname) -> Iterator[Tuple[str, int, int, Optional[int]]]:
8889
raise ValueError("expected major.minor or major.minor.patch: " + row)
8990

9091

91-
def query_conda(pkg: str) -> Dict[Tuple[int, int], datetime]:
92+
def query_conda(pkg: str) -> dict[tuple[int, int], datetime]:
9293
"""Query the conda repository for a specific package
9394
9495
Return map of {(major version, minor version): publication date}
@@ -128,7 +129,7 @@ def metadata(entry):
128129

129130
def process_pkg(
130131
pkg: str, req_major: int, req_minor: int, req_patch: Optional[int]
131-
) -> Tuple[str, str, str, str, str, str]:
132+
) -> tuple[str, str, str, str, str, str]:
132133
"""Compare package version from requirements file to available versions in conda.
133134
Return row to build pandas dataframe:
134135

ci/requirements/py37-min-all-deps.yml renamed to ci/requirements/py39-min-all-deps.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ channels:
33
- conda-forge
44
- nodefaults
55
dependencies:
6-
- python=3.7
7-
- cartopy=0.18
8-
- matplotlib-base=3.4
9-
- numpy=1.17
10-
- seaborn=0.11
11-
- setuptools=40.4
12-
- xarray=0.18
6+
- python=3.9
7+
- cartopy=0.21
8+
- matplotlib-base=3.6
9+
- numpy=1.23
10+
- seaborn=0.12
11+
- xarray=2022.12
1312
# for testing
1413
- pytest
1514
- pytest-cov

mplotutils/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
# flake8: noqa
22

3+
from importlib.metadata import version as _get_version
4+
35
from . import _colorbar, cartopy_utils, colormaps
46
from ._colorbar import *
57
from .cartopy_utils import *
68
from .colormaps import *
79
from .map_layout import set_map_layout
810
from .xrcompat import *
911

10-
try:
11-
from importlib.metadata import version as _get_version
12-
except ImportError:
13-
# importlib.metadata not available in python 3.7
14-
import pkg_resources
15-
16-
_get_version = lambda pkg: pkg_resources.get_distribution(pkg).version
17-
1812
try:
1913
__version__ = _get_version("mplotutils")
2014
except Exception:

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
cartopy >= 0.18
66
matplotlib >= 3.4
77
numpy >= 1.17
8-
setuptools >= 40.4 # for pkg_resources

setup.cfg

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ classifiers =
1414
Intended Audience :: Science/Research
1515
Programming Language :: Python
1616
Programming Language :: Python :: 3
17-
Programming Language :: Python :: 3.7
18-
Programming Language :: Python :: 3.8
1917
Programming Language :: Python :: 3.9
2018
Programming Language :: Python :: 3.10
2119
Programming Language :: Python :: 3.11
@@ -24,12 +22,11 @@ classifiers =
2422
packages = find:
2523
zip_safe = False # https://mypy.readthedocs.io/en/latest/installed_packages.html
2624
include_package_data = True
27-
python_requires = >=3.7
25+
python_requires = >=3.9
2826
install_requires =
2927
cartopy >= 0.18
3028
matplotlib >= 3.4
3129
numpy >= 1.17
32-
setuptools >= 40.4 # for pkg_resources
3330

3431
[tool:pytest]
3532
filterwarnings =

0 commit comments

Comments
 (0)