Skip to content

[CHORE] manage the project with uv and a committed lockfile - #7

Merged
youssefassis merged 4 commits into
mainfrom
chore/uv-project
Oct 5, 2026
Merged

youssefassis merged 4 commits into
mainfrom
chore/uv-project

Conversation

@youssefassis

@youssefassis youssefassis commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Why

Installs resolved whatever versions were current that day, so two people could not be sure they ran the same stack. Now setup is one command (uv sync) and everyone gets the locked versions.

Changes

  • uv.lock committed, .python-version set to 3.12 (uv fetches it automatically).
  • Dev tools moved to [dependency-groups], so uv sync installs them without flags and they stay out of the published package.
  • New classify-justify console script; python -m classify_justify still works.
  • cpu extra routes torch to the CPU-only index. The gpu extra mirrors the default build: uv only locks both builds when two extras are declared as conflicting.
  • CI: uv sync --locked --extra cpu, then uv run --no-sync so the CPU torch and the matrix Python are kept.
  • Dependabot switched to the uv ecosystem.
  • README commands updated.

Notes

  • CPU-only Linux users need --extra cpu on both uv sync and uv run; a plain uv run would re-sync to the default (CUDA) torch.
  • Python 3.10 on recent macOS: scipy 1.15.3 (the last supporting 3.10) fails to load, so 8 Lime/KernelShap tests fail locally. Pre-existing, unrelated to this change; Linux CI is unaffected.

Testing

uv run ruff check . clean, uv run pytest 141 passed (Python 3.12, macOS).

Installs resolved whatever versions were current that day, so two people
could not be sure they ran the same stack. The lockfile pins it, and
.python-version lets uv fetch a matching interpreter for anyone.

Dev tools move to a dependency group so they stay out of the published
package. The cpu extra routes torch to the CPU-only index for machines
that would otherwise download the CUDA runtime for nothing; the gpu
extra exists because uv only locks both builds when two extras are
declared as conflicting.
CI now tests exactly the locked versions, and --locked fails the build
when pyproject changes without a re-lock. --no-sync keeps uv run from
swapping the CPU torch back for the default build or switching away
from the matrix's Python.
@youssefassis
youssefassis enabled auto-merge (rebase) October 5, 2026 13:24
auto-merge was automatically disabled October 5, 2026 13:26

Branch protection rule check failed

@youssefassis
youssefassis merged commit 25cbbe5 into main Oct 5, 2026
5 checks passed
@youssefassis
youssefassis deleted the chore/uv-project branch October 5, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant