diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 811190f31..c936e5825 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,39 +1,15 @@ -FROM debian:bookworm-slim AS builder - -WORKDIR /opt - -# The installer requires curl (and certificates) to download the release archive -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - curl - -SHELL [ "/bin/bash", "-o", "pipefail", "-c" ] - -# Download the latest installer -ADD https://astral.sh/uv/install.sh uv-installer.sh - -# Run the installer then remove it -RUN sh uv-installer.sh - - FROM mcr.microsoft.com/vscode/devcontainers/base:bookworm -ENV CARGO_HOME="/opt/.cargo/bin" -ENV PATH="$CARGO_HOME/:$PATH" - ENV PYTHONUNBUFFERED=True ENV UV_LINK_MODE=copy WORKDIR /opt -COPY --from=builder /root/.cargo/bin/uv $CARGO_HOME/uv -COPY --from=builder /root/.cargo/bin/uvx $CARGO_HOME/uvx +COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv +COPY --from=ghcr.io/astral-sh/uv:latest /uvx /bin/uvx COPY ./.python-version ./ RUN uv python pin "$(cat .python-version)" -RUN chown -R vscode $CARGO_HOME - # Install required tools for development RUN apt-get update && apt-get install -y iperf3 libusb-dev \ No newline at end of file diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index 1972189d2..a6bd48743 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Run ruff + - name: Run Ruff uses: astral-sh/ruff-action@v3 with: version-file: "pyproject.toml" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8cf4f29b..ee31bc413 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,13 @@ default_stages: [pre-commit] repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.5 + rev: v0.9.2 hooks: - - id: ruff - name: Ruff check - description: "Run 'ruff check' for extremely fast Python linting" - args: [ --fix ] + - id: ruff + name: Ruff Check + description: "Run 'ruff check' for extremely fast Python linting" + args: [ --fix ] - - id: ruff-format - name: Ruff format - description: "Run 'ruff format' for extremely fast Python formatting" \ No newline at end of file + - id: ruff-format + name: Ruff Format + description: "Run 'ruff format' for extremely fast Python formatting" \ No newline at end of file diff --git a/__templates__/driver/pyproject.toml.tmpl b/__templates__/driver/pyproject.toml.tmpl index 4927c8275..2218ef545 100644 --- a/__templates__/driver/pyproject.toml.tmpl +++ b/__templates__/driver/pyproject.toml.tmpl @@ -35,5 +35,4 @@ build-backend = "hatchling.build" dev = [ "pytest-cov>=6.0.0", "pytest>=8.3.3", - "ruff>=0.7.1", ] diff --git a/packages/jumpstarter-cli-client/jumpstarter_cli_client/lease.py b/packages/jumpstarter-cli-client/jumpstarter_cli_client/lease.py index cee750759..cbff12745 100644 --- a/packages/jumpstarter-cli-client/jumpstarter_cli_client/lease.py +++ b/packages/jumpstarter-cli-client/jumpstarter_cli_client/lease.py @@ -47,31 +47,32 @@ def lease_release(name, lease, all_leases): raise ValueError("no lease specified") config.release_lease(lease) + @lease.command("request") @click.option("-l", "--label", "labels", type=(str, str), multiple=True) @click.argument("name", type=str, default="") def lease_request(name, labels): """Request an exporter lease from the jumpstarter controller. -The result of this command will be a lease ID that can be used to -connect to the remote exporter. + The result of this command will be a lease ID that can be used to + connect to the remote exporter. -This is useful for multi-step workflows where you want to hold a lease -for a specific exporter while performing multiple operations, or for -CI environments where one step will request the lease and other steps -will perform operations on the leased exporter. + This is useful for multi-step workflows where you want to hold a lease + for a specific exporter while performing multiple operations, or for + CI environments where one step will request the lease and other steps + will perform operations on the leased exporter. -Example: + Example: -.. code-block:: bash + .. code-block:: bash - $ JMP_LEASE=$(jmp lease request -l label match) - $ jmp shell - $$ j --help - $$ exit - $ jmp lease release -l "${JMP_LEASE}" + $ JMP_LEASE=$(jmp lease request -l label match) + $ jmp shell + $$ j --help + $$ exit + $ jmp lease release -l "${JMP_LEASE}" -""" + """ try: if name: config = ClientConfigV1Alpha1.load(name) diff --git a/packages/jumpstarter-driver-http/pyproject.toml b/packages/jumpstarter-driver-http/pyproject.toml index a1744e951..1a2afd819 100644 --- a/packages/jumpstarter-driver-http/pyproject.toml +++ b/packages/jumpstarter-driver-http/pyproject.toml @@ -35,6 +35,5 @@ dev = [ "pytest-cov>=6.0.0", "pytest>=8.3.3", "pytest-asyncio>=0.0.0", - "ruff>=0.7.1", "pytest-asyncio>=0.24.0", ] diff --git a/pyproject.toml b/pyproject.toml index 2745c2cb1..d758431e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ docs = [ "sphinx-click>=6.0.0", "sphinx-substitution-extensions>=2024.10.17", ] -dev = ["ruff>=0.9.2", "typos>=1.23.6", "pre-commit>=3.8.0", "esbonio>=0.16.5"] +dev = ["ruff==0.9.2", "typos>=1.23.6", "pre-commit>=3.8.0", "esbonio>=0.16.5"] [tool.ruff] exclude = ["packages/jumpstarter-protocol"] diff --git a/uv.lock b/uv.lock index 6b11c1dce..c0f358b52 100644 --- a/uv.lock +++ b/uv.lock @@ -37,7 +37,7 @@ members = [ dev = [ { name = "esbonio", specifier = ">=0.16.5" }, { name = "pre-commit", specifier = ">=3.8.0" }, - { name = "ruff", specifier = ">=0.9.2" }, + { name = "ruff", specifier = "==0.9.2" }, { name = "typos", specifier = ">=1.23.6" }, ] docs = [ @@ -1040,7 +1040,6 @@ dev = [ { name = "pytest" }, { name = "pytest-asyncio" }, { name = "pytest-cov" }, - { name = "ruff" }, ] [package.metadata] @@ -1056,7 +1055,6 @@ dev = [ { name = "pytest-asyncio", specifier = ">=0.0.0" }, { name = "pytest-asyncio", specifier = ">=0.24.0" }, { name = "pytest-cov", specifier = ">=6.0.0" }, - { name = "ruff", specifier = ">=0.7.1" }, ] [[package]]