Skip to content

Fix the CI #1233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/.hatch-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14.x"
node-version: "23.x"
registry-url: ${{ inputs.node-registry-url }}
- name: Pin NPM Version
run: npm install -g [email protected]
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ detached = true
dependencies = [
"invoke",
# lint
"black==24.1.1", # Pin lint tools we don't control to avoid breaking changes
"ruff==0.0.278", # Pin lint tools we don't control to avoid breaking changes
"black==24.1.1", # Pin lint tools we don't control to avoid breaking changes
"ruff==0.0.278", # Pin lint tools we don't control to avoid breaking changes
"toml",
"flake8==7.0.0", # Pin lint tools we don't control to avoid breaking changes
"flake8==7.0.0", # Pin lint tools we don't control to avoid breaking changes
"flake8-pyproject",
"reactpy-flake8 >=0.7",
# types
"mypy",
"types-toml",
Expand Down
56 changes: 13 additions & 43 deletions src/py/reactpy/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ readme = "README.md"
requires-python = ">=3.9"
license = "MIT"
keywords = ["react", "javascript", "reactpy", "component"]
authors = [
{ name = "Ryan Morshead", email = "[email protected]" },
]
authors = [{ name = "Ryan Morshead", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
Expand All @@ -39,33 +37,18 @@ dependencies = [
[project.optional-dependencies]
all = ["reactpy[starlette,sanic,fastapi,flask,tornado,testing]"]

starlette = [
"starlette >=0.13.6",
"uvicorn[standard] >=0.19.0",
]
starlette = ["starlette >=0.13.6", "uvicorn[standard] >=0.19.0"]
sanic = [
"sanic >=21",
"sanic-cors",
"tracerite>=1.1.1",
"setuptools",
"uvicorn[standard] >=0.19.0",
]
fastapi = [
"fastapi >=0.63.0",
"uvicorn[standard] >=0.19.0",
]
flask = [
"flask",
"markupsafe>=1.1.1,<2.1",
"flask-cors",
"flask-sock",
]
tornado = [
"tornado",
]
testing = [
"playwright",
]
fastapi = ["fastapi >=0.63.0", "uvicorn[standard] >=0.19.0"]
flask = ["flask", "markupsafe>=1.1.1,<2.1", "flask-cors", "flask-sock"]
tornado = ["tornado"]
testing = ["playwright"]

[project.urls]
Source = "https://github.com/reactive-python/reactpy"
Expand Down Expand Up @@ -101,21 +84,17 @@ cov-report = [
# "- coverage combine",
"coverage report",
]
cov = [
"test-cov {args}",
"cov-report",
]
cov = ["test-cov {args}", "cov-report"]

[tool.hatch.envs.default.env-vars]
REACTPY_DEBUG_MODE="1"
REACTPY_DEBUG_MODE = "1"

[tool.hatch.envs.lint]
features = ["all"]
dependencies = [
"mypy>=1.0.0",
"mypy==1.8",
"types-click",
"types-tornado",
"types-pkg-resources",
"types-flask",
"types-requests",
]
Expand All @@ -127,13 +106,8 @@ all = ["types"]
[[tool.hatch.build.hooks.build-scripts.scripts]]
work_dir = "../../js"
out_dir = "reactpy/_static"
commands = [
"npm ci",
"npm run build"
]
artifacts = [
"app/dist/"
]
commands = ["npm ci", "npm run build"]
artifacts = ["app/dist/"]

# --- Pytest ---------------------------------------------------------------------------

Expand All @@ -159,9 +133,7 @@ warn_unused_ignores = true
source_pkgs = ["reactpy"]
branch = false
parallel = false
omit = [
"reactpy/__init__.py",
]
omit = ["reactpy/__init__.py"]

[tool.coverage.report]
fail_under = 100
Expand All @@ -174,6 +146,4 @@ exclude_lines = [
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
omit = [
"reactpy/__main__.py",
]
omit = ["reactpy/__main__.py"]
2 changes: 1 addition & 1 deletion src/py/reactpy/reactpy/core/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __init__(
self.stop_propagation = stop_propagation
self.target = target

def __eq__(self, other: Any) -> bool:
def __eq__(self, other: object) -> bool:
undefined = object()
for attr in (
"function",
Expand Down
2 changes: 1 addition & 1 deletion src/py/reactpy/reactpy/core/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async def __aenter__(self) -> Layout:

return self

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

Expand Down
2 changes: 1 addition & 1 deletion src/py/reactpy/reactpy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def set_current(self, new: _RefValue) -> _RefValue:
self.current = new
return old

def __eq__(self, other: Any) -> bool:
def __eq__(self, other: object) -> bool:
try:
return isinstance(other, Ref) and (other.current == self.current)
except AttributeError:
Expand Down
5 changes: 5 additions & 0 deletions src/py/reactpy/tests/test_backend/test_all.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from collections.abc import MutableMapping

import pytest
Expand Down Expand Up @@ -106,6 +107,10 @@ def ShowScope():
assert isinstance(scope.current, MutableMapping)


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

Expand Down
2 changes: 1 addition & 1 deletion src/py/reactpy/tests/test_core/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def inner_click_no_op(event):
clicked.current = True

def outer_click_is_not_triggered(event):
raise AssertionError()
raise AssertionError

outer = reactpy.html.div(
{
Expand Down
Loading