Skip to content
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

Merged
merged 5 commits into from
Sep 13, 2021

Conversation

jonkeane
Copy link
Contributor

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)

@MichaelChirico
Copy link
Collaborator

please delete the .DS file

@jonkeane
Copy link
Contributor Author

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)
Copy link
Collaborator

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.

@jonkeane
Copy link
Contributor Author

Is there anything else I should do for this PR?

@AshesITR AshesITR merged commit acc9ce3 into r-lib:master Sep 13, 2021
@AshesITR
Copy link
Collaborator

Sorry, I wanted to manually test this PR before merging to master, but forgot to do the merge. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants