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

Add archive.rds and expand package path to allow archived versions of R packages #58

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

craddm
Copy link
Contributor

@craddm craddm commented Aug 8, 2024

This allows the R remotes package to download and install older versions of R packages. It permits required metadata to be downloaded and modifies the content selector for each package to allow archived package versions to be found.

Closes #57

@JimMadge
Copy link
Member

JimMadge commented Aug 8, 2024

@craddm could you give me a R command/script to install a package from the archive so I can test this?

@craddm
Copy link
Contributor Author

craddm commented Aug 8, 2024

@craddm could you give me a R command/script to install a package from the archive so I can test this?

remotes::install_version("data.table", version = "1.13.0") should do - slightly older version, and data.table is on our allow list.

(you will need to make sure remotes is installed first, install.packages("remotes")

@JimMadge
Copy link
Member

JimMadge commented Aug 9, 2024

Can you do the same with install.packages?

@craddm
Copy link
Contributor Author

craddm commented Aug 9, 2024

Can you do the same with install.packages?

You'd have to generate the correct URL, e.g.

packageurl <- "http://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_0.9.1.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

I suppose with the nexus repo setup you could do something like this for an older version of a package

packagename <- "data.table"
version <- "1.13.0"
packageurl <- paste0(contrib.url(getOption("repos")), "/Archive/", packagename, "/", packagename, "_", version, ".tar.gz")
install.packages(packageurl, repos=NULL, type="source")

@JimMadge
Copy link
Member

JimMadge commented Aug 9, 2024

Do you think remotes is common/important enough to support?

I thought the attitude of CRAN was along the lines of "Use only the latest set of all packages, that is what we guarantee to be compatible".

@craddm
Copy link
Contributor Author

craddm commented Aug 9, 2024

Do you think remotes is common/important enough to support?

I thought the attitude of CRAN was along the lines of "Use only the latest set of all packages, that is what we guarantee to be compatible".

If we're not using the latest R, which we're not, we'll need to support installing older package versions. Also there may be good reason to use specific package versions (e.g. replicating an earlier analysis)

@JimMadge JimMadge merged commit e08a650 into alan-turing-institute:main Aug 9, 2024
5 checks passed
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.

CRAN content selector only allows latest package version
2 participants