Skip to content
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

Implements Tethys Reactpy App Scaffold #1081

Merged
merged 45 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
67b2098
Reactpy configured at the baseline-level
shawncrawley May 13, 2024
b16676e
Merge branch 'main' into tethys-reactpy
ckrew May 14, 2024
a585699
Added RESelectInput react component to create a reach dropdown just l…
ckrew May 16, 2024
debe2a4
Integrates reactpy and implements app scaffold
shawncrawley Aug 17, 2024
0c9ecc4
Merge branch 'main' into tethys-reactpy
shawncrawley Aug 17, 2024
f6cc1a9
Handle reactpy-django at app install level
shawncrawley Aug 19, 2024
9324df4
Bugfixes from fresh test
shawncrawley Aug 19, 2024
521eef0
Initial wave of tests and resulting refactors/fixes
shawncrawley Aug 23, 2024
55e31f9
Adds tests and test-based fixes
shawncrawley Aug 29, 2024
645e4de
Merge branch 'main' into tethys-reactpy
shawncrawley Aug 29, 2024
80eea3d
Fix broken tests on Windows, flake8 cleanup
shawncrawley Aug 29, 2024
408b7ab
Applies black formatting
shawncrawley Aug 29, 2024
fdfb0a5
Try fixing async test
shawncrawley Aug 29, 2024
dc93f59
Fix flake8 warning
shawncrawley Aug 29, 2024
5628657
Tweak test for macos
shawncrawley Aug 29, 2024
33e0632
Another tweak for tests on macos
shawncrawley Aug 29, 2024
4640634
Fix broken test from last commit
shawncrawley Aug 29, 2024
af5cb81
black reformatting
shawncrawley Aug 29, 2024
3e59a05
Unpin daphne version
shawncrawley Sep 5, 2024
3c67bcc
Merge branch 'main' into tethys-reactpy
shawncrawley Sep 6, 2024
8d48e47
Bugfix: Default arg must be passed to scaffold_command
shawncrawley Sep 11, 2024
79e44ad
applies suggested changes
shawncrawley Oct 3, 2024
64732c5
Merge branch 'main' into tethys-reactpy
shawncrawley Oct 3, 2024
b5493d2
Revert spot where os.path had been converted to pathlib.Path
shawncrawley Oct 3, 2024
4c9697b
Remove erroneous argument
shawncrawley Oct 3, 2024
ae1d688
Fix bug with pathlib update to static_finders
shawncrawley Oct 7, 2024
46b4f83
Update tests/unit_tests/test_tethys_apps/test_template_loaders.py
shawncrawley Oct 11, 2024
1bdcdcf
Update tethys_cli/cli_helpers.py
shawncrawley Oct 11, 2024
f7af003
Merge branch 'main' into tethys-reactpy
shawncrawley Oct 11, 2024
b6178b8
Merge branch 'main' into tethys-reactpy
swainn Oct 16, 2024
9122f42
Additional tweaks per feedback
shawncrawley Oct 17, 2024
305a910
black and flake8
shawncrawley Oct 17, 2024
0718fd5
remove file that was unintentionally committed
shawncrawley Oct 17, 2024
d898438
Fixes pyproject.toml_tmpl for reacpty scaffold
shawncrawley Oct 19, 2024
f0e00e9
Update tethys_apps/base/url_map.py
shawncrawley Oct 22, 2024
01bdf94
Implements latest feedback from @swainn
shawncrawley Oct 22, 2024
8a810af
Additional tweaks per feedback/tests
shawncrawley Oct 23, 2024
8ab53d4
Fix broken test
shawncrawley Oct 23, 2024
f4bc8b6
Removes reactpy[-django] from dependencies
shawncrawley Nov 25, 2024
f5af044
Replace Path.walk with os.walk
shawncrawley Nov 25, 2024
183cd7f
Merge branch 'main' into tethys-reactpy
shawncrawley Nov 25, 2024
58bd925
Replaces odd Namespace usage with UrlMap
shawncrawley Nov 25, 2024
3ba6119
Merge branch 'tethys-reactpy' of https://github.com/tethysplatform/te…
shawncrawley Nov 25, 2024
7b8a45c
Applies black formatting
shawncrawley Nov 25, 2024
b3bb243
Separates channels and daphne
shawncrawley Nov 25, 2024
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
Prev Previous commit
Next Next commit
Handle reactpy-django at app install level
  • Loading branch information
shawncrawley committed Aug 19, 2024
commit f6cc1a9cfca9314eebae5315023ba11ac04ee704
8 changes: 8 additions & 0 deletions tethys_cli/install_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,14 @@ def install_command(args):
if validate_schema("pip", requirements_config):
write_msg("Running pip installation tasks...")
call(["pip", "install", *requirements_config["pip"]])
if 'reactpy-django' in requirements_config["pip"]:
from .settings_commands import read_settings, write_settings
tethys_settings = read_settings()
if 'INSTALLED_APPS' not in tethys_settings:
tethys_settings['INSTALLED_APPS'] = []
if 'reactpy_django' not in tethys_settings['INSTALLED_APPS']:
tethys_settings['INSTALLED_APPS'].append('reactpy_django')
write_settings(tethys_settings)
try:
public_resources_dir = [
*Path().glob(str(Path("tethysapp", "*", "public"))),
Expand Down
20 changes: 0 additions & 20 deletions tethys_cli/scaffold_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,26 +443,6 @@ def scaffold_command(args):

write_pretty_output('Created: "{}"'.format(project_file_path), FG_WHITE)

if template_name == 'reactpy':
from .settings_commands import read_settings, write_settings
from argparse import Namespace
tethys_settings = read_settings()
if 'INSTALLED_APPS' not in tethys_settings:
tethys_settings['INSTALLED_APPS'] = []
if 'reactpy_django' not in tethys_settings['INSTALLED_APPS']:
tethys_settings['INSTALLED_APPS'].append('reactpy_django')
write_settings(tethys_settings)

if template_name == 'reactpy':
from .settings_commands import read_settings, write_settings
from argparse import Namespace
tethys_settings = read_settings()
if 'INSTALLED_APPS' not in tethys_settings:
tethys_settings['INSTALLED_APPS'] = []
if 'reactpy_django' not in tethys_settings['INSTALLED_APPS']:
tethys_settings['INSTALLED_APPS'].append('reactpy_django')
write_settings(tethys_settings)

write_pretty_output(
'Successfully scaffolded new project "{}"'.format(project_name), FG_WHITE
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ requirements:
packages:

pip:
- reactpy-django
shawncrawley marked this conversation as resolved.
Show resolved Hide resolved

post:
12 changes: 0 additions & 12 deletions tethys_gizmos/react_components/__init__.py

This file was deleted.

125 changes: 0 additions & 125 deletions tethys_gizmos/react_components/select_input.py

This file was deleted.

4 changes: 2 additions & 2 deletions tethys_portal/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def build_application(asgi_app):
if has_module("reactpy_django"):
from reactpy_django import REACTPY_WEBSOCKET_ROUTE
from reactpy_django.utils import register_component

register_component('tethys_apps.base.controller.page_component_wrapper')

app_websocket_urls.append(REACTPY_WEBSOCKET_ROUTE)
app_websocket_urls.append(REACTPY_WEBSOCKET_ROUTE)

application = ProtocolTypeRouter(
{
Expand Down
1 change: 0 additions & 1 deletion tethys_sdk/gizmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
# flake8: noqa
# DO NOT ERASE
from tethys_gizmos.gizmo_options import *
from tethys_gizmos.react_components import *
from tethys_gizmos.gizmo_options.base import TethysGizmoOptions, SecondaryGizmoOptions
Loading