Conversation
zanieb
left a comment
There was a problem hiding this comment.
Seems nice to have a test case.
|
Would also be nice if this would work with GitHub enterprise gists as well, maybe by environment variables like |
|
With GHE though, can we know if the URL is |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.8.4` -> `0.8.5` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>astral-sh/uv (astral-sh/uv)</summary> ### [`v0.8.5`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#085) [Compare Source](astral-sh/uv@0.8.4...0.8.5) ##### Enhancements - Enable `uv run` with a GitHub Gist ([#​15058](astral-sh/uv#15058)) - Improve HTTP response caching log messages ([#​15067](astral-sh/uv#15067)) - Show wheel tag hints in install plan ([#​15066](astral-sh/uv#15066)) - Support installing additional executables in `uv tool install` ([#​14014](astral-sh/uv#14014)) ##### Preview features - Enable extra build dependencies to 'match runtime' versions ([#​15036](astral-sh/uv#15036)) - Remove duplicate `extra-build-dependencies` warnings for `uv pip` ([#​15088](astral-sh/uv#15088)) - Use "option" instead of "setting" in `pylock` warning ([#​15089](astral-sh/uv#15089)) - Respect extra build requires when reading from wheel cache ([#​15030](astral-sh/uv#15030)) - Preserve lowered extra build dependencies ([#​15038](astral-sh/uv#15038)) ##### Bug fixes - Add Python versions to markers implied from wheels ([#​14913](astral-sh/uv#14913)) - Ensure consistent indentation when adding dependencies ([#​14991](astral-sh/uv#14991)) - Fix handling of `python-preference = system` when managed interpreters are on the PATH ([#​15059](astral-sh/uv#15059)) - Fix symlink preservation in virtual environment creation ([#​14933](astral-sh/uv#14933)) - Gracefully handle entrypoint permission errors ([#​15026](astral-sh/uv#15026)) - Include wheel hashes from local Simple indexes ([#​14993](astral-sh/uv#14993)) - Prefer system Python installations over managed ones when `--system` is used ([#​15061](astral-sh/uv#15061)) - Remove retry wrapper when matching on error kind ([#​14996](astral-sh/uv#14996)) - Revert `h2` upgrade ([#​15079](astral-sh/uv#15079)) ##### Documentation - Improve visibility of copy and line separator in dark mode ([#​14987](astral-sh/uv#14987)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS41Mi4yIiwidXBkYXRlZEluVmVyIjoiNDEuNTIuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
|
I could see this being extended to |
|
We already support that. |
|
Ah, I wouldn't have guessed by the output of The help text does not indicate at all what values |
|
Sounds like you want the long help... |
|
Ah yes, the long help does mention it, thanks. |
## Summary Extend the existing GitHub Gist URL support from #15058 to handle URLs that redirect to Gists. `reqwest` already handled generic URL redirects for us (note this redirects directly to the `.py` on `gist.githubusercontent.com`): ~/git/uv $ uv run https://httpbin.org/redirect-to?url=https://gist.githubusercontent.com/twilligon/4d878a4d9550a4f1df258cde1f058699/raw/c28a4bf0cb6bb9e670cb47c95d28971ffac163e5/hello.py hello world! But running a URL that redirected to a Gist's "main page" (a bit.ly link leading to a Gist, etc.) did not: ~/git/uv $ uv run https://httpbin.org/redirect-to?url=https://gist.github.com/twilligon/4d878a4d9550a4f1df258cde1f058699 File "/tmp/scriptNodt3Q.py", line 87 <title>hello.py · GitHub</title> But if we have `reqwest` follow redirects *before* `resolve_gist_url`, we can handle this fine: ~/git/uv $ target/debug/uv run https://httpbin.org/redirect-to?url=https://gist.github.com/twilligon/4d878a4d9550a4f1df258cde1f058699 hello world! ## Test Plan I'd write an automated test but that'd require network access since wiremock doesn't seem to support mocking specific hostnames like `gist.github.com`. As manual tests go, I basically did the above, testing with several redirectors to both generic and Gist URLs.
Summary
You can now run
uv run https://gist.github.com/charliermarsh/ea9eab7f56b1b3d41e51960001cae31dto execute a single-file Gist without having to go in and copy the raw URL.