diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d665cd7..3cd66bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install package and dev dependencies - run: pip install -e ".[dev]" + - name: Install package with all dependencies + run: pip install -e ".[dev,analysis,viz,viz-interactive]" - name: Run tests run: python -m pytest tests/ -v --tb=short diff --git a/pyproject.toml b/pyproject.toml index 877689a..d1de699 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ dependencies = [ "pyshacl>=0.25", "owlrl>=6.0", "pandas>=2.0", + "pyyaml>=6.0", ] [project.optional-dependencies] diff --git a/tests/test_analysis.py b/tests/test_analysis.py index 658e487..e57c1d5 100644 --- a/tests/test_analysis.py +++ b/tests/test_analysis.py @@ -11,7 +11,10 @@ """ import pytest -import numpy as np + +np = pytest.importorskip("numpy") +scipy = pytest.importorskip("scipy") + from numpy.testing import assert_allclose from knowledgecomplex.schema import SchemaBuilder, vocab diff --git a/tests/test_partition.py b/tests/test_partition.py index 9be1735..ace934a 100644 --- a/tests/test_partition.py +++ b/tests/test_partition.py @@ -12,7 +12,10 @@ """ import pytest -import numpy as np + +np = pytest.importorskip("numpy") +scipy = pytest.importorskip("scipy") + from numpy.testing import assert_allclose from knowledgecomplex.schema import SchemaBuilder, vocab diff --git a/tests/test_stress.py b/tests/test_stress.py index 24fe5c2..c201bbb 100644 --- a/tests/test_stress.py +++ b/tests/test_stress.py @@ -255,6 +255,7 @@ def test_from_function_all_same_value(self): class TestAnalysisEdgeCases: def test_betti_single_vertex(self): + pytest.importorskip("scipy") from knowledgecomplex.analysis import betti_numbers sb = SchemaBuilder(namespace="test") sb.add_vertex_type("N") @@ -263,6 +264,7 @@ def test_betti_single_vertex(self): assert betti_numbers(kc) == [1, 0, 0] def test_betti_no_elements(self): + pytest.importorskip("scipy") from knowledgecomplex.analysis import betti_numbers sb = SchemaBuilder(namespace="test") sb.add_vertex_type("N") @@ -270,6 +272,7 @@ def test_betti_no_elements(self): assert betti_numbers(kc) == [0, 0, 0] def test_boundary_matrices_vertices_only(self): + pytest.importorskip("scipy") from knowledgecomplex.analysis import boundary_matrices sb = SchemaBuilder(namespace="test") sb.add_vertex_type("N") diff --git a/tests/test_topology.py b/tests/test_topology.py index 2a20b8e..438a1e4 100644 --- a/tests/test_topology.py +++ b/tests/test_topology.py @@ -1,4 +1,4 @@ -""" +r""" tests/test_topology.py Tests for topological query methods on KnowledgeComplex: diff --git a/uv.lock b/uv.lock index 3df45d5..3bc2200 100644 --- a/uv.lock +++ b/uv.lock @@ -584,6 +584,7 @@ dependencies = [ { name = "owlrl" }, { name = "pandas" }, { name = "pyshacl" }, + { name = "pyyaml" }, { name = "rdflib" }, ] @@ -628,6 +629,7 @@ requires-dist = [ { name = "pyshacl", specifier = ">=0.25" }, { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0" }, { name = "pytest-cov", marker = "extra == 'dev'" }, + { name = "pyyaml", specifier = ">=6.0" }, { name = "rdflib", specifier = ">=7.0" }, { name = "ruff", marker = "extra == 'dev'" }, { name = "scipy", marker = "extra == 'analysis'", specifier = ">=1.10" },