-
Notifications
You must be signed in to change notification settings - Fork 24
Remote subdirs #473
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
Remote subdirs #473
Conversation
Ah I did not pay attention to the fact that |
well actually it works with cran packages but not with archive packages because the they use hash_url, try to fix this |
So I think I am done with the PR, all tests pass. I think i will add two sentenced in the docs, will have time again on Sunday |
R/nix_hash.R
Outdated
url | ||
) | ||
commit <- gsub(x = basename(url), pattern = ".tar.gz", replacement = "") | ||
commit_date <- get_commit_date(repo_url_short, commit) |
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.
just realized this is only being done for github: maybe in another PR this could be extended to gitlab as well
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.
yeah, although this is more complicated than changing it here, because this relies on API github, github token etc, so yes maybe something for a future PR although I think we have seen several users relying on github remotes and not any relying on gitlab, also don't have any package from gitlab i use.
@b-rodrigues I've created a function to generate the regex (with some help by Claude Sonnet), should be less redundant now, also created some docs, hope you are happy with that. |
btw found naother prominent example mentioned on the remotes github site. |
xgboost is on cran, so it's available through nixpkgs as well |
Yeah sure, but if you want to install the dev version (as mentioned on remotes here https://github.com/r-lib/remotes) you need a package which supports subfolder, which rix currently does not |
@b-rodrigues okay i put it in the first if statement, was some additional work and code. |
you should revert that last commit, as the test is not fixed |
yeah I know, I try to understand why .. not sure yet, do you see it? |
ah I have a clue I use the commit now, previously we downloaded and just used the existing directory. THis usually works fine, but not if the commit is head. The correct dir name is |
This reverts commit 9107909.
this previously failed because it relied on commits however if the commit was not fetched the dir path would be wrong. Therefore, this now uses again two if statements, or before try download and one after download, to get the correct path via `list.files()` after download.
@b-rodrigues so the previous attempt of using one large if statement failed because this relied on having a commit to get the correct r path instead of relying on the file path to the repo after it had been downloaded. Since this could also happen, if people don't use a github token or so, I don't think this is a robust approach. I simplified the if statement by just setting |
Many thanks! |
Welcome |
@b-rodrigues as discussed here #467
rix should work with github/gitlab packages that use a subdirectory to store the R package like BPCells.