Adopt uv for Python Package Management
Related: smartem-decisions#212 (Docker rework - separate scope)
Summary
Migrate smartem-decisions CI/CD and developer tooling from pip to uv. The repo already has uv.lock and release-smartem-decisions.yml uses uv - this work standardizes all workflows.
Note: smartem-devtools already fully adopted uv (no changes needed).
Design Decisions
| Decision |
Choice |
Rationale |
install_requirements action |
Eliminate |
uv handles everything better with astral-sh/setup-uv@v7 |
| Tox |
Eliminate |
Replace with direct uv run pytest/ruff/pyright |
| Pre-commit ruff hooks |
Official ruff-pre-commit repo |
Portable, auto-updates, no uv dependency for pre-commit |
| Windows builds (PyInstaller) |
Keep pip |
PyInstaller compatibility concerns |
| Dockerfile |
Defer to #212 |
Docker rework is separate scope - will use uv there |
Implementation
Phase 1: CI Workflow Migration
1.1 Update _test.yml
File: .github/workflows/_test.yml
Replace pip+tox with uv:
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
run: uv python install ${{ inputs.python-version }}
- name: Install dependencies
run: uv sync --extra all
- name: Run tests
run: uv run pytest --cov --cov-report=xml
1.2 Update _schema_drift.yml
File: .github/workflows/_schema_drift.yml
Replace pip install -e .[all] with uv sync --extra all.
1.3 Update _dist.yml
File: .github/workflows/_dist.yml
Replace pipx run build with uv build, pipx run twine with uvx twine.
Phase 2: Remove Obsolete Files
- Delete:
.github/actions/install_requirements/ - obsolete with uv
- Delete:
.github/workflows/_tox.yml - tox is being removed
Phase 3: Configuration Updates
3.1 Update pre-commit config
File: .pre-commit-config.yaml
Replace local ruff hooks (lines 28-42):
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
args: [--force-exclude]
- id: ruff-format
args: [--force-exclude]
3.2 Update pyproject.toml
File: pyproject.toml
- Remove
tox-direct from dev dependencies
- Remove entire
[tool.tox] section
Phase 4: Documentation Updates
4.1 REPO-GUIDELINES.md
File: claude-config/smartem-decisions/REPO-GUIDELINES.md
Update commands:
| Current |
New |
pip install -e .[all] |
uv sync --extra all |
pytest |
uv run pytest |
ruff check |
uv run ruff check |
pyright |
uv run pyright |
4.2 for-developers.md
File: smartem-devtools/docs/getting-started/for-developers.md
Update installation instructions to use uv as primary method.
4.3 tools.md
File: smartem-devtools/docs/development/tools.md
Prefix tool commands with uv run.
Files Summary
Modify
| File |
Change |
.github/workflows/_test.yml |
pip+tox → uv |
.github/workflows/_schema_drift.yml |
pip → uv |
.github/workflows/_dist.yml |
pipx → uv/uvx |
.pre-commit-config.yaml |
local ruff → official ruff-pre-commit |
pyproject.toml |
Remove tox config |
REPO-GUIDELINES.md |
Update commands |
for-developers.md |
Update install docs |
tools.md |
Add uv run prefixes |
Delete
| File |
Reason |
.github/actions/install_requirements/ |
Obsolete |
.github/workflows/_tox.yml |
Obsolete |
Keep Unchanged
| File |
Reason |
release-smartem-decisions.yml |
Already uses uv |
build_win_smartem_agent.yml |
Keep pip for PyInstaller |
uv.lock |
Already exists |
Dockerfile |
Defer to #212 |
Verification
uv sync --extra all - dependencies install correctly
uv run pytest - tests pass
uv run ruff check src tests - linting works
uv run pyright src tests - type checking works
pre-commit run --all-files - hooks pass
- CI workflows pass on push to branch
Out of Scope
- Dockerfile: Separate issue #212 (rework Docker to install from PyPI)
- fandanGO-cryoem-dls: Requires coordination with upstream maintainers
- FragmentScreen repos: Read-only, conda-based
- smartem-devtools: Already fully adopted uv
Tasks
Adopt uv for Python Package Management
Related: smartem-decisions#212 (Docker rework - separate scope)
Summary
Migrate smartem-decisions CI/CD and developer tooling from pip to uv. The repo already has
uv.lockandrelease-smartem-decisions.ymluses uv - this work standardizes all workflows.Note: smartem-devtools already fully adopted uv (no changes needed).
Design Decisions
install_requirementsactionastral-sh/setup-uv@v7uv run pytest/ruff/pyrightImplementation
Phase 1: CI Workflow Migration
1.1 Update
_test.ymlFile:
.github/workflows/_test.ymlReplace pip+tox with uv:
1.2 Update
_schema_drift.ymlFile:
.github/workflows/_schema_drift.ymlReplace
pip install -e .[all]withuv sync --extra all.1.3 Update
_dist.ymlFile:
.github/workflows/_dist.ymlReplace
pipx run buildwithuv build,pipx run twinewithuvx twine.Phase 2: Remove Obsolete Files
.github/actions/install_requirements/- obsolete with uv.github/workflows/_tox.yml- tox is being removedPhase 3: Configuration Updates
3.1 Update pre-commit config
File:
.pre-commit-config.yamlReplace local ruff hooks (lines 28-42):
3.2 Update pyproject.toml
File:
pyproject.tomltox-directfrom dev dependencies[tool.tox]sectionPhase 4: Documentation Updates
4.1 REPO-GUIDELINES.md
File:
claude-config/smartem-decisions/REPO-GUIDELINES.mdUpdate commands:
pip install -e .[all]uv sync --extra allpytestuv run pytestruff checkuv run ruff checkpyrightuv run pyright4.2 for-developers.md
File:
smartem-devtools/docs/getting-started/for-developers.mdUpdate installation instructions to use uv as primary method.
4.3 tools.md
File:
smartem-devtools/docs/development/tools.mdPrefix tool commands with
uv run.Files Summary
Modify
.github/workflows/_test.yml.github/workflows/_schema_drift.yml.github/workflows/_dist.yml.pre-commit-config.yamlpyproject.tomlREPO-GUIDELINES.mdfor-developers.mdtools.mdDelete
.github/actions/install_requirements/.github/workflows/_tox.ymlKeep Unchanged
release-smartem-decisions.ymlbuild_win_smartem_agent.ymluv.lockDockerfileVerification
uv sync --extra all- dependencies install correctlyuv run pytest- tests passuv run ruff check src tests- linting worksuv run pyright src tests- type checking workspre-commit run --all-files- hooks passOut of Scope
Tasks
_test.ymlto use uv instead of pip+tox_schema_drift.ymlto use uv_dist.ymlto use uv build/uvx twine.github/actions/install_requirements/action.pre-commit-config.yamlto use official ruff-pre-commitpyproject.toml