From c03f232017c58c962275fe9a3c5578de6928721f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Jul 2023 02:30:55 +0000 Subject: [PATCH 1/6] chore(deps): update pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/setup-cfg-fmt: v2.3.0 → v2.4.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.3.0...v2.4.0) - https://github.com/charliermarsh/ruff-pre-commit → https://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.0.272 → v0.0.276](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.272...v0.0.276) - [github.com/pre-commit/mirrors-mypy: v1.3.0 → v1.4.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.3.0...v1.4.1) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 38352639..679aa93b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,19 +29,19 @@ repos: additional_dependencies: [pyyaml] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.3.0 + rev: v2.4.0 hooks: - id: setup-cfg-fmt args: [--include-version-classifiers, --max-py-version=3.11] -- repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.0.272" +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.0.276" hooks: - id: ruff args: ["--fix", "--show-fixes"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.3.0 + rev: v1.4.1 hooks: - id: mypy files: ^src From 3b49fd5f926a745278e3b9ece439c958847ba951 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Jul 2023 02:31:39 +0000 Subject: [PATCH 2/6] style: pre-commit fixes --- setup.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 5b97ccf8..00ded52e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,6 @@ 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 @@ -58,7 +57,7 @@ packages = install_requires = numpy>=1.13.3 typing-extensions;python_version<'3.8' -python_requires = >=3.7 +python_requires = >=3.8 include_package_data = True package_dir = =src From ce3256fced6d1ab46ef3be0bf1f82f6dbe99ca0a Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 4 Jul 2023 09:51:39 -0400 Subject: [PATCH 3/6] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 679aa93b..2d77438c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: rev: v2.4.0 hooks: - id: setup-cfg-fmt - args: [--include-version-classifiers, --max-py-version=3.11] + args: [--include-version-classifiers, --min-py3-version=3.7, --max-py-version=3.11] - repo: https://github.com/astral-sh/ruff-pre-commit rev: "v0.0.276" From f30363e57e0e20180b845fb24feee77c4144a587 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 4 Jul 2023 10:00:18 -0400 Subject: [PATCH 4/6] Update setup.cfg --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 00ded52e..5b97ccf8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,6 +24,7 @@ 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 @@ -57,7 +58,7 @@ packages = install_requires = numpy>=1.13.3 typing-extensions;python_version<'3.8' -python_requires = >=3.8 +python_requires = >=3.7 include_package_data = True package_dir = =src From d41aaa6e8e6d8d9ce71e6cc9b60b46dfae644bf5 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 4 Jul 2023 10:21:34 -0400 Subject: [PATCH 5/6] chore: better classvar typing --- src/boost_histogram/_internal/axestuple.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/boost_histogram/_internal/axestuple.py b/src/boost_histogram/_internal/axestuple.py index b68c4bf2..11910c77 100644 --- a/src/boost_histogram/_internal/axestuple.py +++ b/src/boost_histogram/_internal/axestuple.py @@ -21,7 +21,7 @@ class MGridOpts(TypedDict): class ArrayTuple(tuple): # type: ignore[type-arg] __slots__ = () # This is an exhaustive list as of NumPy 1.19 - _REDUCTIONS = {"sum", "any", "all", "min", "max", "prod"} + _REDUCTIONS = frozenset(("sum", "any", "all", "min", "max", "prod")) def __getattr__(self, name: str) -> Any: if name in self._REDUCTIONS: @@ -51,7 +51,7 @@ def broadcast(self: A) -> A: @set_module("boost_histogram.axis") class AxesTuple(tuple): # type: ignore[type-arg] __slots__ = () - _MGRIDOPTS: MGridOpts = {"sparse": True, "indexing": "ij"} + _MGRIDOPTS: ClassVar[MGridOpts] = {"sparse": True, "indexing": "ij"} def __init__(self, __iterable: Iterable[Axis]) -> None: for item in self: From 741379a74aac446e71cd0477429c03e98c936bba Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 4 Jul 2023 10:29:48 -0400 Subject: [PATCH 6/6] Update axestuple.py --- src/boost_histogram/_internal/axestuple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boost_histogram/_internal/axestuple.py b/src/boost_histogram/_internal/axestuple.py index 11910c77..3247836e 100644 --- a/src/boost_histogram/_internal/axestuple.py +++ b/src/boost_histogram/_internal/axestuple.py @@ -1,7 +1,7 @@ from __future__ import annotations from functools import partial -from typing import Any, Iterable, TypeVar +from typing import Any, ClassVar, Iterable, TypeVar import numpy as np