Repository navigation
Pin one-shot tools - #4283
Pin one-shot tools#4283woodruffw wants to merge 3 commits into
Conversation
Unresolved: piped standalone installer examples; integrity verification needs installation-docs redesign.
7c78a07 to
c3eb667
Compare
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
| ARG BUILDARCH | ||
| ARG RUSTUP_VERSION=1.28.2 | ||
| RUN case "$BUILDARCH" in \ | ||
| "amd64") rustup_target="x86_64-unknown-linux-gnu"; rustup_sha256="20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c" ;; \ | ||
| "arm64") rustup_target="aarch64-unknown-linux-gnu"; rustup_sha256="e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c" ;; \ | ||
| *) exit 1 ;; \ | ||
| esac && \ | ||
| curl --proto '=https' --tlsv1.2 -sSf "https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${rustup_target}/rustup-init" -o /tmp/rustup-init && \ | ||
| echo "${rustup_sha256} /tmp/rustup-init" | sha256sum -c - && \ | ||
| chmod +x /tmp/rustup-init && \ | ||
| /tmp/rustup-init -y --target "$(cat rust_target.txt)" --profile minimal --default-toolchain none && \ | ||
| rm /tmp/rustup-init |
There was a problem hiding this comment.
I can't say I love this...maybe there's a first-party Rust image we can hash-pin to instead? I'm not sure if that's better.
There was a problem hiding this comment.
We should make this change separately, it's way more sensitive than pinning one-off uvx invocations.
There was a problem hiding this comment.
Also, we should match across our repositories, e.g., this file is already drifting from uv https://github.com/astral-sh/uv/blob/main/Dockerfile
|
|
||
| - name: "Build docs" | ||
| run: uvx --with-requirements docs/requirements.txt mkdocs build --strict -f mkdocs.yml | ||
| run: uvx --from "mkdocs==1.6.0" --with-requirements docs/requirements.txt mkdocs build --strict -f mkdocs.yml |
There was a problem hiding this comment.
I'd suggest pinning mkdocs as a dev-dependency in pyproject.toml and then changing this to uv run --only-group=dev --locked
There was a problem hiding this comment.
Looking more closely, possibly we should convert the whole docs/requirements.txt file into a docs dependency group in pyproject.toml
There was a problem hiding this comment.
my pattern for this is having the dev group defined as tests + docs + lint groups. Then you can use --group docs|test|... depending the workflow
|
|
||
| ```shell | ||
| uvx --with-requirements docs/requirements.txt -- mkdocs serve -f mkdocs.yml | ||
| uvx --from "mkdocs==1.6.0" --with-requirements docs/requirements.txt mkdocs serve -f mkdocs.yml |
There was a problem hiding this comment.
I cannot review this file, I know nothing about docker 😆
|
|
||
| ```bash | ||
| uvx --with-requirements script.py ty check script.py | ||
| uvx --with-requirements script.py ty@0.0.72 check script.py |
There was a problem hiding this comment.
We might be able to get rid of this uvx invocation altogether and replace it with uv check either now or soon (cc @MichaReiser). But that definitely doesn't need to be done in this PR
AlexWaygood
left a comment
There was a problem hiding this comment.
I don't think any of my comments should block merging this on a second look, they can all be followups
|
|
||
| - name: "Build docs" | ||
| run: uvx --with-requirements docs/requirements.txt mkdocs build --strict -f mkdocs.yml | ||
| run: uvx --from "mkdocs==1.6.0" --with-requirements docs/requirements.txt mkdocs build --strict -f mkdocs.yml |
There was a problem hiding this comment.
Looking more closely, possibly we should convert the whole docs/requirements.txt file into a docs dependency group in pyproject.toml
|
Seems like the best way forward here is to rebase this and split out the Docker changes into a standalone PR? |
Summary
Adds concrete version (and/or hash) pins where appropriate.
Note: I'm pretty sure thetypins are over-eager here. But maybe Rooster can also auto-update these?I think I did the Rooster changes correctly...
Test Plan
NFC.
Stack created with GitHub Stacks CLI • Give Feedback 💬