diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c1314de..852617ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,12 +34,12 @@ jobs: strategy: matrix: python-version: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" + - "3.13" name: Check Python ${{ matrix.python-version }} steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 550ea5a2..9b7ff2d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.6 + rev: v0.6.2 hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/README.md b/README.md index c8ad6a17..9bf8333c 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.7+ (3.6 users get version 2.4). See [what's new](https://hist.readthedocs.io/en/latest/changelog.html). +Python 3.8+ (3.6-3.7 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/installation.rst b/docs/user-guide/installation.rst index 9be6f9fd..868162ab 100644 --- a/docs/user-guide/installation.rst +++ b/docs/user-guide/installation.rst @@ -17,5 +17,4 @@ You can also install it with Conda from conda-forge. Supported platforms are identical to -`boost-histogram `_, -though for the latest version of Hist you need Python 3.7+. +`boost-histogram `_. diff --git a/pyproject.toml b/pyproject.toml index 74716b21..1a40142e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,12 +17,12 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Mathematics", @@ -34,9 +34,9 @@ keywords = [ "boost-histogram", "dask-histogram", ] -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = [ - "boost-histogram>=1.3.1,<1.5", + "boost-histogram>=1.3.1,<1.6", "histoprint>=2.2.0", 'numpy>=1.14.5', 'typing-extensions>=4;python_version<"3.11"', @@ -67,14 +67,14 @@ fit = [ "iminuit >=2", ] dask = [ - "dask[dataframe] >=2022; python_version>='3.8'", - "dask_histogram >=2023.1; python_version>='3.8'" + "dask[dataframe] >=2022", + "dask_histogram >=2023.1", ] test = [ "pytest >=6", "pytest-mpl >=0.12", - "dask[dataframe] >=2022; python_version>='3.8' and python_version<'3.12'", - "dask_histogram >=2023.1; python_version>='3.8' and python_version<'3.12'", + "dask[dataframe] >=2022; python_version<'3.13'", + "dask_histogram >=2023.1; python_version<'3.13'", ] dev = [ "pytest >=6", @@ -84,8 +84,8 @@ dev = [ "scipy >=1.4", "iminuit >=2; python_version<'3.11'", "ipykernel", - "dask[dataframe] >=2022; python_version>='3.8'", - "dask_histogram >=2023.1; python_version>='3.8'", + "dask[dataframe] >=2022", + "dask_histogram >=2023.1", ] docs = [ "pytest >=6", @@ -96,8 +96,8 @@ docs = [ "iminuit >=2", "ipython_genutils", "graphviz >=0.20.1", - "dask[dataframe] >=2022; python_version>='3.8'", - "dask_histogram >=2023.1; python_version>='3.8'", + "dask[dataframe] >=2022", + "dask_histogram >=2023.1", "nbsphinx", "sphinx >=3.0.0", "sphinx_copybutton", @@ -150,7 +150,7 @@ ignore_missing_imports = true [tool.pylint] -py-version = "3.7" +py-version = "3.8" extension-pkg-allow-list = ["boost_histogram._core"] reports.output-format = "colorized" similarities.ignore-imports = "yes" diff --git a/src/hist/_compat/typing.py b/src/hist/_compat/typing.py index 707bf2ff..5b1bc54b 100644 --- a/src/hist/_compat/typing.py +++ b/src/hist/_compat/typing.py @@ -3,11 +3,6 @@ import sys from typing import TYPE_CHECKING, Any -if sys.version_info < (3, 8): - from typing_extensions import Literal, Protocol, SupportsIndex -else: - from typing import Literal, Protocol, SupportsIndex - if sys.version_info < (3, 11): from typing_extensions import Self else: @@ -21,7 +16,7 @@ Ufunc = Any -__all__ = ["Literal", "Protocol", "SupportsIndex", "Ufunc", "ArrayLike", "Self"] +__all__ = ["Ufunc", "ArrayLike", "Self"] def __dir__() -> list[str]: diff --git a/src/hist/axis/__init__.py b/src/hist/axis/__init__.py index 909d7c45..8d58c598 100644 --- a/src/hist/axis/__init__.py +++ b/src/hist/axis/__init__.py @@ -2,14 +2,13 @@ import typing from collections.abc import Iterable -from typing import Any +from typing import Any, Protocol import boost_histogram as bh import boost_histogram.axis as bha import hist -from .._compat.typing import Protocol from ..axestuple import ArrayTuple, NamedAxesTuple from . import transform diff --git a/src/hist/basehist.py b/src/hist/basehist.py index 358d2ef4..3d0a99b7 100644 --- a/src/hist/basehist.py +++ b/src/hist/basehist.py @@ -4,7 +4,18 @@ import operator import typing import warnings -from typing import Any, Callable, Generator, Iterator, Mapping, Sequence, Tuple, Union +from typing import ( + Any, + Callable, + Generator, + Iterator, + Mapping, + Protocol, + Sequence, + SupportsIndex, + Tuple, + Union, +) import boost_histogram as bh import histoprint @@ -13,7 +24,7 @@ import hist from . import interop -from ._compat.typing import ArrayLike, Protocol, Self, SupportsIndex +from ._compat.typing import ArrayLike, Self from .axestuple import NamedAxesTuple from .axis import AxisProtocol from .quick_construct import MetaConstructor diff --git a/src/hist/interop.py b/src/hist/interop.py index 495ffc15..3dbc54ce 100644 --- a/src/hist/interop.py +++ b/src/hist/interop.py @@ -1,11 +1,11 @@ from __future__ import annotations from collections.abc import Sequence -from typing import Any, Callable, Iterator, TypeVar, cast +from typing import Any, Callable, Iterator, Protocol, TypeVar, cast import numpy as np -from ._compat.typing import ArrayLike, Protocol +from ._compat.typing import ArrayLike T_contra = TypeVar("T_contra", contravariant=True) U = TypeVar("U") diff --git a/src/hist/intervals.py b/src/hist/intervals.py index c28d15d0..e5ec2548 100644 --- a/src/hist/intervals.py +++ b/src/hist/intervals.py @@ -1,11 +1,9 @@ from __future__ import annotations -from typing import Any +from typing import Any, Literal import numpy as np -from ._compat.typing import Literal - try: from scipy import stats except ModuleNotFoundError: diff --git a/src/hist/plot.py b/src/hist/plot.py index c46c9bbf..9690660b 100644 --- a/src/hist/plot.py +++ b/src/hist/plot.py @@ -2,14 +2,12 @@ import inspect import sys -from typing import Any, Callable, Iterable, NamedTuple, Union +from typing import Any, Callable, Iterable, Literal, NamedTuple, Union import numpy as np import hist -from ._compat.typing import Literal - try: import matplotlib.axes import matplotlib.pyplot as plt diff --git a/src/hist/svgutils.py b/src/hist/svgutils.py index 30054e6f..e44d6bcb 100644 --- a/src/hist/svgutils.py +++ b/src/hist/svgutils.py @@ -1,6 +1,8 @@ from __future__ import annotations -from ._compat.typing import Protocol, Self +from typing import Protocol + +from ._compat.typing import Self class SupportsStr(Protocol):