Skip to content

Commit 0c57513

Browse files
committedJun 26, 2022
initial router implementation
1 parent fa39688 commit 0c57513

17 files changed

+1298
-0
lines changed
 

‎.gitignore

+253
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
# --- JAVASCRIPT BUNDLES ---
2+
3+
idom_router/bundle.js
4+
5+
# --- PYTHON IGNORE FILES ----
6+
7+
# Byte-compiled / optimized / DLL files
8+
__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
12+
# C extensions
13+
*.so
14+
15+
# Distribution / packaging
16+
.Python
17+
build/
18+
develop-eggs/
19+
dist/
20+
downloads/
21+
eggs/
22+
.eggs/
23+
lib/
24+
lib64/
25+
parts/
26+
sdist/
27+
var/
28+
wheels/
29+
share/python-wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
MANIFEST
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.nox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
*.py,cover
56+
.hypothesis/
57+
.pytest_cache/
58+
cover/
59+
60+
# Translations
61+
*.mo
62+
*.pot
63+
64+
# Django stuff:
65+
*.log
66+
local_settings.py
67+
db.sqlite3
68+
db.sqlite3-journal
69+
70+
# Flask stuff:
71+
instance/
72+
.webassets-cache
73+
74+
# Scrapy stuff:
75+
.scrapy
76+
77+
# Sphinx documentation
78+
docs/_build/
79+
80+
# PyBuilder
81+
.pybuilder/
82+
target/
83+
84+
# Jupyter Notebook
85+
.ipynb_checkpoints
86+
87+
# IPython
88+
profile_default/
89+
ipython_config.py
90+
91+
# pyenv
92+
# For a library or package, you might want to ignore these files since the code is
93+
# intended to run in multiple environments; otherwise, check them in:
94+
# .python-version
95+
96+
# pipenv
97+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
98+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
99+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
100+
# install all needed dependencies.
101+
#Pipfile.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
111+
__pypackages__/
112+
113+
# Celery stuff
114+
celerybeat-schedule
115+
celerybeat.pid
116+
117+
# SageMath parsed files
118+
*.sage.py
119+
120+
# Environments
121+
.env
122+
.venv
123+
env/
124+
venv/
125+
ENV/
126+
env.bak/
127+
venv.bak/
128+
129+
# Spyder project settings
130+
.spyderproject
131+
.spyproject
132+
133+
# Rope project settings
134+
.ropeproject
135+
136+
# mkdocs documentation
137+
/site
138+
139+
# mypy
140+
.mypy_cache/
141+
.dmypy.json
142+
dmypy.json
143+
144+
# Pyre type checker
145+
.pyre/
146+
147+
# pytype static type analyzer
148+
.pytype/
149+
150+
# Cython debug symbols
151+
cython_debug/
152+
153+
# PyCharm
154+
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
155+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
156+
# and can be added to the global gitignore or merged into this file. For a more nuclear
157+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
158+
#.idea/
159+
160+
161+
# --- JAVASCRIPT IGNORE FILES ---
162+
163+
# See http://help.github.com/ignore-files/ for more about ignoring files.
164+
165+
# compiled output
166+
/dist
167+
/tmp
168+
/out-tsc
169+
170+
# Runtime data
171+
pids
172+
*.pid
173+
*.seed
174+
*.pid.lock
175+
176+
# Directory for instrumented libs generated by jscoverage/JSCover
177+
lib-cov
178+
179+
# Coverage directory used by tools like istanbul
180+
coverage
181+
182+
# nyc test coverage
183+
.nyc_output
184+
185+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
186+
.grunt
187+
188+
# Bower dependency directory (https://bower.io/)
189+
bower_components
190+
191+
# node-waf configuration
192+
.lock-wscript
193+
194+
# IDEs and editors
195+
.idea
196+
.project
197+
.classpath
198+
.c9/
199+
*.launch
200+
.settings/
201+
*.sublime-workspace
202+
203+
# IDE - VSCode
204+
.vscode/*
205+
!.vscode/settings.json
206+
!.vscode/tasks.json
207+
!.vscode/launch.json
208+
!.vscode/extensions.json
209+
210+
# misc
211+
.sass-cache
212+
connect.lock
213+
typings
214+
215+
# Logs
216+
logs
217+
*.log
218+
npm-debug.log*
219+
yarn-debug.log*
220+
yarn-error.log*
221+
222+
223+
# Dependency directories
224+
node_modules/
225+
jspm_packages/
226+
227+
# Optional npm cache directory
228+
.npm
229+
230+
# Optional eslint cache
231+
.eslintcache
232+
233+
# Optional REPL history
234+
.node_repl_history
235+
236+
# Output of 'npm pack'
237+
*.tgz
238+
239+
# Yarn Integrity file
240+
.yarn-integrity
241+
242+
# dotenv environment variables file
243+
.env
244+
245+
# next.js build output
246+
.next
247+
248+
# Lerna
249+
lerna-debug.log
250+
251+
# System Files
252+
.DS_Store
253+
Thumbs.db

‎MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.md
2+
include idom_router/bundle.js
3+
include LICENSE

‎README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# idom-router
2+
3+
A URL router for IDOM
4+
5+
# Installation
6+
7+
Use `pip` to install this package:
8+
9+
```bash
10+
pip install idom-router
11+
```
12+
13+
For a developer installation from source be sure to install [NPM](https://www.npmjs.com/) before running:
14+
15+
```bash
16+
git clone https://github.com/idom-team/idom-router
17+
cd idom-router
18+
pip install -e . -r requirements.txt
19+
```
20+
21+
# Running the Tests
22+
23+
To run the tests you'll need to install [Chrome](https://www.google.com/chrome/). Then you
24+
can download the [ChromeDriver](https://chromedriver.chromium.org/downloads) and add it to
25+
your `PATH`. Once that's done, simply `pip` install the requirements:
26+
27+
```bash
28+
pip install -r requirements.txt
29+
```
30+
31+
And run the tests with `pytest`:
32+
33+
```bash
34+
pytest tests
35+
```
36+
37+
You can run the tests in headless mode (i.e. without opening the browser):
38+
39+
```bash
40+
pytest tests
41+
```
42+
43+
You'll need to run in headless mode to execute the suite in continuous integration systems
44+
like GitHub Actions.
45+
46+
# Releasing This Package
47+
48+
To release a new version of idom-router on PyPI:
49+
50+
1. Install [`twine`](https://twine.readthedocs.io/en/latest/) with `pip install twine`
51+
2. Update the `version = "x.y.z"` variable in `idom-router/__init__.py`
52+
3. `git` add the changes to `__init__.py` and create a `git tag -a x.y.z -m 'comment'`
53+
4. Build the Python package with `python setup.py sdist bdist_wheel`
54+
5. Check the build artifacts `twine check --strict dist/*`
55+
6. Upload the build artifacts to [PyPI](https://pypi.org/) `twine upload dist/*`
56+
57+
To release a new version of `idom-router` on [NPM](https://www.npmjs.com/):
58+
59+
1. Update `js/package.json` with new npm package version
60+
2. Clean out prior builds `git clean -fdx`
61+
3. Install and publish `npm install && npm publish`

‎idom_router/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# the version is statically loaded by setup.py
2+
__version__ = "0.0.1"

0 commit comments

Comments
 (0)
Please sign in to comment.