Skip to content

Commit

Permalink
CI: remove version override in uv (#3757)
Browse files Browse the repository at this point in the history
UV now supports dynamic versions, by ommitting them from the lockfile!
No more need for our workaround.

astral-sh/uv#10622

After this PR is merged, all xDSL contributors must update to uv version
0.5.20 or higher.
  • Loading branch information
superlopuh authored Jan 16, 2025
1 parent 71c81cf commit bd3a461
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/ci-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pyright-fails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jupyterlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remake-lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-lockfile-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import os
from collections.abc import Mapping
from typing import cast

from setuptools import Command, find_packages, setup

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(
Expand Down
9 changes: 2 additions & 7 deletions xdsl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit bd3a461

Please sign in to comment.