-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For Express, emit message if need to upgrade rsconnect-python #1233
Conversation
shiny/_main.py
Outdated
|
||
try: | ||
package_version = version(PACKAGE_NAME) | ||
print(package_version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errant print?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh oops, I had deleted it on my local copy of the file, but forgot to commit. 🤦
shiny/_main.py
Outdated
|
||
from importlib.metadata import PackageNotFoundError, version | ||
|
||
def _safe_int(x: str) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we already have an indirect dependency on packaging
, do we want to make it direct and use their version parsing?
from packaging.version import parse
from importlib.metadata import PackageNotFoundError, version
import sys
try:
installed_version = parse(version(PACKAGE_NAME))
required_version = parse(MIN_VERSION)
if installed_version < required_version:
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call -- I see that htmltools uses packaging
to check versions, so I've updated the code as you suggested.
* main: (24 commits) chore: Disable broken test on CI; Fix broken docs entries (posit-dev#1241) Add back missing session methods (posit-dev#1239) Add kitchensink tests for valuebox (posit-dev#1229) For Express, emit message if need to upgrade rsconnect-python (posit-dev#1233) feat: Editable data frame (posit-dev#1198) Add tests for shiny_mode comment detection fix(input_dark_mode): Allow users to customize `style` attribute (posit-dev#1207) chore(get_current_session): Return default session if current is explicitly None (posit-dev#1086) chore: use dev htmtlools (posit-dev#1228) feat(layout_columns): Use `sm` as the default `col_widths` breakpoint (posit-dev#1222) feat: ensure min/max height args on `value_box()` and column layouts (posit-dev#1223) fix(static_assets): Need the directory containing the `app.py`, not the file itself (posit-dev#1219) Update bslib and shiny dependencies (posit-dev#1221) Update docstring and give hint for mypy Add support for Shiny Express in Quarto Dashboards, take 2 (posit-dev#1217) Force UTF-8 for Shiny Express on Windows (posit-dev#1203) Typing fixes feat(card): Report full screen state as a Shiny input (posit-dev#1215) Use TypeScript strict mode (posit-dev#1208) Update author email ...
Addresses #1232.
When a user runs
shiny run app.py
on a Shiny Express app, this checks the version of the rsconnect-python package.If (A) rsconnect-python is installed and (B), the version is less than 1.22.0, then this will print a message to stderr like this, and then it will run the app as usual.