Skip to content

Migrate from uv to Poetry 2.3#411

Merged
blink1073 merged 38 commits intoCalysto:mainfrom
blink1073:convert-to-poetry
Mar 22, 2026
Merged

Migrate from uv to Poetry 2.3#411
blink1073 merged 38 commits intoCalysto:mainfrom
blink1073:convert-to-poetry

Conversation

@blink1073
Copy link
Contributor

@blink1073 blink1073 commented Mar 21, 2026

References

Description

Replaces uv with Poetry 2.3 as the package manager across all project tooling. This covers the build backend, CI workflows, pre-commit hooks, ReadTheDocs, and development scripts.

Changes

  • pyproject.toml: switch build backend to poetry-core; add [tool.poetry.group.test.dependencies] for local path deps; drop Python 3.10 support (follow SPEC 0); replace license classifier with license field; add poetry-core to docs deps so ReadTheDocs sync doesn't remove it
  • justfile: replace uv with poetry; refactor cover/test-all using private _setup and _run-with-cluster helpers; inline coverage reports as pytest args
  • .pre-commit-config.yaml: replace uv-lock with poetry-check (strict) and poetry-lock
  • .github/actions/base-setup/action.yml: replace setup-uv with setup-python + pipx install poetry; add Poetry package cache; read default Python version from requires-python in pyproject.toml
  • .github/actions/test-sdist/action.yml: simplify to run just test from within unpacked sdist (just finds the root justfile)
  • .github/actions/test-minimum-versions/action.yml: new action — pins deps to minimum versions via sed, runs poetry lock, then runs test command
  • .github/actions/release/action.yml: replace uv with poetry; make app credentials optional (falls back to github.token for dry-run); add bump_dev.py script for dev version bumping; skip GitHub release creation when no app credentials
  • .github/workflows/tests.yml: add dry-run test_release job on same-repo PRs; use new test-minimum-versions action
  • .github/workflows/release.yml: use base-setup action; remove redundant setup steps
  • .readthedocs.yaml: replace uv with Poetry
  • scripts/run_notebooks.sh: replace uv run with poetry run
  • CONTRIBUTING.md: update prerequisite and usage docs
  • poetry.lock: added; uv.lock removed
  • README.md: add SPEC 0 reference

Backwards-incompatible changes

  • Python 3.10 is no longer supported (minimum is now 3.11, per SPEC 0)

Testing

  • just typing passes with no errors
  • All pre-commit hooks pass (including poetry-check --strict and poetry-lock)
  • CI passing on the branch

AI usage

  • Some or all of the content of this PR was generated by AI.
  • The human author has carefully reviewed this PR and run this code.
  • AI tools and models used: Claude Sonnet 4.6 (Claude Code)

Replace uv with Poetry 2.3 as the package manager across all tooling:
build system, CI, pre-commit, ReadTheDocs, and development scripts.
Add a shared script that starts ipcluster with N engines and polls
until all engines are ready, replacing the inline race-prone background
start in justfile recipes and run_notebooks.sh.
- Use shebang recipes for test-all and cover so ipcluster runs in the
  same bash process as pytest and survives between steps
- Install metakernel_echo and metakernel_python kernel specs to
  sys-prefix in run_notebooks.sh (editable installs skip hatchling's
  shared-data hook)
- Set poetry config virtualenvs.create false in .readthedocs.yaml so
  Poetry installs into RTD's active venv instead of recreating its own
…or kernel specs

- Add kernel_json class attribute to MetaKernelEcho and MetaKernelPython
  so python -m <kernel> install works via MetaKernelApp
- Update hatch_build.py files to import kernel_json from the class
- Use python -m metakernel_{echo,python} install --sys-prefix in
  run_notebooks.sh instead of pointing to data_kernelspec paths
- Install kernel specs before running tests in justfile (test, test-all, cover)
- Use just test in test_minimum_versions CI job
Importing kernel_json from the kernel class during the hatchling build
hook fails because metakernel is not available in pip's build sandbox.
@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.30%. Comparing base (f82aaef) to head (59dee72).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #411      +/-   ##
==========================================
+ Coverage   90.29%   90.30%   +0.01%     
==========================================
  Files          51       51              
  Lines        2946     2950       +4     
  Branches      414      414              
==========================================
+ Hits         2660     2664       +4     
  Misses        209      209              
  Partials       77       77              
Files with missing lines Coverage Δ
metakernel/magics/parallel_magic.py 98.77% <100.00%> (+0.03%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Makes it easier to debug why Client() is failing to connect.
poetry run in sdist_unpack/ was creating a fresh venv that didn't have
test deps installed, and the metakernel_python path dep doesn't exist
inside the unpacked sdist. Install deps in the repo root and invoke
pytest via the venv's bin path instead.
Prevents the cover job's venv (which includes ipyparallel via test-all)
from being reused by the test job, which would cause parallel magic
tests to run without a cluster and fail.
- tests/ included in sdist so test-sdist can run from the unpacked source
- data_kernelspec/ included in wheel for kernel spec installation
Caching the venv caused cross-job contamination (e.g. cover job's venv
with ipyparallel being reused by the test job). Caching only the
downloaded wheels lets each job build a clean venv from scratch while
still benefiting from fast package resolution.
- Add poetry-core to docs dependency group so poetry sync --only main,docs
  does not remove it from the ReadTheDocs build environment, fixing the
  ModuleNotFoundError that crashed the editable install step
- Constrain IPython>=9.0 on Python>=3.11 in the test group to avoid
  SyntaxError in IPython<9.0 on Python 3.14 ('return' in 'finally' block)
- Bump requires-python to >=3.11 and drop 3.10 classifier
- Remove python marker from IPython>=9.0 constraint (now always applies)
- Read default Python version from pyproject.toml requires-python in base-setup
- Add SPEC 0 note to README
@blink1073 blink1073 merged commit f5e7e86 into Calysto:main Mar 22, 2026
24 checks passed
@blink1073 blink1073 deleted the convert-to-poetry branch March 22, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant