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

Implement download_model() using {httr2} and add tests #885

Merged
merged 5 commits into from
Jun 9, 2024

Conversation

IndrajeetPatil
Copy link
Member

No description provided.

@@ -10,6 +10,8 @@
#' Optional, and should only be used in case the repository-URL is
#' changing. By default, models are downloaded from
#' `https://raw.github.com/easystats/circus/master/data/`.
#' @param extension File extension. Default is `.rda`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case we ever start saving data in some other format.

download_model <- function(name,
url = "https://raw.github.com/easystats/circus/master/data/",
extension = ".rda",
verbose = TRUE) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verbosity is useful here to control output in tests.

tests/testthat/setup.R Outdated Show resolved Hide resolved
@IndrajeetPatil IndrajeetPatil merged commit db549ca into main Jun 9, 2024
12 of 27 checks passed
@IndrajeetPatil IndrajeetPatil deleted the use-httr2 branch June 9, 2024 09:47
@strengejacke
Copy link
Member

Do we need both httptest2 and httr2 to use download_model(), or is httr2 sufficient?

@IndrajeetPatil
Copy link
Member Author

httptest2 is for tests, httr2 provides the client.

The user needs only the latter.

@strengejacke
Copy link
Member

thanks! we need to change this (httr -> httr2) in our tests where we use download_model(), that's why I'm asking which packages should go into skip_if_not_installed().

@IndrajeetPatil
Copy link
Member Author

You are right!

Sorry, missed it in this PR. I should have just removed httr from DESCRIPTION.

@strengejacke
Copy link
Member

You have removed it. I added it back for the patch-release. Else, this insight release would again break downstream packages 😬 and I thought it would be good not to cause any more despair. ;-)

So once all tests in other packages are fixed, we can remove httr (and the helper code I added back temporarily).

@IndrajeetPatil
Copy link
Member Author

SGTM.

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.

2 participants