From 5f9f71748df4d4f624154f3b3a7acb55fba05d16 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Jun 2021 17:03:49 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 21.5b2 → 21.6b0](https://github.com/psf/black/compare/21.5b2...21.6b0) - [github.com/pre-commit/mirrors-mypy: v0.812 → v0.910](https://github.com/pre-commit/mirrors-mypy/compare/v0.812...v0.910) - [github.com/PyCQA/isort: 5.8.0 → 5.9.1](https://github.com/PyCQA/isort/compare/5.8.0...5.9.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3affe953..7bd23777 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ repos: - repo: https://github.com/psf/black - rev: 21.5b2 + rev: 21.6b0 hooks: - id: black language_version: python3 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.812 + rev: v0.910 hooks: - id: mypy - repo: https://github.com/PyCQA/flake8 @@ -18,7 +18,7 @@ repos: - id: check-toml - id: check-yaml - repo: https://github.com/PyCQA/isort - rev: 5.8.0 + rev: 5.9.1 hooks: - id: isort additional_dependencies: [toml] From 99d90acf7a46ae3e0598ec67e6fd26f6a613697c Mon Sep 17 00:00:00 2001 From: Arjan Molenaar Date: Fri, 9 Jul 2021 23:19:13 +0200 Subject: [PATCH 2/2] Define Constraint to be Hashable as well For LRU cache. --- gaphas/solver/constraint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gaphas/solver/constraint.py b/gaphas/solver/constraint.py index 02cb2469..d23cd40e 100644 --- a/gaphas/solver/constraint.py +++ b/gaphas/solver/constraint.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Callable, Collection, Set +from typing import Callable, Collection, Hashable, Set from typing_extensions import Protocol, runtime_checkable @@ -8,7 +8,7 @@ @runtime_checkable -class Constraint(Protocol): +class Constraint(Protocol, Hashable): def add_handler(self, handler: Callable[[Constraint], None]) -> None: ...