Skip to content

build(deps): add ot-literature as a git dependency#116

Merged
vivienho merged 2 commits into
vh-add-literaturefrom
do/pr113-add-literature-dep
May 13, 2026
Merged

build(deps): add ot-literature as a git dependency#116
vivienho merged 2 commits into
vh-add-literaturefrom
do/pr113-add-literature-dep

Conversation

@d0choa
Copy link
Copy Markdown
Contributor

@d0choa d0choa commented Apr 30, 2026

Summary

The new literature_* pyspark steps in #113 import from the literature package (e.g. from literature.dataset.match_mapped import MatchMapped), but no such dependency is declared. Without this, the steps fail at import time with ModuleNotFoundError. This PR adds ot-literature as a git dependency, mirroring the pattern used for clinical-mining.

Changes

  • pyproject.toml:
    • Add ot-literature to [project].dependencies
    • Add [tool.uv.sources] block pointing at opentargets/ot-literature, branch = "dev"
    • Map the distribution name ot-literature to the import name literature for deptry
  • uv.lock: a uv lock against dev is currently not possible (see below). The lockfile in this PR was generated against a temporary branch that has the same content as dev plus the pyspark fix; it will need to be regenerated against dev once the upstream blockers below are resolved.

Blockers on ot-literature dev

uv lock against branch = "dev" fails today:

× No solution found ...
  ot-literature==0.1.0 depends on pyspark==3.3.4
  pts depends on pyspark==3.5.7
  → unsatisfiable

In addition, even after the pyspark conflict is resolved, runtime imports will still fail because dev does not yet contain match_mapped.py (used by literature_cooccurrence). Both are tracked upstream:

  • pyspark conflict — ot-literature#7, targeting dev. Merging it removes the resolver conflict.
  • match_mapped etc. — currently only on the vh-restructure-datasets branch in ot-literature; needs to merge into dev for runtime imports to succeed.

Once both have landed on dev, run uv lock from this branch and force-push to refresh the lockfile.

Heads-up: transitive dev deps

ot-literature declares pytest and ipykernel in its top-level dependencies (rather than under a dev/optional group), so they will end up in pts's runtime closure. Pre-existing issue in ot-literature; out of scope here.

Test plan

  • Once ot-literature dev has both fixes, uv lock resolves cleanly and uv sync succeeds.
  • uv run pts -h succeeds.
  • uv run pts --step literature_publication (or similar) imports without ModuleNotFoundError.

d0choa added 2 commits April 30, 2026 13:56
The new literature_* pyspark steps import from the literature package, but no such dependency was declared. Add it as a git source so uv can resolve the import. Also map the ot-literature distribution name to the literature module name for deptry. The branch pin is temporary (see PR description); flip to vh-restructure-datasets once ot-literature#7 lands.
Per review preference, pin against ot-literature dev rather than the temporary do/bump-pyspark-3.5.7 branch. uv.lock is intentionally not regenerated here: dev currently has pyspark==3.3.4, which conflicts with pts pyspark==3.5.7, so resolution fails. Once the pyspark bump (ot-literature#7) and the match_mapped restructuring land on dev, re-run uv lock to refresh the lockfile against the dev SHA.
@vivienho vivienho merged commit 3246aba into vh-add-literature May 13, 2026
@vivienho vivienho deleted the do/pr113-add-literature-dep branch May 13, 2026 19:53
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.

2 participants