-
Notifications
You must be signed in to change notification settings - Fork 184
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
Read namespace files in packages that aren't in directories with their name #841
Conversation
please delete the .DS file |
Oops, sorry about that. Should be gone now |
R/namespace.R
Outdated
@@ -2,7 +2,7 @@ | |||
namespace_imports <- function(path = find_package()) { | |||
imports <- tryCatch({ | |||
pkg_name <- suppressWarnings(pkg_name(path)) | |||
data <- parseNamespaceFile(package = pkg_name, package.lib = file.path(path, "..")) | |||
data <- parseNamespaceFile(package = "", package.lib = path) |
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.
Internally this will call file.path
with a zero-length string, using path//NAMESPACE
as the path instead of path/NAMESPACE
. Using package = basename(path)
would be more robust.
Is there anything else I should do for this PR? |
Sorry, I wanted to manually test this PR before merging to master, but forgot to do the merge. Thanks a lot! |
For some packages, the directory they are housed in is not simply their name (e.g. Arrow's r package is housed under
arrow/r
)This change fixes that (as well as adds a test that it is fixed)