Skip to content

feat: make dask optional so osw imports without it - #219

Merged
simontaurus merged 4 commits into
mainfrom
feat/pyodide-support
Nov 5, 2026
Merged

simontaurus merged 4 commits into
mainfrom
feat/pyodide-support

Conversation

@simontaurus

Copy link
Copy Markdown
Contributor
  • 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).

- 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).
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Release preview

Merging this PR would release v2.9.0 (current: v2.8.2).

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.
@simontaurus
simontaurus merged commit 897df83 into main Nov 5, 2026
11 of 12 checks passed
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.

1 participant