Skip to content

Commit

Permalink
rename to reactpy-router (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorshea authored May 11, 2023
1 parent 8077994 commit a6f7d23
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# --- JAVASCRIPT BUNDLES ---

idom_router/bundle.js
reactpy_router/bundle.js

# --- PYTHON IGNORE FILES ----

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include README.md
include idom_router/bundle.js
include reactpy_router/bundle.js
include LICENSE
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```

Expand Down Expand Up @@ -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`
Expand Down
8 changes: 4 additions & 4 deletions js/README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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.
4 changes: 2 additions & 2 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions js/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion js/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions idom_router/core.py → reactpy_router/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
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,
use_location,
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)

Expand Down Expand Up @@ -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",
)

Expand Down
4 changes: 2 additions & 2 deletions idom_router/simple.py → reactpy_router/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
4 changes: 2 additions & 2 deletions idom_router/types.py → reactpy_router/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion requirements/check-style.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
black
flake8
flake8-print
flake8_idom_hooks
reactpy-flake8
isort
2 changes: 1 addition & 1 deletion requirements/check-types.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mypy
idom
reactpy
2 changes: 1 addition & 1 deletion requirements/pkg-deps.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
idom >=1
reactpy >=1
typing_extensions
2 changes: 1 addition & 1 deletion requirements/test-env.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ twine
pytest
pytest-asyncio
pytest-cov
idom[testing,starlette]
reactpy[testing,starlette]
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))
Expand All @@ -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": "[email protected]",
"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": [
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_core.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from idom_router.simple import parse_path
from reactpy_router.simple import parse_path


def test_parse_path():
Expand Down

0 comments on commit a6f7d23

Please sign in to comment.