Skip to content

chore: drop the unused geneweaver-testing dependency - #34

Open
belkassaby wants to merge 1 commit into
feat/G3-750-tools-asynctask-plugin-readinessfrom
chore/remove-unused-geneweaver-testing-dependency
Open

belkassaby wants to merge 1 commit into
feat/G3-750-tools-asynctask-plugin-readinessfrom
chore/remove-unused-geneweaver-testing-dependency

Conversation

@belkassaby

@belkassaby belkassaby commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #32. This PR's base is feat/G3-750-tools-asynctask-plugin-readiness, not main, so the diff shows only this change. Merge #32 first; GitHub will retarget this to main automatically when it does.

Rebased onto #32 rather than onto main because both touch pyproject.toml and uv.lock. They merged without conflict (different regions of the file), and uv lock --check confirms the combined lockfile resolves — 178 packages, no drift. The full suite passes on the combined state: root 355, core 48057, db 55886, client 6331, tools 115.

Summary

geneweaver-testing contributed zero tests to this repository while constraining the whole workspace. This removes it, and keeps the one assertion from it that was worth having.

It was doing nothing — verified, not assumed

The package ships seven session-scoped pytest fixtures plus prebuilt test suites. Four conftests wildcard-imported the fixtures (packages/{tools,core,db,client}), but:

  • no test requested any of the seven fixtures, and they are not autouse, so none ever executed;
  • the prebuilt suites were never imported, so it added no tests.

Deleting the imports leaves every suite byte-identical:

Suite Before After
core 48057 passed, 2 skipped, 1 xfailed identical
db 55886 passed identical
client 6331 passed, 8 skipped identical
tools 76 passed identical
root 343 passed, 21 skipped 355 passed, 21 skipped (+12 new)

It was also already broken here. package_name_from_pyproject reads pyproject_toml_contents["tool"]["poetry"]["name"]; this workspace is PEP 621 + uv_build, so it would KeyError if requested. That is why packages/tools/tests/unit/conftest.py hardcoded a package_submodule_name override — a workaround for a fixture chain that cannot read this repo's pyproject.toml.

What it cost

geneweaver-testing 0.1.2 requires black<25, isort<6, mypy<2, pytest<9, pytest-cov<5, radon<7, ruff>=0.2.2,<0.3, tomli<3. So one unused dependency was:

  • forcing the [tool.uv] override-dependencies = ["ruff==0.15.11"] block — nothing else in the workspace pins ruff, so that hack existed solely for this;
  • capping pytest<9 and pytest-cov<5 workspace-wide (only pytest>=7.1.3 floors remain now);
  • pulling in black, mypy, radon and tomli, none of which our code imports and none of which CI uses — _format-lint-action.yml runs ruff check and ruff format --check, not black.

Removal drops 8 packages and 233 lines of uv.lock.

What is kept: tests/test_namespace_integrity.py

Of ~34 prebuilt test functions, one assertion was worth keeping, and it matters more here than it did upstream.

geneweaver is a PEP 420 namespace package shared by five first-party distributions — geneweaver.api (root) plus core, db, client, tools. A stray src/geneweaver/__init__.py in any one of them turns that portion into a regular package and shadows the others: the offender keeps importing while the rest silently stop resolving, and the symptom surfaces far from the cause.

I verified the guard catches it by adding packages/core/src/geneweaver/__init__.py:

FAILED test_geneweaver_portion_is_not_a_regular_package[packages/core/src]
FAILED test_geneweaver_is_a_namespace_package
FAILED test_first_party_subpackage_is_importable[api]
FAILED test_first_party_subpackage_is_importable[db]
FAILED test_first_party_subpackage_is_importable[client]
FAILED test_first_party_subpackage_is_importable[tools]

core stayed importable; the other four raised ModuleNotFoundError. Upstream's version guarded one package — this covers all five, globs packages/*/src so new packages are included without editing the file, and anchors paths to Path(__file__) rather than pytest's rootdir, which shifts because CI runs the root suite from the repo root and each package suite from inside its own directory. That fragility is what made the upstream fixtures unusable.

What was deliberately not kept

  • ~17 pyproject tests asserting [tool.poetry], poetry-core, poetry.masonry.api and packages = [{from = "src"}] — this repo is PEP 621 + uv_build, so they would fail, not help. The version-consistency job already in pull_requests.yml is the useful descendant.
  • 14 ruff-config tests asserting [tool.ruff] select holds exactly 14 rules and the section has no other keys. Ruff is configured in a top-level ruff.toml here and modern ruff uses [tool.ruff.lint]; these encode a 2023 house style as a hard assertion.
  • 4 style tests that subprocess.run(["ruff", "check", "src"]) inside pytest — CI already does this properly, and black is not used by this repo.
  • 5 generic structure tests (has src/, tests/, README, LICENSE, CONTRIBUTING) — true by construction; a missing LICENSE is a release concern, not a unit test.

Also in here

  • Deletes packages/db/tests/conftest.py and packages/tools/tests/unit/conftest.py, both of which had no remaining content once the import and the dead override were gone. core's and client's conftests keep their own real fixtures.
  • Updates AGENTS.md, which still said poetry install / poetry run uvicorn and black src tests. Per the repo guardrail about updating setup notes when touching that area — and black is no longer installed after this change.

Verification

pytest tests                                            # 355 passed, 21 skipped
(cd packages/core   && pytest tests/unit)               # 48057 passed
(cd packages/db     && pytest tests/unit)               # 55886 passed
(cd packages/client && pytest tests/unit)               # 6331 passed
(cd packages/tools  && pytest tests/unit)               # 76 passed
ruff check src/ tests/ && ruff format --check src/ tests/   # clean

Note on conflicts

Based on main as requested. It touches pyproject.toml and uv.lock, so it will conflict with #32 (which adds geneweaver-tools to the dependency list). Whichever merges second needs a trivial rebase — the two edits are in different parts of the file.

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Test Coverage Report

============================= test session starts ==============================
platform linux -- Python 3.11.16, pytest-8.4.2, pluggy-1.6.0
rootdir: /home/runner/work/geneweaver/geneweaver
configfile: pyproject.toml
plugins: asyncio-1.3.0, cov-4.1.0, anyio-4.13.0
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 376 items

tests/controllers/test_api_standards.py ................................ [  8%]
........................................................................ [ 27%]
.sssssssssssssssssssss                                                   [ 33%]
tests/controllers/test_genes.py .............                            [ 36%]
tests/controllers/test_genesets.py ..................................... [ 46%]
......................                                                   [ 52%]
tests/controllers/test_monitor.py .                                      [ 52%]
tests/controllers/test_publications.py ........                          [ 55%]
tests/controllers/test_return_schemas.py .                               [ 55%]
tests/controllers/test_search.py ..                                      [ 55%]
tests/controllers/test_species.py ....                                   [ 56%]
tests/core/test_security.py ..........                                   [ 59%]
tests/services/io/test_read_file_contents.py ...............             [ 63%]
tests/services/test_gene.py ..............                               [ 67%]
tests/services/test_genset.py .......................................... [ 78%]
.................................................                        [ 91%]
tests/services/test_monitors.py ..                                       [ 92%]
tests/services/test_ontology.py ....                                     [ 93%]
tests/services/test_publications.py .......                              [ 94%]
tests/services/test_species.py .......                                   [ 96%]
tests/test_namespace_integrity.py ............                           [100%]

=============================== warnings summary ===============================
tests/data/__init__.py:10
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:10: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    geneset_response_json = importlib.resources.read_text("tests.data", "response_geneset_1234.json")

../../../../../opt/hostedtoolcache/Python/3.11.16/x64/lib/python3.11/importlib/resources/_legacy.py:80: 11 warnings
  /opt/hostedtoolcache/Python/3.11.16/x64/lib/python3.11/importlib/resources/_legacy.py:80: DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    with open_text(package, resource, encoding, errors) as fp:

tests/data/__init__.py:11
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:11: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    geneset_w_gene_id_type_json = importlib.resources.read_text(

tests/data/__init__.py:15
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:15: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    geneset_list_response_json = importlib.resources.read_text("tests.data", "geneset.json")

tests/data/__init__.py:17
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:17: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    gene_homologus_ids_json = importlib.resources.read_text("tests.data", "homologus_ids.json")

tests/data/__init__.py:19
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:19: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    gene_id_mapping_json = importlib.resources.read_text("tests.data", "gene_maping.json")

tests/data/__init__.py:21
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:21: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    publications_json = importlib.resources.read_text("tests.data", "publications.json")

tests/data/__init__.py:23
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:23: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    jwt_test_keys_json = importlib.resources.read_text("tests.data", "security_jwt_RS256_keys.json")

tests/data/__init__.py:25
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:25: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    species_json = importlib.resources.read_text("tests.data", "species.json")

tests/data/__init__.py:27
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:27: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    genes_json = importlib.resources.read_text("tests.data", "genes.json")

tests/data/__init__.py:29
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:29: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    monitors_json = importlib.resources.read_text("tests.data", "monitors.json")

tests/data/__init__.py:31
  /home/runner/work/geneweaver/geneweaver/tests/data/__init__.py:31: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    ontology_json = importlib.resources.read_text("tests.data", "ontology.json")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

---------- coverage: platform linux, python 3.11.16-final-0 ----------
Name                                            Stmts   Miss  Cover
-------------------------------------------------------------------
src/geneweaver/api/__init__.py                      5      2    60%
src/geneweaver/api/controller/__init__.py           0      0   100%
src/geneweaver/api/controller/api.py               14      0   100%
src/geneweaver/api/controller/genes.py             38      0   100%
src/geneweaver/api/controller/genesets.py          97      4    96%
src/geneweaver/api/controller/message.py           27      0   100%
src/geneweaver/api/controller/monitors.py          15      0   100%
src/geneweaver/api/controller/publications.py      34      0   100%
src/geneweaver/api/controller/search.py            20      0   100%
src/geneweaver/api/controller/species.py           16      0   100%
src/geneweaver/api/controller/utilities.py          9      0   100%
src/geneweaver/api/core/__init__.py                 0      0   100%
src/geneweaver/api/core/config.py                   2      0   100%
src/geneweaver/api/core/config_class.py            30      0   100%
src/geneweaver/api/core/exceptions.py              13      1    92%
src/geneweaver/api/core/security.py               120     20    83%
src/geneweaver/api/dependencies.py                 59     28    53%
src/geneweaver/api/main.py                          1      0   100%
src/geneweaver/api/schemas/__init__.py              0      0   100%
src/geneweaver/api/schemas/apimodels.py            62      6    90%
src/geneweaver/api/schemas/auth.py                 17      0   100%
src/geneweaver/api/schemas/messages.py             15     15     0%
src/geneweaver/api/schemas/score.py                12     12     0%
src/geneweaver/api/schemas/search.py               18      0   100%
src/geneweaver/api/services/__init__.py             0      0   100%
src/geneweaver/api/services/genes.py               45      0   100%
src/geneweaver/api/services/geneset.py            184      5    97%
src/geneweaver/api/services/io.py                   4      0   100%
src/geneweaver/api/services/monitors.py            10      0   100%
src/geneweaver/api/services/parse/__init__.py       0      0   100%
src/geneweaver/api/services/publications.py        46      0   100%
src/geneweaver/api/services/pubmeds.py              0      0   100%
src/geneweaver/api/services/species.py             17      0   100%
-------------------------------------------------------------------
TOTAL                                             930     93    90%
Coverage HTML written to dir htmlcov

================= 355 passed, 21 skipped, 22 warnings in 5.73s =================

@belkassaby
belkassaby requested a deployment to jax-cluster-dev-10--dev September 23, 2026 16:28 — with GitHub Actions Waiting
@belkassaby
belkassaby requested a deployment to jax-cluster-dev-10--dev September 23, 2026 19:29 — with GitHub Actions Waiting
@belkassaby
belkassaby force-pushed the chore/remove-unused-geneweaver-testing-dependency branch from fed9f93 to 6d1a47e Compare September 23, 2026 19:29
`geneweaver-testing` contributed nothing to this repository but constrained the
whole workspace.

It ships seven session-scoped pytest fixtures plus prebuilt test suites. Four
conftests wildcard-imported the fixtures, but no test requested any of them, and
the prebuilt suites were never imported at all -- so it added zero tests. The
fixtures are not autouse, so nothing ever executed. Removing the imports leaves
every suite byte-identical: core 48057, db 55886, client 6331, tools 76.

It was also already broken here. `package_name_from_pyproject` reads
`["tool"]["poetry"]["name"]`, and this workspace is PEP 621 + uv_build, so it
would KeyError if requested. That is why the tools conftest hardcoded a
`package_submodule_name` override -- a workaround for a fixture chain that
cannot read this repo's pyproject.

What it cost: it pinned `ruff>=0.2.2,<0.3`, which forced the
`[tool.uv] override-dependencies` block (nothing else pins ruff); it capped
`pytest<9` and `pytest-cov<5` workspace-wide; and it pulled in black, mypy,
radon and tomli, none of which our code imports and none of which CI uses --
CI lints with ruff only. Removing it drops 8 packages and 233 lines of lockfile.

Replaces the one assertion worth keeping, as `tests/test_namespace_integrity.py`.
`geneweaver` is a PEP 420 namespace package shared by five distributions, and a
stray `src/geneweaver/__init__.py` in any one of them shadows the rest: verified
by adding one to packages/core, which left core importable while api, db, client
and tools all raised ModuleNotFoundError. The upstream check covered a single
package; this covers all five, globs for new ones, and anchors paths to the file
rather than pytest's rootdir -- which shifts because CI runs the root suite from
the repo root and each package suite from its own directory.

Also deletes two conftests left with no content, and updates the AGENTS.md setup
and lint commands, which still said `poetry install` and `black src tests` --
black is no longer installed after this change.
@belkassaby
belkassaby force-pushed the chore/remove-unused-geneweaver-testing-dependency branch from 6d1a47e to f79d493 Compare September 23, 2026 19:35
@belkassaby
belkassaby changed the base branch from main to feat/G3-750-tools-asynctask-plugin-readiness September 23, 2026 19:35
@belkassaby
belkassaby requested a deployment to jax-cluster-dev-10--dev September 23, 2026 19:42 — with GitHub Actions Waiting

This branch is waiting to be deployed

1 waiting deployment
jax-cluster-dev-10--dev — f79d4938 Waiting Sep 23, 2026 by belkassaby via Deploy: Dev / deploy #38
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