Migrate from uv to Poetry 2.3#411
Merged
blink1073 merged 38 commits intoCalysto:mainfrom Mar 22, 2026
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
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
- Restore requires-python >= after minimum version pinning sed in test_minimum_versions - Skip GitHub release creation when no app_id provided (github.token lacks permission)
This was referenced Mar 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 topoetry-core; add[tool.poetry.group.test.dependencies]for local path deps; drop Python 3.10 support (follow SPEC 0); replace license classifier withlicensefield; addpoetry-coreto docs deps so ReadTheDocs sync doesn't remove itjustfile: replaceuvwithpoetry; refactorcover/test-allusing private_setupand_run-with-clusterhelpers; inline coverage reports as pytest args.pre-commit-config.yaml: replaceuv-lockwithpoetry-check(strict) andpoetry-lock.github/actions/base-setup/action.yml: replacesetup-uvwithsetup-python+pipx install poetry; add Poetry package cache; read default Python version fromrequires-pythoninpyproject.toml.github/actions/test-sdist/action.yml: simplify to runjust testfrom within unpacked sdist (just finds the root justfile).github/actions/test-minimum-versions/action.yml: new action — pins deps to minimum versions via sed, runspoetry lock, then runs test command.github/actions/release/action.yml: replaceuvwithpoetry; make app credentials optional (falls back togithub.tokenfor dry-run); addbump_dev.pyscript for dev version bumping; skip GitHub release creation when no app credentials.github/workflows/tests.yml: add dry-runtest_releasejob on same-repo PRs; use newtest-minimum-versionsaction.github/workflows/release.yml: usebase-setupaction; remove redundant setup steps.readthedocs.yaml: replace uv with Poetryscripts/run_notebooks.sh: replaceuv runwithpoetry runCONTRIBUTING.md: update prerequisite and usage docspoetry.lock: added;uv.lockremovedREADME.md: add SPEC 0 referenceBackwards-incompatible changes
Testing
just typingpasses with no errorspoetry-check --strictandpoetry-lock)AI usage