-
-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into event-target-checked-does-not-exist-for-chec…
…kbox-inputs
- Loading branch information
Showing
20 changed files
with
132 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,15 +38,15 @@ jobs: | |
runs-on: ${{ fromJson(inputs.runs-on-array) }} | ||
runs-on: ${{ matrix.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
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] | ||
- name: Use Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Python Dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
|
@@ -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" | ||
|
@@ -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", | ||
] | ||
|
@@ -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 --------------------------------------------------------------------------- | ||
|
||
|
@@ -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 | ||
|
@@ -174,6 +146,4 @@ exclude_lines = [ | |
"if __name__ == .__main__.:", | ||
"if TYPE_CHECKING:", | ||
] | ||
omit = [ | ||
"reactpy/__main__.py", | ||
] | ||
omit = ["reactpy/__main__.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,45 @@ | ||
from __future__ import annotations | ||
from __future__ import annotations # nocov | ||
|
||
from collections.abc import MutableMapping | ||
from typing import Any | ||
from collections.abc import MutableMapping # nocov | ||
from typing import Any # nocov | ||
|
||
from reactpy.backend.types import Connection, Location | ||
from reactpy.core.hooks import create_context, use_context | ||
from reactpy.core.types import Context | ||
from reactpy._warnings import warn # nocov | ||
from reactpy.backend.types import Connection, Location # nocov | ||
from reactpy.core.hooks import ConnectionContext, use_context # nocov | ||
|
||
# backend implementations should establish this context at the root of an app | ||
ConnectionContext: Context[Connection[Any] | None] = create_context(None) | ||
|
||
|
||
def use_connection() -> Connection[Any]: | ||
def use_connection() -> Connection[Any]: # nocov | ||
"""Get the current :class:`~reactpy.backend.types.Connection`.""" | ||
warn( | ||
"The module reactpy.backend.hooks has been deprecated and will be deleted in the future. ", | ||
"Call reactpy.use_connection instead.", | ||
DeprecationWarning, | ||
) | ||
|
||
conn = use_context(ConnectionContext) | ||
if conn is None: # nocov | ||
if conn is None: | ||
msg = "No backend established a connection." | ||
raise RuntimeError(msg) | ||
return conn | ||
|
||
|
||
def use_scope() -> MutableMapping[str, Any]: | ||
def use_scope() -> MutableMapping[str, Any]: # nocov | ||
"""Get the current :class:`~reactpy.backend.types.Connection`'s scope.""" | ||
warn( | ||
"The module reactpy.backend.hooks has been deprecated and will be deleted in the future. ", | ||
"Call reactpy.use_scope instead.", | ||
DeprecationWarning, | ||
) | ||
|
||
return use_connection().scope | ||
|
||
|
||
def use_location() -> Location: | ||
def use_location() -> Location: # nocov | ||
"""Get the current :class:`~reactpy.backend.types.Connection`'s location.""" | ||
warn( | ||
"The module reactpy.backend.hooks has been deprecated and will be deleted in the future. ", | ||
"Call reactpy.use_location instead.", | ||
DeprecationWarning, | ||
) | ||
|
||
return use_connection().location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.