Skip to content

Commit 3794604

Browse files
authored
Merge pull request #75 from VectorInstitute/kwaak/check-imports-core-only-0f963b0c
Add import tests and workflow job for core dependencies only
2 parents 4003f71 + ef5ad7c commit 3794604

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/workflows/unit_tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ jobs:
6464
run: |
6565
uv run pytest -m "not integration_test" --cov vec_inf --cov-report=xml tests
6666
67-
# Uncomment this once this repo is configured on Codecov
67+
- name: Install the core package only
68+
run: uv sync --no-dev
69+
70+
- name: Run package import tests
71+
run: |
72+
uv run pytest tests/test_imports.py
73+
6874
- name: Upload coverage to Codecov
6975
uses: codecov/codecov-action@v5.4.0
7076
with:

tests/test_imports.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Test the imports of the vec_inf package."""
2+
3+
import unittest
4+
5+
6+
class TestVecInfImports(unittest.TestCase):
7+
"""Test the imports of the vec_inf package."""
8+
9+
def test_import_cli_modules(self):
10+
"""Test the imports of the vec_inf.cli modules."""
11+
try:
12+
import vec_inf.cli._cli
13+
import vec_inf.cli._config
14+
import vec_inf.cli._helper
15+
import vec_inf.cli._utils # noqa: F401
16+
except ImportError as e:
17+
self.fail(f"Import failed: {e}")

0 commit comments

Comments
 (0)