Currently, the R package generation code inserts an integer (which increments for each additional asset inserted into the dependency list) for the version number when none is available in __init__.py.
It would be safer to default to inserting the same version information as for the containing package, since this currently requires developer intervention and editing of internal.R after the package is generated. A (fictional) example:
.dashAwesomeExtensions_js_metadata <- function() {
deps_metadata <- list(`dash_awesome_extensions` = structure(list(name = "dash_awesome_extensions",
version = "2.0", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'dash_awesome_extensions.min.js',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashAwesomeExtensions",
all_files = FALSE), class = "html_dependency"),
`dash_awesome_extensions` = structure(list(name = "dashAwesomeExtensions",
version = "1", src = list(href = NULL,
file = "deps"), meta = NULL,
script = NULL,
stylesheet = 'fancify.css', head = NULL, attachment = NULL, package = "dashDesignKit",
all_files = FALSE), class = "html_dependency"),
`dash_awesome_extensions` = structure(list(name = "dashAwesomeExtensions",
version = "2", src = list(href = NULL,
file = "deps"), meta = NULL,
script = NULL,
stylesheet = 'stylize.css', head = NULL, attachment = NULL, package = "dashDesignKit",
all_files = FALSE), class = "html_dependency"))
return(deps_metadata)
}
This is important because of the way Dash dependencies are currently fetched via URL:
Currently, the R package generation code inserts an integer (which increments for each additional asset inserted into the dependency list) for the version number when none is available in
__init__.py.It would be safer to default to inserting the same version information as for the containing package, since this currently requires developer intervention and editing of
internal.Rafter the package is generated. A (fictional) example:This is important because of the way Dash dependencies are currently fetched via URL:
https://github.com/plotly/dashR/blob/a44050a27ba55056afed8ebac81e852ddf852e1f/R/utils.R#L196-L204
I propose that the default should be to replace
version = "1"andversion = "2"withversion = "2.0"in the example above if version information for dependencies is not available within a generated package.The relevant code block is here:
dash/dash/development/_r_components_generation.py
Lines 278 to 286 in d9ddc87
@alexcjohnson