Skip to content

Commit

Permalink
Including static files in distribution.
Browse files Browse the repository at this point in the history
  • Loading branch information
filipstachura committed Nov 7, 2024
2 parents 8f31a7f + 0030680 commit fd61854
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
.pyc
__pycache__/
*.egg-info
build
dist
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include inst *
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "shiny-router"
name = "shiny_router"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
Expand All @@ -8,3 +8,9 @@ dependencies = [
"pandas",
"shiny",
]

[tool.setuptools]
include-package-data = true

[tool.setuptools.package-data]
"shiny_router" = ["inst/*"]
2 changes: 1 addition & 1 deletion src/shiny_router/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .router import route_link, router_ui, route, router_server

def hello() -> str:
return "Hello from shiny-router!"
return "Hello from shiny_router!"
3 changes: 1 addition & 2 deletions src/shiny_router/router.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from shiny import ui, reactive
from htmltools import HTMLDependency
from pathlib import PurePath

log_msg = print
PAGE_404_ROUTE = "404"
Expand Down Expand Up @@ -109,7 +108,7 @@ def router_ui_internal(router):
pkg_dependency = HTMLDependency("shiny_router", "0.0.1",
source={
"package": "shiny_router",
"subdir": str(PurePath(__file__).parent.parent.parent / "inst" / "www"),
"subdir": "/inst/www",
},
script={"src": js_file, "type": "module"},
stylesheet={"href": css_file}
Expand Down

0 comments on commit fd61854

Please sign in to comment.