Skip to content

Migrate development workflow to uv lockfile - #2016

Open
wmcv wants to merge 10 commits into
lightly-ai:masterfrom
wmcv:issue-2015-dev-workflow
Open

Migrate development workflow to uv lockfile#2016
wmcv wants to merge 10 commits into
lightly-ai:masterfrom
wmcv:issue-2015-dev-workflow

Conversation

@wmcv

@wmcv wmcv commented Aug 4, 2026

Copy link
Copy Markdown

Fixes #2015

Summary

  • Move development dependencies to a uv dependency group
  • Add a reproducible uv.lock with the configured cutoff date
  • Add make lock
  • Run development commands through uv run --frozen
  • Update CONTRIBUTING.md and CLAUDE.md for the new workflow

Testing

  • make lock passes
  • make format-check passes
  • make type-check now completes and reports five existing type-checking errors in unrelated files
  • make install-minimal currently fails due to an existing NumPy 1.18.1/Python 3.12 compatibility issue

Comment thread CONTRIBUTING.md
Comment thread Makefile Outdated
deactivate || true
rm -rf .venv
uv venv .venv
uv sync --frozen --all-extras

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the same logic anymore. Previously it was:

  1. delete the venv
  2. create a new venv
    Now we're also installing all the dependencies (including extras). So this needs to be addressed.

Comment thread Makefile Outdated
Comment thread Makefile Outdated
Comment thread Makefile Outdated

@liopeer liopeer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work! I think I will have to take this over, since we will need to also fix a few things in the overall dependency handling. Might touch a bit too many things in the code base for a first contribution (but don't worry, once we merge the commits will still be associated with you as well!).

Comment thread Makefile Outdated
## build source and wheel package
dist: clean
python -m build
uv build

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check if that actually gives the same result.

Comment thread Makefile
Comment thread Makefile Outdated
# useful for local development.
# Install the package in non-editable mode in CI.
ifdef CI
EDITABLE=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think EDITABLE is not used anymore. Only NO_EDITABLE.

Comment thread Makefile Outdated
install-minimal-extras:
uv pip install --exclude-newer ${EXCLUDE_NEWER_DATE} ${EDITABLE} ".[dev]"
uv pip install --resolution=lowest-direct --exclude-newer ${EXCLUDE_NEWER_DATE} --reinstall ${EDITABLE} ".[matplotlib,minimal,timm,video]" --requirement pyproject.toml
uv sync --python=${MINIMAL_PYTHON_VERSION} --resolution=lowest-direct --exclude-newer ${EXCLUDE_NEWER_DATE} ${NO_EDITABLE} --group dev --extra matplotlib --extra minimal --extra timm --extra video --upgrade-group dev

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This currently does not properly work since we're not setting lower bounds for many packages.

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.

Mypy and numpy incompatible through make install-dev

2 participants