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

Adding package from pull request URL #3975

Open
MilesCranmer opened this issue Jul 31, 2024 · 4 comments
Open

Adding package from pull request URL #3975

MilesCranmer opened this issue Jul 31, 2024 · 4 comments

Comments

@MilesCranmer
Copy link
Sponsor Member

MilesCranmer commented Jul 31, 2024

Just a small convenience, it would be nice if the following syntax worked

(myproject) pkg> add https://github.com/JuliaPy/PythonCall.jl/pull/529
     Cloning git-repo `https://github.com/JuliaPy/PythonCall.jl/pull/529`
ERROR: failed to clone from https://github.com/JuliaPy/PythonCall.jl/pull/529, error: GitError(Code:ERROR, Class:HTTP, unexpected http status code: 404)

Yes it's just a couple more clicks to find the user's repository & branch and install that instead, but it would be nice if you could just input pull requests directly

@MilesCranmer MilesCranmer changed the title Adding repo from pull request Adding project from pull request URL Jul 31, 2024
@MilesCranmer MilesCranmer changed the title Adding project from pull request URL Adding package from pull request URL Jul 31, 2024
@KristofferC
Copy link
Sponsor Member

Ref #3079

@MilesCranmer
Copy link
Sponsor Member Author

For pull request URLs it's a bit more complex since the pull request URL itself does not contain the necessary info. We'd probably have to send an API query to GitHub to get the right remote and branch associated to the pull request.

@giordano
Copy link
Contributor

giordano commented Aug 1, 2024

For pull request URLs it's a bit more complex since the pull request URL itself does not contain the necessary info.

Not really, you can always access a PR branch using the ref pull/<PR number>/head. The only problem is that you need to fetch the ref specifically, I don't think you can just clone the repo from that ref. So in practice what you may need to do is to create a bare repo, add the origin, fetch the ref, check it out, instead of just cloning a branch of a repo.

@MilesCranmer
Copy link
Sponsor Member Author

Cool, that seems like a good way to have this work.

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

3 participants