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

use_dev_package tries to install from CRAN rather than the remote #1870

Closed
Moohan opened this issue Jun 23, 2023 · 3 comments
Closed

use_dev_package tries to install from CRAN rather than the remote #1870

Moohan opened this issue Jun 23, 2023 · 3 comments

Comments

@Moohan
Copy link

Moohan commented Jun 23, 2023

I created a package and initialised renv. I was using use_dev_package("funspotr") to add the {funspotr} package to the DESCRIPTION. No matter how I specified it e.g. even as: use_dev_package("funspotr", remote = "git::https://github.com/brshallo/funspotr.git") usethis would say the package wasn't installed and if I chose to install the package it would go to CRAN, where it obviously wouldn't find it and then would fail.

I think if use_dev_package is trying to install a package it should try and install it from remote, if remote isn't specified the user should be prompted to enter one.

@jennybc
Copy link
Member

jennybc commented Jun 23, 2023

It's pretty unusual to use renv while developing a package and, unless you have a specific reason to do so, I wouldn't recommend it. It's certainly not a use case that has been explored or designed around much in terms of devtools/usethis.

I'm guessing you have not installed funspotr into the project-specific library for this new project?

@Moohan
Copy link
Author

Moohan commented Jun 23, 2023

Yep exactly, it hadn't been installed into the project specific library.

Probably less likely but this issue could also occur outside of a renv context, if adding the package before installing it, which is surely the situation that the rlang::check_installed() is trying to catch... It just doesn't work when the package in question comes from a non-standard (CRAN) source.

@jennybc
Copy link
Member

jennybc commented Jun 23, 2023

I feel like the message telling you that the package wasn't installed worked as intended here. devtools and usethis basically assume that when you are working on a package, you have all of its dependencies installed locally. I think it makes more sense for you to install brshallo/funspotr in the renv library specific to your package, then call use_dev_package() than for usethis to gain a lot of conditional code for this edge case.

@jennybc jennybc closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2023
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

No branches or pull requests

2 participants