Skip to content

Commit 1c87074

Browse files
committed
Fix pre-commit issues
1 parent 43970ee commit 1c87074

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- conda-forge
44
- microsoft
55
dependencies:
6-
- python=3.9
6+
- python=3.10
77
- pip=20.2.2
88
- pytest=7
99
- nodejs=16

src/psc/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Provide a web server to browse the examples."""
22
import contextlib
3+
from collections.abc import Iterator
34
from pathlib import PurePath
45
from typing import AsyncContextManager
5-
from typing import Iterator
66

77
from starlette.applications import Starlette
88
from starlette.requests import Request

src/psc/fixtures.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
from __future__ import annotations
33

44
import builtins
5+
from collections.abc import Callable
6+
from collections.abc import Generator
57
from dataclasses import dataclass
68
from dataclasses import field
79
from mimetypes import guess_type
8-
from typing import Callable
9-
from typing import Generator
1010
from urllib.parse import urlparse
1111

1212
import pytest
@@ -199,23 +199,28 @@ def fake_document() -> FakeDocument:
199199

200200
@dataclass
201201
class ElementNode:
202+
"""An element node."""
203+
202204
value: str
203205
document: FakeDocument
204206

205207
def write(self, value: str) -> None:
206208
"""Collect anything that is written to the node."""
207209
self.document.log.append(value)
208210

209-
def removeAttribute(self, name) -> None:
211+
def removeAttribute(self, name) -> None: # noqa
210212
"""Pretend to remove an attribute from this node."""
211213
pass
212214

213215

214216
@dataclass
215217
class ElementCallable:
218+
"""A callable that returns an ElementNode."""
219+
216220
document: FakeDocument
217221

218222
def __call__(self, key: str) -> ElementNode:
223+
"""Return an ElementNode."""
219224
value = self.document.values[key]
220225
node = ElementNode(value, self.document)
221226
return node

src/psc/gallery/examples/interest_calculator/calculator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
def interest(*args, **kwargs):
2+
"""Main interest calculation function."""
23
# Signal that PyScript is alive by setting the ``Calculate``
34
# button away from disabled.
45
calculate_button = Element("calc") # noqa

tests/test_resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_html_page() -> None:
9090
"""Make an instance of a .html Page resource and test it."""
9191
this_page = Page(path=PurePath("contributing"))
9292
assert this_page.title == "Contributing"
93-
assert this_page.subtitle == "How to get involved in the PyCharm Collective."
93+
assert this_page.subtitle == "How to get involved in the PyScript Collective."
9494
assert 'id="viewer"' in this_page.body
9595

9696

0 commit comments

Comments
 (0)