Skip to content

Commit a9a2558

Browse files
committed
fix lint
1 parent 66be995 commit a9a2558

File tree

7 files changed

+27
-13
lines changed

7 files changed

+27
-13
lines changed

notebooks/introduction.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@
271271
" return lambda: slider.unobserve(handle_change, \"value\")\n",
272272
"\n",
273273
" return html.div(\n",
274-
" slider_component,\n",
275-
" html.p(f\"ReactPy observes the value to be: \", value)\n",
274+
" slider_component, html.p(f\"ReactPy observes the value to be: \", value)\n",
276275
" )"
277276
]
278277
},

noxfile.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
group = NoxOpt(auto_tag=True)
44

55

6+
@group.session
7+
def fix_lint(session: Session) -> None:
8+
session.install(
9+
"black[jupyter]",
10+
"flake8-pyproject",
11+
"flake8",
12+
"isort",
13+
)
14+
session.run("black", ".")
15+
session.run("isort", ".")
16+
17+
session.run("npm", "run", "fix:lint", external=True)
18+
19+
620
@group.session
721
def check_python(session: Session) -> None:
822
session.install(

reactpy_jupyter/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
# Distributed under the terms of the Modified BSD License.
66

77
from . import jupyter_server_extension
8+
from .import_resources import setup_import_resources
9+
from .layout_widget import run, set_import_source_base_url, to_widget
810
from .monkey_patch import execute_patch
911
from .widget_component import from_widget
10-
from .import_resources import setup_import_resources
11-
from .layout_widget import to_widget, run, set_import_source_base_url
1212

1313
__version__ = "0.8.1" # DO NOT MODIFY
1414

reactpy_jupyter/layout_widget.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
import anywidget
1111
from IPython.display import DisplayHandle
1212
from IPython.display import display as ipython_display
13+
from ipywidgets import Widget, widget_serialization
1314
from jsonpointer import set_pointer
1415
from reactpy.core.layout import Layout
1516
from reactpy.core.types import ComponentType
16-
from ipywidgets import Widget, widget_serialization
17-
from traitlets import Unicode, List, Instance
17+
from traitlets import Instance, List, Unicode
1818
from typing_extensions import ParamSpec
1919

2020
from reactpy_jupyter.widget_component import InnerWidgets, inner_widgets_context

reactpy_jupyter/monkey_patch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from typing import Any
22
from weakref import finalize
3-
from reactpy_jupyter.layout_widget import to_widget
3+
44
from reactpy.core.component import Component
55

6+
from reactpy_jupyter.layout_widget import to_widget
7+
68
# we can't track the widgets by adding them as a hidden attribute to the component
79
# because Component has __slots__ defined
810
LIVE_WIDGETS: dict[int, Any] = {}

reactpy_jupyter/widget_component.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
from __future__ import annotations
22

33
from typing import Callable
4+
45
from attr import dataclass
56
from ipywidgets import Widget
6-
7-
from reactpy import component, create_context, use_context, use_effect, html
8-
from reactpy.types import VdomDict, Context
9-
7+
from reactpy import component, create_context, html, use_context, use_effect
8+
from reactpy.types import Context, VdomDict
109

1110
inner_widgets_context: Context[InnerWidgets | None] = create_context(None)
1211

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from __future__ import print_function
2-
from functools import partial
32

43
import pipes
54
import shutil
65
import subprocess
76
import sys
87
import traceback
8+
from distutils.cmd import Command
9+
from functools import partial
910
from logging import StreamHandler, getLogger
1011
from pathlib import Path
1112
from typing import Callable
@@ -14,7 +15,6 @@
1415
from setuptools import find_packages, setup
1516
from setuptools.command.develop import develop
1617
from setuptools.command.sdist import sdist
17-
from distutils.cmd import Command
1818

1919
if sys.platform == "win32":
2020
from subprocess import list2cmdline

0 commit comments

Comments
 (0)