From 1208b3d503913eabe8ac96db18ee2ad14af1bdd6 Mon Sep 17 00:00:00 2001 From: Hernan Grecco Date: Sat, 29 Apr 2023 19:10:38 -0300 Subject: [PATCH] Apply NEP-29: Pint now requires Python 3.9+ and NumPy 1.21+ --- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/docs.yml | 4 ++-- .readthedocs.yaml | 2 +- README.rst | 2 +- docs/getting/index.rst | 2 +- docs/getting/overview.rst | 2 +- pint/util.py | 4 +--- pyproject.toml | 3 +-- 8 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 369b9b914..e73a8c829 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,15 +7,15 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, "3.10", "3.11"] - numpy: [null, "numpy>=1.19,<2.0.0"] + python-version: [3.9, "3.10", "3.11"] + numpy: [null, "numpy>=1.21,<2.0.0"] uncertainties: [null, "uncertainties==3.1.6", "uncertainties>=3.1.6,<4.0.0"] extras: [null] include: - - python-version: 3.8 # Minimal versions + - python-version: 3.9 # Minimal versions numpy: "numpy" extras: matplotlib==2.2.5 - - python-version: 3.8 + - python-version: 3.9 numpy: "numpy" uncertainties: "uncertainties" extras: "sparse xarray netCDF4 dask[complete]==2023.4.0 graphviz babel==2.8" @@ -92,8 +92,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, "3.10", "3.11"] - numpy: [ "numpy>=1.19,<2.0.0" ] + python-version: [3.9, "3.10", "3.11"] + numpy: [ "numpy>=1.21,<2.0.0" ] runs-on: windows-latest env: @@ -153,8 +153,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, "3.10", "3.11"] - numpy: [null, "numpy>=1.19,<2.0.0" ] + python-version: [3.9, "3.10", "3.11"] + numpy: [null, "numpy>=1.21,<2.0.0" ] runs-on: macos-latest env: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 234068354..0a26da8ad 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,10 +14,10 @@ jobs: - name: Get tags run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Set up Python 3.8 + - name: Set up minimal Python version uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Get pip cache dir id: pip-cache diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 2bda3d495..830a8c2b8 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -5,7 +5,7 @@ sphinx: configuration: docs/conf.py fail_on_warning: false python: - version: 3.8 + version: 3.9 install: - requirements: requirements_docs.txt - method: pip diff --git a/README.rst b/README.rst index 32879d9b9..89f19f474 100644 --- a/README.rst +++ b/README.rst @@ -43,7 +43,7 @@ and constants. Due to its modular design, you can extend (or even rewrite!) the complete list without changing the source code. It supports a lot of numpy mathematical operations **without monkey patching or wrapping numpy**. -It has a complete test coverage. It runs in Python 3.8+ with no other dependency. +It has a complete test coverage. It runs in Python 3.9+ with no other dependency. It is licensed under BSD. It is extremely easy and natural to use: diff --git a/docs/getting/index.rst b/docs/getting/index.rst index 9907aeb29..41ffaf93f 100644 --- a/docs/getting/index.rst +++ b/docs/getting/index.rst @@ -8,7 +8,7 @@ The getting started guide aims to get you using pint productively as quickly as Installation ------------ -Pint has no dependencies except Python itself. In runs on Python 3.8+. +Pint has no dependencies except Python itself. In runs on Python 3.9+. .. grid:: 2 diff --git a/docs/getting/overview.rst b/docs/getting/overview.rst index cd639aaa3..61dfc14f4 100644 --- a/docs/getting/overview.rst +++ b/docs/getting/overview.rst @@ -14,7 +14,7 @@ Due to its modular design, you can extend (or even rewrite!) the complete list without changing the source code. It supports a lot of numpy mathematical operations **without monkey patching or wrapping numpy**. -It has a complete test coverage. It runs in Python 3.8+ with no other +It has a complete test coverage. It runs in Python 3.9+ with no other dependencies. It is licensed under a `BSD 3-clause style license`_. It is extremely easy and natural to use: diff --git a/pint/util.py b/pint/util.py index d5f3aab36..8b6200919 100644 --- a/pint/util.py +++ b/pint/util.py @@ -1020,9 +1020,7 @@ def sized(y) -> bool: return True -@functools.lru_cache( - maxsize=None -) # TODO: replace with cache when Python 3.8 is dropped. +@functools.cache def _build_type(class_name: str, bases): return type(class_name, bases, dict()) diff --git a/pyproject.toml b/pyproject.toml index 72b656026..e23141236 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,12 +22,11 @@ classifiers = [ "Programming Language :: Python", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Libraries", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11" ] -requires-python = ">=3.8" +requires-python = ">=3.9" dynamic = ["version"] [tool.setuptools.package-data]