-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Provide string interpolation support for async/dynamic dep attributes in R #1048
Conversation
🔪 commented out line 🙈 fix case errors and parens 🙈 move async/dynamic to correct pos
) | ||
] | ||
function_frame_body = ",\n".join(function_frame) | ||
elif len(alldist) == 1: | ||
rpp = alldist[0]["relative_package_path"] | ||
dep = alldist[0] |
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.
Not part of this change, but I'm having trouble understanding why we process an array of length one differently from an array of length N
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.
The code doesn't really make much sense as written, but that's because I had trouble getting it to work with enumerate
when I wrote it a year ago. I had only been programming in Python for a week or two, so this code is pretty much a giant pile of 💩. It needs some love and refactoring, no disagreement there.
# then return the properly formatted string if so, i.e. | ||
# " async = TRUE,". a dependency can have async or | ||
# dynamic elements, neither of these, but never both. | ||
def check_async_type(dep): |
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.
Would suggest renaming to get_**
instead as this doesn't check but rather returns some specific value to use as-is
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.
fixed in 3ff7607
package-lock.json
Outdated
@@ -0,0 +1,14115 @@ | |||
{ |
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.
This looks like 🔪 - there's no corresponding package.json
file.
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.
fixed in 1d5a112
"R package.", | ||
file=sys.stderr, | ||
) | ||
sys.exit(1) |
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.
As discussed on slack: javascript docstrings should NOT contain escapes for % characters, that would look weird in JS (and in Python). So the right way to handle this is to automatically insert the escapes when translating from JS to R.
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.
fixed in 52a3394
The tests failures we are seeing here are caused by a regression from the dcc.Graph responsiveness -- not related to this PR (https://circleci.com/gh/plotly/dash/13778#tests/containers/1) |
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.
Failures are coming from a regression in DCC. This looks fine. 💃
I'm going to add one last feature here -- to scrub examples from docstrings in packages such as DDK when generating the R packages, will relocate them to |
fixed in b471d35 |
* ✨ async/dynamic support in R pkg deps * 🔪 remove Authors block * 🔪 insert package version number * 🔨 use verbose 📦 title and desc from YAML * ✨ autodetect vignettes * check for author/maintainer address * ✋ halt processing if fatal errors found * autopopulate KeepSource * auto-escape % in docstrings * 🔪 filter examples from docstrings in R
This PR proposes to add support for generating
async
ordynamic
attributes within the JavaScript metadata Dash for R uses to manage dependencies.Additionally, improvements to the package generator have been introduced:
dash-info.yaml
first, and then from information inpackage.json
when it is unavailable or the relevant keys are missing.js
,.map
,.css
) are now properly generated to match versioning within the library of originvignettes
directory is present, the generator will add aVignetteBuilder
entry toDESCRIPTION
and appendknitr, rmarkdown
to theSuggests
field, but it will not build the vignettes itself (that requires runningR CMD build
and is out of scope at this time)**Example Usage**
will now be filtered out of the R help pagesKeepSource
is set to true in generated R packages, to facilitate line numbering in stack traces%
within docstrings will silently and automatically be escaped when generating.Rd
files within R packages, as these are comment characters in R help files and will break package installationCloses #1002. Fixes plotly/dash-core#69, resolves plotly/dash-core#71.