Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
➖ Remove bionty & lamindb from dependencies (#408)
Browse files Browse the repository at this point in the history
* 🔥 Remove bionty from dependencies

* ✏️ Typo

* 💚 Fix dependency

* 💚 Global fixture

* 🔥 Remove unnecessary duplication

* 💚 Fix
  • Loading branch information
falexwolf authored Jul 31, 2024
1 parent adb13e1 commit dccca96
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 30 deletions.
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ def test(session: nox.Session) -> None:
run(session, "uv pip install --system -e .[dev]")
run(
session,
"uv pip install --system lamindb[bionty]@git+https://github.com/laminlabs/lamindb",
"uv pip install --system lamindb_setup@git+https://github.com/laminlabs/lamindb-setup",
)
run_pytest(session, coverage=False)
9 changes: 9 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import lamindb_setup as ln_setup
import pytest


@pytest.fixture(scope="session")
def setup_instance():
ln_setup.init(storage="./testdb")
yield
ln_setup.delete("testdb", force=True)
11 changes: 2 additions & 9 deletions tests/test_integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
import pytest


@pytest.fixture(scope="module")
def setup_bionty_instance():
ln_setup.init(storage="./test-bionty-db", schema="bionty")
yield
ln_setup.delete("test-bionty-db", force=True)


def test_migrate_check(setup_bionty_instance):
def test_migrate_check(setup_instance):
assert ln_setup.migrate.check()


def test_system_check(setup_bionty_instance):
def test_system_check(setup_instance):
ln_setup.django("check")
26 changes: 6 additions & 20 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import re
import textwrap

import lamindb as ln

# The tests defined in this script use the lamindb instance defined in test_integrity


Expand All @@ -12,7 +10,9 @@ def _strip_ansi(text: str) -> str:
return ansi_escape.sub("", text)


def test_registry__repr__param():
def test_registry__repr__param(setup_instance):
import lnschema_core.models as ln

param = ln.Param
expected_repr = textwrap.dedent("""\
Param
Expand All @@ -33,7 +33,9 @@ def test_registry__repr__param():
assert actual_repr.strip() == expected_repr.strip()


def test_registry__repr__artifact():
def test_registry__repr__artifact(setup_instance):
import lnschema_core.models as ln

artifact = ln.Artifact
expected_repr = textwrap.dedent("""\
Artifact
Expand Down Expand Up @@ -72,22 +74,6 @@ def test_registry__repr__artifact():
.environment_of: Run
.collection: Collection
.collections: Collection
Bionty fields
.organisms: bionty.Organism
.genes: bionty.Gene
.proteins: bionty.Protein
.cell_markers: bionty.CellMarker
.tissues: bionty.Tissue
.cell_types: bionty.CellType
.diseases: bionty.Disease
.cell_lines: bionty.CellLine
.phenotypes: bionty.Phenotype
.pathways: bionty.Pathway
.experimental_factors: bionty.ExperimentalFactor
.developmental_stages: bionty.DevelopmentalStage
.ethnicities: bionty.Ethnicity
.reference_of_source: bionty.Source
.reference_of_sources: bionty.Source
""").strip()

actual_repr = _strip_ansi(repr(artifact))
Expand Down

0 comments on commit dccca96

Please sign in to comment.