Pin Node.js version in conda env and fix mypy tests (#4955)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Gyeongjae Choi 2024-07-21 18:15:39 +09:00 committed by GitHub
parent 4d1b60c78f
commit 139b40f48a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 11 deletions

View File

@ -50,7 +50,7 @@ repos:
- id: codespell
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.10.0"
rev: "v1.11.0"
hooks:
- id: mypy
files: ^(packages/.*/src|src|pyodide-build/pyodide_build)
@ -75,7 +75,7 @@ repos:
- id: mypy
name: mypy-tests
args: [--ignore-missing-imports]
files: ^(packages/|docs|/conftest.py|src/tests|pyodide-build/pyodide_build/tests)
files: ^(packages/|docs|/conftest.py|src/tests)
exclude: (^packages/.*/setup.py|/src|^packages/aiohttp/aiohttp_patch.py$)
additional_dependencies: *mypy-deps

View File

@ -3,7 +3,7 @@ channels:
- conda-forge
dependencies:
- python=3.12
- nodejs>=18
- nodejs>=18,<22.5 # Node.js 22.5 has some issues with installing packages https://github.com/nodejs/node/issues/53902
- ccache
- f2c
- swig

View File

@ -5,7 +5,7 @@ pre-commit
build~=1.2.0
sphinx-click
hypothesis
mypy>=1.10,<2
mypy==1.11.0
# (FIXME: 2024/01/28) The latest pytest-asyncio 0.23.3 is not compatible with pytest 8.0.0
pytest<8.0.0
pytest-asyncio

View File

@ -135,7 +135,7 @@ class PyodideFuture(Future[T]):
"""Equivalent to ``then(None, onrejected)``"""
return self.then(None, onrejected)
def finally_(self, onfinally: Callable[[], None]) -> "PyodideFuture[T]":
def finally_(self, onfinally: Callable[[], Any]) -> "PyodideFuture[T]":
"""When the future is either resolved or rejected, call ``onfinally`` with
no arguments.
"""
@ -269,10 +269,10 @@ class WebLoop(asyncio.AbstractEventLoop):
# Scheduling methods: use browser.setTimeout to schedule tasks on the browser event loop.
#
def call_soon(
def call_soon( # type: ignore[override]
self,
callback: Callable[..., Any],
*args: Any, # type: ignore[override]
*args: Any,
context: contextvars.Context | None = None,
) -> asyncio.Handle:
"""Arrange for a callback to be called as soon as possible.
@ -285,10 +285,10 @@ class WebLoop(asyncio.AbstractEventLoop):
delay = 0
return self.call_later(delay, callback, *args, context=context)
def call_soon_threadsafe(
def call_soon_threadsafe( # type: ignore[override]
self,
callback: Callable[..., Any],
*args: Any, # type: ignore[override]
*args: Any,
context: contextvars.Context | None = None,
) -> asyncio.Handle:
"""Like ``call_soon()``, but thread-safe.
@ -369,7 +369,7 @@ class WebLoop(asyncio.AbstractEventLoop):
delay = when - cur_time
return self.call_later(delay, callback, *args, context=context)
def run_in_executor(self, executor, func, *args):
def run_in_executor(self, executor, func, *args): # type: ignore[override]
"""Arrange for func to be called in the specified executor.
This is normally supposed to run func(*args) in a separate process or
@ -407,7 +407,7 @@ class WebLoop(asyncio.AbstractEventLoop):
"""
return time.monotonic()
def create_task(self, coro, *, name=None):
def create_task(self, coro, *, name=None): # type: ignore[override]
"""Schedule a coroutine object.
Return a task object.