Skip to content

Commit 1addf16

Browse files
authored
rename to reactpy (#12)
* rename to reactpy * test suite fixes
1 parent 974923c commit 1addf16

File tree

14 files changed

+50
-113
lines changed

14 files changed

+50
-113
lines changed

.github/workflows/test.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,19 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: ["3.7", "3.8", "3.9", "3.10"]
16+
python-version: ["3.9", "3.10", "3.11"]
1717
steps:
1818
- uses: actions/checkout@v2
19-
- uses: nanasess/setup-chromedriver@master
2019
- uses: actions/setup-node@v2-beta
2120
with:
22-
node-version: "12"
23-
- name: Install latest NPM
24-
run: |
25-
npm install -g npm@latest
26-
npm --version
21+
node-version: "14"
22+
- name: install NPM version
23+
run: npm install -g [email protected]
2724
- name: Use Python ${{ matrix.python-version }}
2825
uses: actions/setup-python@v2
2926
with:
3027
python-version: ${{ matrix.python-version }}
3128
- name: Create Repo From Template
3229
run: |
3330
pip install nox
34-
nox -s test
31+
nox -t test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ __pycache__
77

88
# --- content generated by tests ---
99
test-repo
10-
idom
10+
reactpy

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 idom-team
3+
Copyright (c) 2020 reactive-python
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# IDOM Package Cookiecutter
1+
# ReactPy Package Cookiecutter
22

3-
![Test](https://github.com/idom-team/idom-package-cookiecutter/workflows/Test/badge.svg?branch=main)
3+
![Test](https://github.com/reactive-python/reactpy-package-cookiecutter/workflows/Test/badge.svg?branch=main)
44

5-
A [`cookiecutter`](https://cookiecutter.readthedocs.io/en/1.7.2/README.html) template for packaging Javascript components with IDOM
5+
A [`cookiecutter`](https://cookiecutter.readthedocs.io/en/1.7.2/README.html) template for packaging Javascript components with ReactPy
66

7-
# About IDOM
7+
# About ReactPy
88

9-
IDOM is a framework for creating highly interactive web pages purely in Python. However,
10-
IDOM also provides a way to natively interface with the Javascript ecosystem. This
9+
ReactPy is a framework for creating highly interactive web pages purely in Python. However,
10+
ReactPy also provides a way to natively interface with the Javascript ecosystem. This
1111
repository defines a basic template for creating packages wich distribute Javascript for
12-
use in IDOM-based applications.
12+
use in ReactPy-based applications.
1313

14-
For more information about IDOM refer to its [documentation](https://idom-docs.herokuapp.com/docs/index.html).
14+
For more information about ReactPy refer to its [documentation](https://reactpy-docs.herokuapp.com/docs/index.html).
1515

1616
# Usage
1717

@@ -24,7 +24,7 @@ pip install cookiecutter
2424
Then use this repostory template as a cookiecutter to initalize a repository:
2525

2626
```bash
27-
cookiecutter https://github.com/idom-team/idom-react-component-cookiecutter.git
27+
cookiecutter https://github.com/reactive-python/reactpy-react-component-cookiecutter.git
2828
```
2929

3030
As the template is being constructed you will be prompted to fill out the following information:

cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"repository_url": "",
77
"python_package_name": "",
88
"npm_package_name": "",
9-
"project_short_description": "A custom component library for IDOM"
9+
"project_short_description": "A custom component library for ReactPy"
1010
}

noxfile.py

Lines changed: 19 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
from contextlib import contextmanager
2-
from functools import wraps
31
from pathlib import Path
42
from shutil import rmtree
5-
from tempfile import TemporaryDirectory
63
from typing import Callable
74

85
from nox import Session, session
@@ -14,63 +11,25 @@
1411
SessionFunc = Callable[[Session], None]
1512

1613

17-
def build_test_repo(install: bool = True) -> Callable[[SessionFunc], SessionFunc]:
18-
"""Build a test repo from test-config.yaml before a session"""
19-
20-
def decorator(session_func: SessionFunc) -> SessionFunc:
21-
@wraps(session_func)
22-
def wrapper(session: Session) -> None:
23-
_build_test_repo(session, install)
24-
return session_func(session)
25-
26-
return wrapper
27-
28-
return decorator
29-
30-
31-
def install_latest_idom(session_func: SessionFunc) -> SessionFunc:
32-
# install the latest version of IDOM by pulling it from the main repo
33-
34-
@wraps(session_func)
35-
def wrapper(session: Session) -> None:
36-
try:
37-
session.run(
38-
"git", "clone", "https://github.com/idom-team/idom.git", external=True
39-
)
40-
session.install("./idom[testing,starlette]")
41-
session_func(session)
42-
finally:
43-
idom_dir = HERE / "idom"
44-
if idom_dir.exists():
45-
rmtree(idom_dir)
46-
47-
return wrapper
48-
49-
50-
@session
51-
def test(session: Session) -> None:
52-
session.notify("test_suite", posargs=session.posargs)
53-
session.notify("test_style")
54-
55-
56-
@session
57-
@build_test_repo()
58-
@install_latest_idom
14+
@session(tags=["test"])
5915
def test_suite(session: Session) -> None:
16+
build_test_repo(session)
17+
install_latest_reactpy(session)
6018
session.chdir("test-repo")
6119
session.run("playwright", "install", "chromium")
6220
session.run("pytest", "tests", "--import-mode=importlib", *session.posargs)
6321

6422

65-
@session
66-
@build_test_repo(install=False)
23+
@session(tags=["test"])
6724
def test_style(session: Session) -> None:
25+
build_test_repo(session, install=False)
6826
session.install("black", "flake8")
6927
session.run("black", "--check", "test-repo", *list(map(str, HERE.glob("*.py"))))
7028
session.run("flake8", "test-repo")
7129

7230

73-
def _build_test_repo(session: Session, install: bool) -> None:
31+
def build_test_repo(session: Session, install: bool = True) -> None:
32+
"""Build a test repo from test-config.yaml"""
7433
# Need to remove node_modules so cookiecutter doesn't think since the cookiecutter
7534
# will try to format those files if present
7635
for path in TEMPLATE_DIR.rglob("node_modules"):
@@ -91,3 +50,15 @@ def _build_test_repo(session: Session, install: bool) -> None:
9150
session.install(".")
9251
session.install("-r", "requirements.txt")
9352
session.chdir("..")
53+
54+
55+
def install_latest_reactpy(session: Session) -> SessionFunc:
56+
# install the latest version of ReactPy by pulling it from the main repo
57+
try:
58+
session.install(
59+
"reactpy[testing,starlette] @ git+https://github.com/reactive-python/reactpy"
60+
)
61+
finally:
62+
reactpy_dir = HERE / "reactpy"
63+
if reactpy_dir.exists():
64+
rmtree(reactpy_dir)

test-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ default_context:
66
repository_url: "https://test.com"
77
python_package_name: "testpypkg"
88
npm_package_name: "testjspkg"
9-
project_short_description: "A custom component library for IDOM"
9+
project_short_description: "A custom component library for ReactPy"

{{cookiecutter.repository_name}}/js/package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
twine
22
pytest
33
pytest-asyncio
4-
idom[testing,starlette]
4+
reactpy[testing,starlette]

0 commit comments

Comments
 (0)