From 007b739be97106b72c1312a20d4c44e4beeb0708 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 30 Jan 2025 17:39:29 -0500 Subject: [PATCH] feat: drop Python 3.8 Signed-off-by: Henry Schreiner --- .github/workflows/ci.yml | 1 - README.md | 2 +- docs/user-guide/accumulators.rst | 4 ++-- pyproject.toml | 7 +++---- src/hist/basehist.py | 10 +++------- src/hist/interop.py | 4 ++-- src/hist/plot.py | 3 ++- src/hist/quick_construct.py | 3 ++- src/hist/stack.py | 3 ++- 9 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e31e2088..7ff99f82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,6 @@ jobs: strategy: matrix: python-version: - - "3.8" - "3.9" - "3.10" - "3.11" diff --git a/README.md b/README.md index 9bf8333c..66a91426 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Hist is an analyst-friendly front-end for [boost-histogram](https://github.com/scikit-hep/boost-histogram), designed for -Python 3.8+ (3.6-3.7 users get older versions). See [what's new](https://hist.readthedocs.io/en/latest/changelog.html). +Python 3.9+ (3.6-3.8 users get older versions). See [what's new](https://hist.readthedocs.io/en/latest/changelog.html). ![Slideshow of features. See docs/banner_slides.md for text if the image is not readable.](https://github.com/scikit-hep/hist/raw/main/docs/_images/banner.gif) diff --git a/docs/user-guide/accumulators.rst b/docs/user-guide/accumulators.rst index 20b21812..b6fd9cff 100644 --- a/docs/user-guide/accumulators.rst +++ b/docs/user-guide/accumulators.rst @@ -26,8 +26,8 @@ is internally used by the Double and Unlimited storages to perform sums when needed. It uses a highly accurate Neumaier sum to compute the floating point sum with a correction term. Since this accumulator is never returned by a histogram, it is not available in a view form, but only as a single accumulator -for comparison and access to the algorithm. Usage example in Python 3.8, -showing how non-accurate sums fail to produce the obvious answer, 2.0:: +for comparison and access to the algorithm. Usage example, showing how +non-accurate sums fail to produce the obvious answer, 2.0:: import math import numpy as np diff --git a/pyproject.toml b/pyproject.toml index b5878091..ef83ca0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,6 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -34,7 +33,7 @@ keywords = [ "boost-histogram", "dask-histogram", ] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ "boost-histogram>=1.3.1,<1.6", "histoprint>=2.2.0", @@ -118,7 +117,7 @@ filterwarnings = [ [tool.mypy] warn_unused_configs = true files = "src" -python_version = "3.8" +python_version = "3.9" strict = true enable_error_code = ["ignore-without-code", "truthy-bool", "redundant-expr"] warn_unreachable = true @@ -138,7 +137,7 @@ ignore_missing_imports = true [tool.pylint] -py-version = "3.8" +py-version = "3.9" extension-pkg-allow-list = ["boost_histogram._core"] reports.output-format = "colorized" similarities.ignore-imports = "yes" diff --git a/src/hist/basehist.py b/src/hist/basehist.py index 3d0a99b7..79c3a8f9 100644 --- a/src/hist/basehist.py +++ b/src/hist/basehist.py @@ -4,16 +4,12 @@ import operator import typing import warnings +from collections.abc import Generator, Iterator, Mapping, Sequence from typing import ( Any, Callable, - Generator, - Iterator, - Mapping, Protocol, - Sequence, SupportsIndex, - Tuple, Union, ) @@ -48,8 +44,8 @@ def __lt__(self, __other: Any) -> bool: ... SupportsIndex, str, Callable[[bh.axis.Axis], int], slice, "ellipsis" ] IndexingWithMapping = Union[InnerIndexing, Mapping[Union[int, str], InnerIndexing]] -IndexingExpr = Union[IndexingWithMapping, Tuple[IndexingWithMapping, ...]] -AxisTypes = Union[AxisProtocol, Tuple[int, float, float]] +IndexingExpr = Union[IndexingWithMapping, tuple[IndexingWithMapping, ...]] +AxisTypes = Union[AxisProtocol, tuple[int, float, float]] # Workaround for bug in mplhep diff --git a/src/hist/interop.py b/src/hist/interop.py index 3dbc54ce..492a0b68 100644 --- a/src/hist/interop.py +++ b/src/hist/interop.py @@ -1,7 +1,7 @@ from __future__ import annotations -from collections.abc import Sequence -from typing import Any, Callable, Iterator, Protocol, TypeVar, cast +from collections.abc import Iterator, Sequence +from typing import Any, Callable, Protocol, TypeVar, cast import numpy as np diff --git a/src/hist/plot.py b/src/hist/plot.py index 9690660b..96007cf4 100644 --- a/src/hist/plot.py +++ b/src/hist/plot.py @@ -2,7 +2,8 @@ import inspect import sys -from typing import Any, Callable, Iterable, Literal, NamedTuple, Union +from collections.abc import Iterable +from typing import Any, Callable, Literal, NamedTuple, Union import numpy as np diff --git a/src/hist/quick_construct.py b/src/hist/quick_construct.py index 95861caf..31545d23 100644 --- a/src/hist/quick_construct.py +++ b/src/hist/quick_construct.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Callable, Iterable +from collections.abc import Iterable +from typing import TYPE_CHECKING, Any, Callable import numpy as np diff --git a/src/hist/stack.py b/src/hist/stack.py index 3dfdad52..f1433d04 100644 --- a/src/hist/stack.py +++ b/src/hist/stack.py @@ -2,7 +2,8 @@ import copy import typing -from typing import Any, Iterator +from collections.abc import Iterator +from typing import Any import histoprint import numpy as np