reactpy 2.0.0b6__py3-none-any.whl → 2.0.0b7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- reactpy/__init__.py +2 -2
- reactpy/config.py +1 -1
- reactpy/core/_thread_local.py +1 -1
- reactpy/core/hooks.py +11 -19
- reactpy/executors/asgi/pyscript.py +4 -1
- reactpy/executors/asgi/standalone.py +1 -1
- reactpy/{pyscript → executors/pyscript}/component_template.py +1 -1
- reactpy/{pyscript → executors/pyscript}/components.py +1 -1
- reactpy/executors/utils.py +32 -7
- reactpy/reactjs/__init__.py +2 -4
- reactpy/reactjs/module.py +106 -42
- reactpy/reactjs/utils.py +49 -20
- reactpy/static/{index-sbddj6ms.js → index-64wy0fss.js} +4 -4
- reactpy/static/{index-sbddj6ms.js.map → index-64wy0fss.js.map} +1 -1
- reactpy/static/index-beq660xy.js +5 -0
- reactpy/static/index-beq660xy.js.map +12 -0
- reactpy/static/index.js +2 -2
- reactpy/static/index.js.map +6 -5
- reactpy/static/preact-dom.js +4 -0
- reactpy/static/{react-dom.js.map → preact-dom.js.map} +3 -3
- reactpy/static/preact-jsx-runtime.js +4 -0
- reactpy/static/{react-jsx-runtime.js.map → preact-jsx-runtime.js.map} +1 -1
- reactpy/static/preact.js +4 -0
- reactpy/static/{react.js.map → preact.js.map} +3 -3
- reactpy/templatetags/jinja.py +4 -1
- reactpy/testing/__init__.py +2 -7
- reactpy/testing/backend.py +20 -8
- reactpy/testing/common.py +1 -9
- reactpy/testing/display.py +68 -32
- {reactpy-2.0.0b6.dist-info → reactpy-2.0.0b7.dist-info}/METADATA +1 -1
- {reactpy-2.0.0b6.dist-info → reactpy-2.0.0b7.dist-info}/RECORD +37 -40
- reactpy/static/index-h31022cd.js +0 -5
- reactpy/static/index-h31022cd.js.map +0 -11
- reactpy/static/index-y71bxs88.js +0 -5
- reactpy/static/index-y71bxs88.js.map +0 -10
- reactpy/static/react-dom.js +0 -4
- reactpy/static/react-jsx-runtime.js +0 -4
- reactpy/static/react.js +0 -4
- reactpy/testing/utils.py +0 -27
- /reactpy/{pyscript → executors/pyscript}/__init__.py +0 -0
- /reactpy/{pyscript → executors/pyscript}/layout_handler.py +0 -0
- /reactpy/{pyscript → executors/pyscript}/utils.py +0 -0
- {reactpy-2.0.0b6.dist-info → reactpy-2.0.0b7.dist-info}/WHEEL +0 -0
- {reactpy-2.0.0b6.dist-info → reactpy-2.0.0b7.dist-info}/entry_points.txt +0 -0
- {reactpy-2.0.0b6.dist-info → reactpy-2.0.0b7.dist-info}/licenses/LICENSE +0 -0
reactpy/testing/utils.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import socket
|
|
4
|
-
import sys
|
|
5
|
-
from contextlib import closing
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def find_available_port(
|
|
9
|
-
host: str, port_min: int = 8000, port_max: int = 9000
|
|
10
|
-
) -> int: # nocov
|
|
11
|
-
"""Get a port that's available for the given host and port range"""
|
|
12
|
-
for port in range(port_min, port_max):
|
|
13
|
-
with closing(socket.socket()) as sock:
|
|
14
|
-
try:
|
|
15
|
-
if sys.platform in ("linux", "darwin"):
|
|
16
|
-
# Fixes bug on Unix-like systems where every time you restart the
|
|
17
|
-
# server you'll get a different port on Linux. This cannot be set
|
|
18
|
-
# on Windows otherwise address will always be reused.
|
|
19
|
-
# Ref: https://stackoverflow.com/a/19247688/3159288
|
|
20
|
-
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
21
|
-
sock.bind((host, port))
|
|
22
|
-
except OSError:
|
|
23
|
-
pass
|
|
24
|
-
else:
|
|
25
|
-
return port
|
|
26
|
-
msg = f"Host {host!r} has no available port in range {port_max}-{port_max}"
|
|
27
|
-
raise RuntimeError(msg)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|