-
Notifications
You must be signed in to change notification settings - Fork 82
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
Refactor bundlePackages()
#670
Conversation
This turns the main strategy "inside out", so that we find all uninstalled packages, then all packages with missing repo, then collect the package metadata into a list. I've switched the error and warning to use cli and spent a little time polishing the language. But I'm not sure it's that great yet, so I'd love your feedback :) I also rewrote `inferRPackageDependencies()` to use a much simpler strategy since there can only be one `appMode`.
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.
Wordsmithing is unending.
R/bundlePackage.R
Outdated
|
||
# good to go | ||
packages[[name]] <- info | ||
not_installed <- !vapply(deps$Package, is_installed, logical(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.
It's going to take me time to grok that things like is_installed
are coming from rlang
rather than part of this package. All other external references use packagename::XX
names.
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.
Yeah, our philosophy is that rlang is the sort of missing stdlib, that we've decided that we can't live with out and use so frequently that ::
is high friction.
Just a heads up that Tests are failing on R 3.6.3 and R 3.5.3. Not immediately obvious to me from the GH Actions output what's incompatible. |
Ugh, that was a dumb and rather hard to track down mistake. |
@aronatkins I think this is worth another review. In summary:
There is some mild risk that I have introduced bugs that are not caught by the unit tests because this code is hard to test. I think this is somewhat mitigated by the fact that I will be using the dev version of rsconnect, have a mix of CRAN + local + GitHub packages, and will be actively deploying projects over the next few weeks. |
|
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.
OK, with testing concerns about archived packages.
R/bundle.R
Outdated
# packrat automatically fills in the repository information. But that | ||
# causes problems if you're working with a developement version that's | ||
# newer than CRAN. | ||
repo_version <- package_version(repo.packages[pkg, "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.
What defines package_version
? Could you explain how this will cope with archived packages (e.g. Kmisc
, from #508)?
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.
package_version()
is the base R function that takes a string and turns it into a version object so that 1.2.3
compares correctly to 1.10.4
.
Good question about archived packages. I will investigate.
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.
Thanks (on both). I'm more used to seeing packageVersion
and forget about 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.
Ok, I think I've fixed it but I need to figure out how to test it and that feels like a post-weekend problem 😄
#Conflicts: # NEWS.md # R/appDependencies.R # R/bundlePackage.R # tests/testthat/_snaps/bundlePackage.md # tests/testthat/test-bundlePackage.R
And fix capitalisation in docs
I reverted the changes to the |
This turns the main strategy "inside out", so that we find all uninstalled packages, then all packages with missing repo, then collect the package metadata into a list.
I've switched the error and warning to use cli and spent a little time polishing the language. But I'm not sure it's that great yet, so I'd love your feedback :)
I also rewrote
inferRPackageDependencies()
to use a much simpler strategy since there can only be oneappMode
.Fixes #659