[pre-commit.ci] pre-commit autoupdate (#93)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.2.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.1.0...v4.2.0)
- [github.com/psf/black: 21.12b0 → 22.3.0](https://github.com/psf/black/compare/21.12b0...22.3.0)
- [github.com/hadialqattan/pycln: v1.1.0 → v1.2.5](https://github.com/hadialqattan/pycln/compare/v1.1.0...v1.2.5)
- [github.com/Lucas-C/pre-commit-hooks: v1.1.10 → v1.1.13](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.1.10...v1.1.13)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Josh Karpel <josh.karpel@gmail.com>
pull/99/head^2
pre-commit-ci[bot] 2 years ago committed by GitHub
parent 767e4e0263
commit 4d602c0b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: check-added-large-files
- id: check-ast
@ -28,11 +28,11 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/hadialqattan/pycln
rev: v1.1.0
rev: v1.2.5
hooks:
- id: pycln
args: [ --config=pyproject.toml ]
@ -41,6 +41,6 @@ repos:
hooks:
- id: isort
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
rev: v1.1.13
hooks:
- id: remove-crlf

@ -138,7 +138,7 @@ def code():
return Panel(
Syntax(
"".join(lines),
lexer_name="python",
lexer="python",
line_numbers=True,
start_line=line_number,
),

@ -88,7 +88,7 @@ class Example(Presentable):
input = (self._cache.input or "") if self._cache is not None else ""
return Syntax(
input.strip(),
lexer_name=self.language,
lexer=self.language,
code_width=max(len(line) for line in input.splitlines()),
)

@ -2,7 +2,7 @@ from dataclasses import dataclass
from click._termui_impl import Editor
from rich.align import Align
from rich.console import Console, ConsoleRenderable, RenderGroup
from rich.console import Console, ConsoleRenderable, Group
from rich.padding import Padding
from rich.style import Style
from rich.table import Column, Table
@ -53,7 +53,7 @@ class Help:
)
return Padding(
RenderGroup(
Group(
Align.center(action_table),
Align.center(version_details(self.state.console)),
),

@ -7,6 +7,7 @@ from pathlib import Path
from typing import Iterable, List, NamedTuple, Tuple, Union
from PIL import Image as Img
from PIL.Image import Resampling
from rich.color import Color
from rich.console import Console, ConsoleOptions
from rich.segment import Segment
@ -23,7 +24,7 @@ class ImageSize(NamedTuple):
Pixels = Tuple[Union[Tuple[int, int, int], None], ...]
@lru_cache(maxsize=2 ** 8)
@lru_cache(maxsize=2**8)
def _pixels_to_segments(pixels: Pixels, size: ImageSize) -> List[Segment]:
line = Segment.line()
@ -46,7 +47,7 @@ def _pixels_to_segments(pixels: Pixels, size: ImageSize) -> List[Segment]:
return list(Segment.simplify(segments))
@lru_cache(maxsize=2 ** 4)
@lru_cache(maxsize=2**4)
def _load_image(path: Path) -> Image:
return Img.open(path)
@ -75,7 +76,7 @@ class Image:
def _resize(self, size: ImageSize) -> Img:
return self.img.resize(
size=size,
resample=Img.LANCZOS,
resample=Resampling.LANCZOS,
)
def __rich_console__(self, console: Console, options: ConsoleOptions) -> Iterable[Segment]:

@ -216,7 +216,7 @@ def source() -> None:
console = Console()
with console.pager(styles=True):
console.print(Syntax(DEMO_SOURCE.read_text(), lexer_name="python"))
console.print(Syntax(DEMO_SOURCE.read_text(), lexer="python"))
@demo.command()

@ -1,8 +1,10 @@
import os
from io import StringIO
from pathlib import Path
from textwrap import dedent
import pytest
from hypothesis import settings
from rich.console import Console
from typer.testing import CliRunner
@ -11,6 +13,9 @@ from spiel.constants import DECK
from spiel.slide import Slide
from spiel.state import State
settings.register_profile("default", deadline=None)
settings.load_profile(os.getenv("HYPOTHESIS_PROFILE", "default"))
@pytest.fixture
def runner() -> CliRunner:

@ -2,7 +2,7 @@ from typing import Any
import pytest
from _pytest.tmpdir import TempPathFactory
from hypothesis import given, infer
from hypothesis import given
from hypothesis import strategies as st
from hypothesis.strategies import SearchStrategy
from rich.console import Console
@ -15,7 +15,7 @@ from spiel.repls import REPLS
def valid_options() -> SearchStrategy[Options]:
return st.builds(
Options,
profiling=infer,
profiling=st.booleans(),
repl=st.sampled_from(list(REPLS.keys())),
)

Loading…
Cancel
Save