-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add
shinylive url
command (#20)
* feat(url): Add `shinylive url`command and `make_shinylive_url()` function * export `make_shinylive_url()` * chore: app and files could be Paths * require lzstring * remove `__all__` from `__init__.py` * noqa and pyright ingore * feat: shinylive url (encode,decode) * allow piping into `shinylive url decode` * allow piping into `shinylive url encode` and detect app source code Using the "newline trick" (if it has newlines it's source code, not a path) * negotiate aggressively with the type checker * demote unused f string * add comment * document --out option * require `--help` so that piping into url encode works * include files, recursively * less aggressive type check convincing * rename --out to --dir * automatically detect app language when app is the text content * Apply suggestions from code review Co-authored-by: Winston Chang <[email protected]> * import Literal * type narrow language from encode CLI -> internal * don't need to import os * add note about decode result wrt --dir * write base64-decoded binary files * detect_app_language() returns "py" or "r" * make FileContentJson.type not required * only add header param in app mode * if file is str|Path, promote to list * improve FileContentJson typing throughout * exclude _dev folder from checks * fix syntax for creating FileContenJson objects * require typing-extensions * separate bundle creation from URL encoding * add `encode_shinylive_url()` and make only encode/decode public * simplify types and remove need for AppBundle by detecting language earlier in aggregate processes * move package version into a subpackage * wrap decode outputs in helper functions, too * rename version to _version * docs: describe feature in changelog * fix one more _version import * bump package version to 0.1.3.9000 --------- Co-authored-by: Winston Chang <[email protected]>
- Loading branch information
Showing
7 changed files
with
528 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[metadata] | ||
name = shinylive | ||
version = attr: shinylive.__version__ | ||
version = attr: shinylive._version.SHINYLIVE_PACKAGE_VERSION | ||
author = Winston Chang | ||
author_email = [email protected] | ||
url = https://github.com/posit-dev/py-shinylive | ||
|
@@ -36,6 +36,8 @@ install_requires = | |
shiny | ||
click>=8.1.7 | ||
appdirs>=1.4.4 | ||
lzstring>=1.0.4 | ||
typing-extensions>=4.0.1 | ||
tests_require = | ||
pytest>=3 | ||
zip_safe = False | ||
|
@@ -69,7 +71,7 @@ console_scripts = | |
# F405: Name may be undefined, or defined from star imports | ||
# W503: Line break occurred before a binary operator | ||
ignore = E302, E501, F403, F405, W503 | ||
exclude = docs, .venv | ||
exclude = docs, .venv, _dev | ||
|
||
[isort] | ||
profile=black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
"""A package for packaging Shiny applications that run on Python in the browser.""" | ||
|
||
from . import _version | ||
from ._url import decode_shinylive_url, encode_shinylive_url | ||
from ._version import SHINYLIVE_PACKAGE_VERSION | ||
|
||
__version__ = _version.SHINYLIVE_PACKAGE_VERSION | ||
__version__ = SHINYLIVE_PACKAGE_VERSION | ||
|
||
__all__ = ("decode_shinylive_url", "encode_shinylive_url") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.