mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
run pre-commit on all files (#1789)
pre-commit.ci has been disabled for a while. This PR ensures that all the files has been validated/formatted by pre-commit, to avoid spurious diffs in subsequent PRs. During the process, ruff broke the code because it removed an "unused" import which was actually used. A linter which breaks my code is a linter which I cannot trust, so I just removed it. I re-enabled isort instead.
This commit is contained in:
@@ -29,15 +29,15 @@
|
||||
# pyscript.magic_js. This is the blessed way to access them from pyscript,
|
||||
# as it works transparently in both the main thread and worker cases.
|
||||
|
||||
from pyscript.display import HTML, display
|
||||
from pyscript.magic_js import (
|
||||
RUNNING_IN_WORKER,
|
||||
PyWorker,
|
||||
window,
|
||||
current_target,
|
||||
document,
|
||||
sync,
|
||||
current_target,
|
||||
window,
|
||||
)
|
||||
from pyscript.display import HTML, display
|
||||
|
||||
try:
|
||||
from pyscript.event_handling import when
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from pyscript.util import NotSupported
|
||||
import js as globalThis
|
||||
from pyscript.util import NotSupported
|
||||
|
||||
RUNNING_IN_WORKER = not hasattr(globalThis, "document")
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import random
|
||||
from datetime import datetime as dt
|
||||
|
||||
from pyscript import display
|
||||
from pyweb import pydom
|
||||
from pyweb.base import when
|
||||
from datetime import datetime as dt
|
||||
|
||||
|
||||
@when("click", "#just-a-button")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
from pyscript import document, when
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
from pyscript import document, when
|
||||
from pyweb import pydom
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
###### magic monkey patching ######
|
||||
import sys
|
||||
import builtins
|
||||
from pyscript import sync
|
||||
import sys
|
||||
|
||||
from pyodide.code import eval_code
|
||||
from pyscript import sync
|
||||
|
||||
sys.stdout = sync
|
||||
builtins.input = sync.readline
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from pyscript import display, sync
|
||||
|
||||
import a
|
||||
from pyscript import display, sync
|
||||
|
||||
display("Hello World", target="test", append=True)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import re
|
||||
|
||||
import pytest
|
||||
|
||||
from .support import PyScriptTest, skip_worker, only_main
|
||||
from .support import PyScriptTest, only_main, skip_worker
|
||||
|
||||
|
||||
class TestBasic(PyScriptTest):
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
################################################################################
|
||||
|
||||
import base64
|
||||
import html
|
||||
import io
|
||||
import os
|
||||
import re
|
||||
import html
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
@@ -15,9 +15,9 @@ from .support import (
|
||||
PyScriptTest,
|
||||
filter_inner_text,
|
||||
filter_page_content,
|
||||
wait_for_render,
|
||||
skip_worker,
|
||||
only_main,
|
||||
skip_worker,
|
||||
wait_for_render,
|
||||
)
|
||||
|
||||
DISPLAY_OUTPUT_ID_PATTERN = r'script-py[id^="py-"]'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import pytest
|
||||
|
||||
from .support import PyScriptTest, filter_inner_text, only_main
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user