Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4256a81

Browse filesBrowse files
authored
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.
1 parent d5b6935 commit 4256a81
Copy full SHA for 4256a81

File tree

16 files changed

+36
-57
lines changed
Filter options

16 files changed

+36
-57
lines changed

‎.github/workflows/publish-release.yml

Copy file name to clipboardExpand all lines: .github/workflows/publish-release.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
- name: build
4343
run: npm run build
44-
44+
4545
- name: Generate index.html in snapshot
4646
working-directory: .
4747
run: sed 's#_PATH_#https://pyscript.net/releases/${{ github.ref_name }}/#' ./public/index.html > ./pyscript.core/dist/index.html

‎.github/workflows/publish-snapshot.yml

Copy file name to clipboardExpand all lines: .github/workflows/publish-snapshot.yml
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ jobs:
3939
${{ runner.os }}-build-${{ env.cache-name }}-
4040
${{ runner.os }}-build-
4141
${{ runner.os }}-
42-
42+
4343
- name: Install Dependencies
4444
run: npm install
45-
45+
4646
- name: Build Pyscript.core
4747
run: npm run build
48-
48+
4949
- name: Configure AWS credentials
5050
uses: aws-actions/configure-aws-credentials@v4
5151
with:
@@ -58,4 +58,4 @@ jobs:
5858

5959
- name: Copy to Snapshot
6060
run: >
61-
aws s3 sync ./dist/ s3://pyscript.net/snapshots/${{ inputs.snapshot_version }}/
61+
aws s3 sync ./dist/ s3://pyscript.net/snapshots/${{ inputs.snapshot_version }}/

‎.github/workflows/publish-unstable.yml

Copy file name to clipboardExpand all lines: .github/workflows/publish-unstable.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
- name: Build
4848
run: npm run build
49-
49+
5050
- name: Generate index.html in snapshot
5151
working-directory: .
5252
run: sed 's#_PATH_#https://pyscript.net/unstable/#' ./public/index.html > ./pyscript.core/dist/index.html

‎.github/workflows/test.yml

Copy file name to clipboardExpand all lines: .github/workflows/test.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Checkout
2727
uses: actions/checkout@v4
2828
with:
29-
fetch-depth: 3
29+
fetch-depth: 3
3030

3131
# display a git log: when you run CI on PRs, github automatically
3232
# merges the PR into main and run the CI on that commit. The idea

‎.pre-commit-config.yaml

Copy file name to clipboardExpand all lines: .pre-commit-config.yaml
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This is the configuration for pre-commit, a local framework for managing pre-commit hooks
22
# Check out the docs at: https://pre-commit.com/
33
ci:
4-
skip: [eslint]
4+
#skip: [eslint]
55
autoupdate_schedule: monthly
66

77
default_stages: [commit]
@@ -24,13 +24,6 @@ repos:
2424
exclude: pyscript\.core/dist|\.min\.js$
2525
- id: trailing-whitespace
2626

27-
- repo: https://github.com/charliermarsh/ruff-pre-commit
28-
rev: v0.0.257
29-
hooks:
30-
- id: ruff
31-
exclude: pyscript\.core/src/stdlib/pyscript/__init__\.py|pyscript\.core/test|pyscript\.core/dist|pyscript\.core/src/stdlib/pyscript\.py
32-
args: [--fix]
33-
3427
- repo: https://github.com/psf/black
3528
rev: 23.1.0
3629
hooks:
@@ -51,3 +44,10 @@ repos:
5144
- id: prettier
5245
exclude: pyscript\.core/test|pyscript\.core/dist|pyscript\.core/types|pyscript.core/src/stdlib/pyscript.js|pyscript\.sw/
5346
args: [--tab-width, "4"]
47+
48+
- repo: https://github.com/pycqa/isort
49+
rev: 5.12.0
50+
hooks:
51+
- id: isort
52+
name: isort (python)
53+
args: [--profile, black]

‎public/index.html

Copy file name to clipboardExpand all lines: public/index.html
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ <h2>Example</h2>
4747
display(now.strftime(&quot;%m/%d/%Y, %H:%M:%S&quot;))
4848
&lt;/py-script&gt;
4949
&lt;/body&gt;
50-
&lt;/html&gt;</pre>
50+
&lt;/html&gt;</pre
51+
>
5152
</main>
5253
</body>
53-
</html>
54+
</html>

‎pyproject.toml

Copy file name to clipboardExpand all lines: pyproject.toml
+1-25Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,7 @@ dynamic = ["version"]
77

88
[tool.codespell]
99
ignore-words-list = "afterall"
10-
11-
[tool.ruff]
12-
builtins = [
13-
"Element",
14-
"pyscript",
15-
]
16-
ignore = [
17-
"S101",
18-
"S113",
19-
]
20-
line-length = 100
21-
select = [
22-
"B",
23-
"C9",
24-
"E",
25-
"F",
26-
"I",
27-
"S",
28-
"UP",
29-
"W",
30-
]
31-
target-version = "py310"
32-
33-
[tool.ruff.mccabe]
34-
max-complexity = 10
10+
skip = "*.js,*.json"
3511

3612
[tool.setuptools]
3713
include-package-data = false

‎pyscript.core/src/stdlib/pyscript/__init__.py

Copy file name to clipboardExpand all lines: pyscript.core/src/stdlib/pyscript/__init__.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
# pyscript.magic_js. This is the blessed way to access them from pyscript,
3030
# as it works transparently in both the main thread and worker cases.
3131

32+
from pyscript.display import HTML, display
3233
from pyscript.magic_js import (
3334
RUNNING_IN_WORKER,
3435
PyWorker,
35-
window,
36+
current_target,
3637
document,
3738
sync,
38-
current_target,
39+
window,
3940
)
40-
from pyscript.display import HTML, display
4141

4242
try:
4343
from pyscript.event_handling import when

‎pyscript.core/src/stdlib/pyscript/magic_js.py

Copy file name to clipboardExpand all lines: pyscript.core/src/stdlib/pyscript/magic_js.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from pyscript.util import NotSupported
21
import js as globalThis
2+
from pyscript.util import NotSupported
33

44
RUNNING_IN_WORKER = not hasattr(globalThis, "document")
55

‎pyscript.core/test/pydom.py

Copy file name to clipboardExpand all lines: pyscript.core/test/pydom.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import random
2+
from datetime import datetime as dt
3+
24
from pyscript import display
35
from pyweb import pydom
46
from pyweb.base import when
5-
from datetime import datetime as dt
67

78

89
@when("click", "#just-a-button")

‎pyscript.core/test/pyscript_dom/tests/test_dom.py

Copy file name to clipboardExpand all lines: pyscript.core/test/pyscript_dom/tests/test_dom.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import pytest
2-
from pyscript import document, when
31
from unittest import mock
42

3+
import pytest
4+
from pyscript import document, when
55
from pyweb import pydom
66

77

‎pyscript.core/test/terminal.py

Copy file name to clipboardExpand all lines: pyscript.core/test/terminal.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
###### magic monkey patching ######
2-
import sys
32
import builtins
4-
from pyscript import sync
3+
import sys
4+
55
from pyodide.code import eval_code
6+
from pyscript import sync
67

78
sys.stdout = sync
89
builtins.input = sync.readline

‎pyscript.core/test/worker.py

Copy file name to clipboardExpand all lines: pyscript.core/test/worker.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from pyscript import display, sync
2-
31
import a
2+
from pyscript import display, sync
43

54
display("Hello World", target="test", append=True)
65

‎pyscript.core/tests/integration/test_01_basic.py

Copy file name to clipboardExpand all lines: pyscript.core/tests/integration/test_01_basic.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44

5-
from .support import PyScriptTest, skip_worker, only_main
5+
from .support import PyScriptTest, only_main, skip_worker
66

77

88
class TestBasic(PyScriptTest):

‎pyscript.core/tests/integration/test_02_display.py

Copy file name to clipboardExpand all lines: pyscript.core/tests/integration/test_02_display.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
################################################################################
22

33
import base64
4+
import html
45
import io
56
import os
67
import re
7-
import html
88

99
import numpy as np
1010
import pytest
@@ -15,9 +15,9 @@
1515
PyScriptTest,
1616
filter_inner_text,
1717
filter_page_content,
18-
wait_for_render,
19-
skip_worker,
2018
only_main,
19+
skip_worker,
20+
wait_for_render,
2121
)
2222

2323
DISPLAY_OUTPUT_ID_PATTERN = r'script-py[id^="py-"]'

‎pyscript.core/tests/integration/test_async.py

Copy file name to clipboardExpand all lines: pyscript.core/tests/integration/test_async.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from .support import PyScriptTest, filter_inner_text, only_main
34

45

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.