diff --git a/.gitignore b/.gitignore index 05a78fb..b66252c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # --- JAVASCRIPT BUNDLES --- -idom_router/bundle.js +reactpy_router/bundle.js # --- PYTHON IGNORE FILES ---- diff --git a/MANIFEST.in b/MANIFEST.in index 0626969..a58fbdc 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include README.md -include idom_router/bundle.js +include reactpy_router/bundle.js include LICENSE diff --git a/README.md b/README.md index ca808e9..b182609 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# idom-router +# reactpy-router -A URL router for IDOM +A URL router for ReactPy # Installation Use `pip` to install this package: ```bash -pip install idom-router +pip install reactpy-router ``` For a developer installation from source be sure to install [NPM](https://www.npmjs.com/) before running: ```bash -git clone https://github.com/idom-team/idom-router -cd idom-router +git clone https://github.com/reactive-python/reactpy-router +cd reactpy-router pip install -e . -r requirements.txt ``` @@ -45,16 +45,16 @@ like GitHub Actions. # Releasing This Package -To release a new version of idom-router on PyPI: +To release a new version of reactpy-router on PyPI: 1. Install [`twine`](https://twine.readthedocs.io/en/latest/) with `pip install twine` -2. Update the `version = "x.y.z"` variable in `idom-router/__init__.py` +2. Update the `version = "x.y.z"` variable in `reactpy-router/__init__.py` 3. `git` add the changes to `__init__.py` and create a `git tag -a x.y.z -m 'comment'` 4. Build the Python package with `python setup.py sdist bdist_wheel` 5. Check the build artifacts `twine check --strict dist/*` 6. Upload the build artifacts to [PyPI](https://pypi.org/) `twine upload dist/*` -To release a new version of `idom-router` on [NPM](https://www.npmjs.com/): +To release a new version of `reactpy-router` on [NPM](https://www.npmjs.com/): 1. Update `js/package.json` with new npm package version 2. Clean out prior builds `git clean -fdx` diff --git a/js/README.md b/js/README.md index 1b49e3a..1d6fc22 100644 --- a/js/README.md +++ b/js/README.md @@ -1,13 +1,13 @@ -# idom-router +# reactpy-router -A URL router for IDOM +A URL router for ReactPy # Package Installation Requires [Node](https://nodejs.org/en/) to be installed: ```bash -npm install --save idom-router +npm install --save reactpy-router ``` For a developer installation, `cd` into this directory and run: @@ -18,5 +18,5 @@ npm run build ``` This will install required dependencies and generate a Javascript bundle that is saved -to `idom-router/bundle.js`` and is distributed with the +to `reactpy-router/bundle.js`` and is distributed with the associated Python package. diff --git a/js/package-lock.json b/js/package-lock.json index a7c4bdb..35cf7a0 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -1,10 +1,10 @@ { - "name": "idom-router", + "name": "reactpy-router", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "idom-router", + "name": "reactpy-router", "dependencies": { "history": "^5.3.0", "htm": "^3.0.4", diff --git a/js/package.json b/js/package.json index 6c2bb5b..6622f7b 100644 --- a/js/package.json +++ b/js/package.json @@ -1,10 +1,10 @@ { - "name": "idom-router", - "description": "A URL router for IDOM", + "name": "reactpy-router", + "description": "A URL router for ReactPy", "author": "Ryan Morshead", "repository": { "type": "git", - "url": "https://github.com/idom-team/idom-router" + "url": "https://github.com/reactive-python/reactpy-router" }, "main": "src/index.js", "files": [ diff --git a/js/rollup.config.js b/js/rollup.config.js index 1f48437..ab1d0b1 100644 --- a/js/rollup.config.js +++ b/js/rollup.config.js @@ -5,7 +5,7 @@ import replace from "rollup-plugin-replace"; export default { input: "src/index.js", output: { - file: "../idom_router/bundle.js", + file: "../reactpy_router/bundle.js", format: "esm", }, plugins: [ diff --git a/noxfile.py b/noxfile.py index 4cf7137..ee5f848 100644 --- a/noxfile.py +++ b/noxfile.py @@ -31,7 +31,7 @@ def test_style(session: Session) -> None: @session def test_types(session: Session) -> None: install_requirements(session, "check-types") - session.run("mypy", "--strict", "idom_router") + session.run("mypy", "--strict", "reactpy_router") @session @@ -46,7 +46,7 @@ def test_suite(session: Session) -> None: session.log("Coverage won't be checked") session.install(".") else: - posargs += ["--cov=idom_router", "--cov-report=term"] + posargs += ["--cov=reactpy_router", "--cov-report=term"] session.install("-e", ".") session.run("pytest", "tests", *posargs) diff --git a/idom_router/__init__.py b/reactpy_router/__init__.py similarity index 100% rename from idom_router/__init__.py rename to reactpy_router/__init__.py diff --git a/idom_router/core.py b/reactpy_router/core.py similarity index 87% rename from idom_router/core.py rename to reactpy_router/core.py index 408c922..df0105e 100644 --- a/idom_router/core.py +++ b/reactpy_router/core.py @@ -5,7 +5,7 @@ from typing import Any, Callable, Iterator, Sequence, TypeVar from urllib.parse import parse_qs -from idom import ( +from reactpy import ( component, create_context, use_context, @@ -13,13 +13,13 @@ use_memo, use_state, ) -from idom.backend.hooks import ConnectionContext, use_connection -from idom.backend.types import Connection, Location -from idom.core.types import VdomChild, VdomDict -from idom.types import ComponentType, Context, Location -from idom.web.module import export, module_from_file +from reactpy.backend.hooks import ConnectionContext, use_connection +from reactpy.backend.types import Connection, Location +from reactpy.core.types import VdomChild, VdomDict +from reactpy.types import ComponentType, Context, Location +from reactpy.web.module import export, module_from_file -from idom_router.types import Route, RouteCompiler, Router, RouteResolver +from reactpy_router.types import Route, RouteCompiler, Router, RouteResolver R = TypeVar("R", bound=Route) @@ -114,7 +114,7 @@ def _match_route( _link = export( - module_from_file("idom-router", file=Path(__file__).parent / "bundle.js"), + module_from_file("reactpy-router", file=Path(__file__).parent / "bundle.js"), "Link", ) diff --git a/idom_router/simple.py b/reactpy_router/simple.py similarity index 96% rename from idom_router/simple.py rename to reactpy_router/simple.py index 7c6901e..3c6ea9b 100644 --- a/idom_router/simple.py +++ b/reactpy_router/simple.py @@ -6,8 +6,8 @@ from typing_extensions import TypeAlias, TypedDict -from idom_router.core import create_router -from idom_router.types import Route +from reactpy_router.core import create_router +from reactpy_router.types import Route __all__ = ["router"] diff --git a/idom_router/types.py b/reactpy_router/types.py similarity index 93% rename from idom_router/types.py rename to reactpy_router/types.py index 092b734..2a600ba 100644 --- a/idom_router/types.py +++ b/reactpy_router/types.py @@ -3,8 +3,8 @@ from dataclasses import dataclass, field from typing import Any, Sequence, TypeVar -from idom.core.vdom import is_vdom -from idom.types import ComponentType, Key +from reactpy.core.vdom import is_vdom +from reactpy.types import ComponentType, Key from typing_extensions import Protocol, Self diff --git a/requirements/check-style.txt b/requirements/check-style.txt index e8e2fb4..9a48a39 100644 --- a/requirements/check-style.txt +++ b/requirements/check-style.txt @@ -1,5 +1,5 @@ black flake8 flake8-print -flake8_idom_hooks +reactpy-flake8 isort diff --git a/requirements/check-types.txt b/requirements/check-types.txt index d8455d6..d4d2f1b 100644 --- a/requirements/check-types.txt +++ b/requirements/check-types.txt @@ -1,2 +1,2 @@ mypy -idom +reactpy diff --git a/requirements/pkg-deps.txt b/requirements/pkg-deps.txt index 002aef5..9f673a3 100644 --- a/requirements/pkg-deps.txt +++ b/requirements/pkg-deps.txt @@ -1,2 +1,2 @@ -idom >=1 +reactpy >=1 typing_extensions diff --git a/requirements/test-env.txt b/requirements/test-env.txt index c440c3b..b6cdf49 100644 --- a/requirements/test-env.txt +++ b/requirements/test-env.txt @@ -2,4 +2,4 @@ twine pytest pytest-asyncio pytest-cov -idom[testing,starlette] +reactpy[testing,starlette] diff --git a/setup.py b/setup.py index cde7673..26b59a3 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools.command.sdist import sdist # the name of the project -name = "idom_router" +name = "reactpy_router" # basic paths used to gather files here = os.path.abspath(os.path.dirname(__file__)) @@ -26,12 +26,12 @@ "name": name, "python_requires": ">=3.7", "packages": find_packages(exclude=["tests*"]), - "description": "A URL router for IDOM", + "description": "A URL router for ReactPy", "author": "Ryan Morshead", "author_email": "ryan.morshead@gmail.com", - "url": "https://github.com/idom-team/idom-router", + "url": "https://github.com/reactive-python/reactpy-router", "platforms": "Linux, Mac OS X, Windows", - "keywords": ["idom", "components"], + "keywords": ["reactpy", "components"], "include_package_data": True, "zip_safe": False, "classifiers": [ diff --git a/tests/conftest.py b/tests/conftest.py index d632b8f..573eba5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ import pytest -from idom.testing import BackendFixture, DisplayFixture from playwright.async_api import async_playwright +from reactpy.testing import BackendFixture, DisplayFixture def pytest_addoption(parser) -> None: diff --git a/tests/test_core.py b/tests/test_core.py index f8c390c..736221d 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1,7 +1,7 @@ -from idom import Ref, component, html, use_location -from idom.testing import DisplayFixture +from reactpy import Ref, component, html, use_location +from reactpy.testing import DisplayFixture -from idom_router import link, route, simple, use_params, use_query +from reactpy_router import link, route, simple, use_params, use_query async def test_simple_router(display: DisplayFixture): diff --git a/tests/test_simple.py b/tests/test_simple.py index 2047eae..e7de017 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -3,7 +3,7 @@ import pytest -from idom_router.simple import parse_path +from reactpy_router.simple import parse_path def test_parse_path():