Repository navigation
feat: make dask optional so osw imports without it - #219
Merged
Merged
Conversation
- move dask into a new `parallel` extra and import it lazily. util.py is imported unconditionally by core, wtsite and wiki_tools, so a missing dask broke `import osw` outright - which ruled out Pyodide, where there is no dask build. - only async_parallelize (WIP, no callers in the package) and the __main__ demo helpers use it, so no public behaviour changes. - requires-python stays <3.14 on purpose: pydantic reports "Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater", and osw, oold and opensemantic all build on pydantic.v1. Verified - 3.14 raises ConfigError on the first opensemantic model, 3.13 is fine. - verified: `import osw` with dask absent on 3.12 and 3.13, and in a Pyodide 3.13 kernel; suite unchanged vs origin/main (704 passed, same pre-existing 6 failures / 47 click-version errors before and after).
Contributor
Release previewMerging this PR would release v2.9.0 (current: Changelog preview (truncated)## v2.9.0 (2026-11-05)
### Bug Fixes
- Tell ty the dask imports are allowed to be unresolvable
([`fa103f1`](https://github.com/OpenSemanticLab/osw-python/commit/fa103f12f8f89410ffe212f45f0eaa208efe6f6b))
### Chores
- Relock after moving dask to the parallel extra
([`3fe98e4`](https://github.com/OpenSemanticLab/osw-python/commit/3fe98e484d575a10031090a3206119806643c82e))
### Code Style
- Order the __main__ demo imports as ruff wants
([`cd8b804`](https://github.com/OpenSemanticLab/osw-python/commit/cd8b8047cd4e7fa3073ab2860ac2a702142943cc))
### Features
- Make dask optional so osw imports without it
([`1f1232a`](https://github.com/OpenSemanticLab/osw-python/commit/1f1232a2c2a87b5cf22dc996b6eaa3311b732e51))
Preview via python-semantic-release and conventional commits. |
Stdlib before third party inside the block; the comment stays with the dask imports it explains. Caught by the quality job, not locally.
make check runs `uv lock --locked`, which fails on any pyproject change that the lockfile has not seen. Diff kept to the dask move: re-locking also pruned some zensical wheel urls, and --locked passes with those left alone, so they stay.
dask is the parallel extra, so uv sync --frozen does not install it and ty cannot resolve it. Suppressed at all four sites rather than added to the dev group: that is what pyproject does for mcp, but it would install dask into every job to type check the one function allowed to run without it.
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.
parallelextra and import it lazily. util.py is imported unconditionally by core, wtsite and wiki_tools, so a missing dask brokeimport oswoutright - which ruled out Pyodide, where there is no dask build.import oswwith dask absent on 3.12 and 3.13, and in a Pyodide 3.13 kernel; suite unchanged vs origin/main (704 passed, same pre-existing 6 failures / 47 click-version errors before and after).