From bd3a4618bbce13487fd214ed9515c981dbb84548 Mon Sep 17 00:00:00 2001 From: Sasha Lopoukhine Date: Thu, 16 Jan 2025 17:46:30 +0000 Subject: [PATCH] CI: remove version override in uv (#3757) UV now supports dynamic versions, by ommitting them from the lockfile! No more need for our workaround. https://github.com/astral-sh/uv/pull/10622 After this PR is merged, all xDSL contributors must update to uv version 0.5.20 or higher. --- .github/workflows/ci-core.yml | 2 +- .github/workflows/ci-lockfile.yml | 4 ++-- .github/workflows/ci-notebooks.yml | 2 +- .github/workflows/ci-pyright-fails.yml | 2 +- .github/workflows/code-formatting.yml | 2 +- .github/workflows/jupyterlite.yml | 2 +- .github/workflows/pythonpublish.yml | 2 +- .github/workflows/remake-lockfile.yml | 2 +- .github/workflows/update-lockfile-bot.yml | 4 ++-- Makefile | 2 +- setup.py | 6 +----- xdsl/__init__.py | 9 ++------- 12 files changed, 15 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index a77c106224..2d2910ad35 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v4 - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v5 with: enable-cache: true cache-dependency-glob: "uv.lock" diff --git a/.github/workflows/ci-lockfile.yml b/.github/workflows/ci-lockfile.yml index 9a17891c9d..0ce7c29b3f 100644 --- a/.github/workflows/ci-lockfile.yml +++ b/.github/workflows/ci-lockfile.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v4 - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v5 with: enable-cache: true cache-dependency-glob: "uv.lock" @@ -35,4 +35,4 @@ jobs: run: | # Install all default extras. # Fail if the lockfile dependencies are out of date with pyproject.toml. - XDSL_VERSION_OVERRIDE="0+dynamic" uv sync --extra gui --extra dev --extra jax --extra riscv --locked + uv sync --extra gui --extra dev --extra jax --extra riscv --locked diff --git a/.github/workflows/ci-notebooks.yml b/.github/workflows/ci-notebooks.yml index 315ecaab2d..772dbb5641 100644 --- a/.github/workflows/ci-notebooks.yml +++ b/.github/workflows/ci-notebooks.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v4 - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v5 with: enable-cache: true cache-dependency-glob: "uv.lock" diff --git a/.github/workflows/ci-pyright-fails.yml b/.github/workflows/ci-pyright-fails.yml index 242ef950bb..ac40df4cfc 100644 --- a/.github/workflows/ci-pyright-fails.yml +++ b/.github/workflows/ci-pyright-fails.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v4 - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v5 with: enable-cache: true cache-dependency-glob: "uv.lock" diff --git a/.github/workflows/code-formatting.yml b/.github/workflows/code-formatting.yml index b078349aef..a3ffe2fd54 100644 --- a/.github/workflows/code-formatting.yml +++ b/.github/workflows/code-formatting.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v5 with: enable-cache: true cache-dependency-glob: "uv.lock" diff --git a/.github/workflows/jupyterlite.yml b/.github/workflows/jupyterlite.yml index 06639560a9..99a89eaf5b 100644 --- a/.github/workflows/jupyterlite.yml +++ b/.github/workflows/jupyterlite.yml @@ -15,7 +15,7 @@ jobs: path: xdsl - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v5 - name: Set up Python run: uv python install 3.11 diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index bdf6cd9ce6..5a42a071b1 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v5 - name: Set up Python run: uv python install 3.11 diff --git a/.github/workflows/remake-lockfile.yml b/.github/workflows/remake-lockfile.yml index 3795e06a34..1e349f66b4 100644 --- a/.github/workflows/remake-lockfile.yml +++ b/.github/workflows/remake-lockfile.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v3 + - uses: astral-sh/setup-uv@v5 - run: | rm uv.lock diff --git a/.github/workflows/update-lockfile-bot.yml b/.github/workflows/update-lockfile-bot.yml index 22dfee2748..5331a86681 100644 --- a/.github/workflows/update-lockfile-bot.yml +++ b/.github/workflows/update-lockfile-bot.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v4 - name: Install uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v5 with: enable-cache: true cache-dependency-glob: "uv.lock" @@ -28,7 +28,7 @@ jobs: - name: Install the package locally and update lockfile run: | # Install all default extras. - XDSL_VERSION_OVERRIDE="0+dynamic" make venv + make venv - uses: EndBug/add-and-commit@v9 with: diff --git a/Makefile b/Makefile index 026a193278..46403d67ff 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ uv-installed: # set up the venv with all dependencies for development .PHONY: ${VENV_DIR}/ ${VENV_DIR}/: uv-installed - XDSL_VERSION_OVERRIDE="0+dynamic" uv sync ${VENV_EXTRAS} + uv sync ${VENV_EXTRAS} @if [ ! -z "$(XDSL_MLIR_OPT_PATH)" ]; then \ ln -sf $(XDSL_MLIR_OPT_PATH) ${VENV_DIR}/bin/mlir-opt; \ fi diff --git a/setup.py b/setup.py index 41cc20d3e1..92b8cfb0f5 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -import os from collections.abc import Mapping from typing import cast @@ -6,10 +5,7 @@ import versioneer -if "XDSL_VERSION_OVERRIDE" in os.environ: - version = os.environ["XDSL_VERSION_OVERRIDE"] -else: - version = versioneer.get_version() +version = versioneer.get_version() setup( diff --git a/xdsl/__init__.py b/xdsl/__init__.py index df46b56a94..2044304eee 100644 --- a/xdsl/__init__.py +++ b/xdsl/__init__.py @@ -9,14 +9,9 @@ def __init__(self): def __str__(self): if self._version is None: - import os + from . import _version - if "XDSL_VERSION_OVERRIDE" in os.environ: - self._version = os.environ["XDSL_VERSION_OVERRIDE"] - else: - from . import _version - - self._version = _version.get_versions()["version"] + self._version = _version.get_versions()["version"] return self._version