Skip to content

Commit f81c168

Browse files
authored
Fix the CI (#1233)
1 parent f6f13f0 commit f81c168

File tree

8 files changed

+26
-52
lines changed

8 files changed

+26
-52
lines changed

.github/workflows/.hatch-run.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/checkout@v2
4242
- uses: actions/setup-node@v2
4343
with:
44-
node-version: "14.x"
44+
node-version: "23.x"
4545
registry-url: ${{ inputs.node-registry-url }}
4646
- name: Pin NPM Version
4747
run: npm install -g [email protected]

pyproject.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ detached = true
1212
dependencies = [
1313
"invoke",
1414
# lint
15-
"black==24.1.1", # Pin lint tools we don't control to avoid breaking changes
16-
"ruff==0.0.278", # Pin lint tools we don't control to avoid breaking changes
15+
"black==24.1.1", # Pin lint tools we don't control to avoid breaking changes
16+
"ruff==0.0.278", # Pin lint tools we don't control to avoid breaking changes
1717
"toml",
18-
"flake8==7.0.0", # Pin lint tools we don't control to avoid breaking changes
18+
"flake8==7.0.0", # Pin lint tools we don't control to avoid breaking changes
1919
"flake8-pyproject",
20-
"reactpy-flake8 >=0.7",
2120
# types
2221
"mypy",
2322
"types-toml",

src/py/reactpy/pyproject.toml

+13-43
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ readme = "README.md"
1212
requires-python = ">=3.9"
1313
license = "MIT"
1414
keywords = ["react", "javascript", "reactpy", "component"]
15-
authors = [
16-
{ name = "Ryan Morshead", email = "[email protected]" },
17-
]
15+
authors = [{ name = "Ryan Morshead", email = "[email protected]" }]
1816
classifiers = [
1917
"Development Status :: 4 - Beta",
2018
"Programming Language :: Python",
@@ -39,33 +37,18 @@ dependencies = [
3937
[project.optional-dependencies]
4038
all = ["reactpy[starlette,sanic,fastapi,flask,tornado,testing]"]
4139

42-
starlette = [
43-
"starlette >=0.13.6",
44-
"uvicorn[standard] >=0.19.0",
45-
]
40+
starlette = ["starlette >=0.13.6", "uvicorn[standard] >=0.19.0"]
4641
sanic = [
4742
"sanic >=21",
4843
"sanic-cors",
4944
"tracerite>=1.1.1",
5045
"setuptools",
5146
"uvicorn[standard] >=0.19.0",
5247
]
53-
fastapi = [
54-
"fastapi >=0.63.0",
55-
"uvicorn[standard] >=0.19.0",
56-
]
57-
flask = [
58-
"flask",
59-
"markupsafe>=1.1.1,<2.1",
60-
"flask-cors",
61-
"flask-sock",
62-
]
63-
tornado = [
64-
"tornado",
65-
]
66-
testing = [
67-
"playwright",
68-
]
48+
fastapi = ["fastapi >=0.63.0", "uvicorn[standard] >=0.19.0"]
49+
flask = ["flask", "markupsafe>=1.1.1,<2.1", "flask-cors", "flask-sock"]
50+
tornado = ["tornado"]
51+
testing = ["playwright"]
6952

7053
[project.urls]
7154
Source = "https://github.com/reactive-python/reactpy"
@@ -101,21 +84,17 @@ cov-report = [
10184
# "- coverage combine",
10285
"coverage report",
10386
]
104-
cov = [
105-
"test-cov {args}",
106-
"cov-report",
107-
]
87+
cov = ["test-cov {args}", "cov-report"]
10888

10989
[tool.hatch.envs.default.env-vars]
110-
REACTPY_DEBUG_MODE="1"
90+
REACTPY_DEBUG_MODE = "1"
11191

11292
[tool.hatch.envs.lint]
11393
features = ["all"]
11494
dependencies = [
115-
"mypy>=1.0.0",
95+
"mypy==1.8",
11696
"types-click",
11797
"types-tornado",
118-
"types-pkg-resources",
11998
"types-flask",
12099
"types-requests",
121100
]
@@ -127,13 +106,8 @@ all = ["types"]
127106
[[tool.hatch.build.hooks.build-scripts.scripts]]
128107
work_dir = "../../js"
129108
out_dir = "reactpy/_static"
130-
commands = [
131-
"npm ci",
132-
"npm run build"
133-
]
134-
artifacts = [
135-
"app/dist/"
136-
]
109+
commands = ["npm ci", "npm run build"]
110+
artifacts = ["app/dist/"]
137111

138112
# --- Pytest ---------------------------------------------------------------------------
139113

@@ -159,9 +133,7 @@ warn_unused_ignores = true
159133
source_pkgs = ["reactpy"]
160134
branch = false
161135
parallel = false
162-
omit = [
163-
"reactpy/__init__.py",
164-
]
136+
omit = ["reactpy/__init__.py"]
165137

166138
[tool.coverage.report]
167139
fail_under = 100
@@ -174,6 +146,4 @@ exclude_lines = [
174146
"if __name__ == .__main__.:",
175147
"if TYPE_CHECKING:",
176148
]
177-
omit = [
178-
"reactpy/__main__.py",
179-
]
149+
omit = ["reactpy/__main__.py"]

src/py/reactpy/reactpy/core/events.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def __init__(
109109
self.stop_propagation = stop_propagation
110110
self.target = target
111111

112-
def __eq__(self, other: Any) -> bool:
112+
def __eq__(self, other: object) -> bool:
113113
undefined = object()
114114
for attr in (
115115
"function",

src/py/reactpy/reactpy/core/layout.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async def __aenter__(self) -> Layout:
8989

9090
return self
9191

92-
async def __aexit__(self, *exc: Any) -> None:
92+
async def __aexit__(self, *exc: object) -> None:
9393
root_csid = self._root_life_cycle_state_id
9494
root_model_state = self._model_states_by_life_cycle_state_id[root_csid]
9595

src/py/reactpy/reactpy/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def set_current(self, new: _RefValue) -> _RefValue:
4343
self.current = new
4444
return old
4545

46-
def __eq__(self, other: Any) -> bool:
46+
def __eq__(self, other: object) -> bool:
4747
try:
4848
return isinstance(other, Ref) and (other.current == self.current)
4949
except AttributeError:

src/py/reactpy/tests/test_backend/test_all.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from collections.abc import MutableMapping
23

34
import pytest
@@ -106,6 +107,10 @@ def ShowScope():
106107
assert isinstance(scope.current, MutableMapping)
107108

108109

110+
@pytest.mark.skipIf(
111+
sys.platform == "darwin",
112+
reason="Tornado and Flask backends are currently buggy on MacOS.",
113+
)
109114
async def test_use_location(display: DisplayFixture):
110115
location = reactpy.Ref()
111116

src/py/reactpy/tests/test_core/test_events.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def inner_click_no_op(event):
193193
clicked.current = True
194194

195195
def outer_click_is_not_triggered(event):
196-
raise AssertionError()
196+
raise AssertionError
197197

198198
outer = reactpy.html.div(
199199
{

0 commit comments

Comments
 (0)