diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f2ba00..2255507 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,6 +13,15 @@ repos: - id: ruff args: ['--fix'] - id: ruff-format + - repo: local + hooks: + - id: mypy + name: mypy + entry: mypy + language: system + types: [python] + pass_filenames: false + args: ["src"] - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.44.0 hooks: diff --git a/README.md b/README.md index 740db48..206c778 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # terra-python -Altissimo Python client for terra-python. +Altissimo Python client for the [Broad Institute's Terra](https://terra.bio/) genomics +platform. + +This package is currently early-stage scaffolding: the namespace package, +build, lint, type-check, and pre-commit tooling are wired up, but no client +functionality has been implemented yet. diff --git a/pyproject.toml b/pyproject.toml index d23122f..5427465 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "terra-python" version = "0.1.0" -description = "Altissimo Python client for terra-python" +description = "Altissimo Python client for the Broad Institute's Terra genomics platform (not yet implemented)" readme = "README.md" license = "Apache-2.0" requires-python = ">=3.11" diff --git a/src/altissimo/terra/__init__.py b/src/altissimo/terra/__init__.py index d64eddd..77215db 100644 --- a/src/altissimo/terra/__init__.py +++ b/src/altissimo/terra/__init__.py @@ -2,4 +2,11 @@ from __future__ import annotations -__all__: list[str] = [] +from importlib.metadata import PackageNotFoundError, version + +try: + __version__ = version("terra-python") +except PackageNotFoundError: # pragma: no cover — editable install without metadata + __version__ = "0.1.0" + +__all__: list[str] = ["__version__"] diff --git a/tests/test_init.py b/tests/test_init.py new file mode 100644 index 0000000..26d2cbf --- /dev/null +++ b/tests/test_init.py @@ -0,0 +1,19 @@ +"""Tests for the altissimo.terra public API surface.""" + +from __future__ import annotations + + +class TestPublicAPI: + """Verify that the public API is importable and consistent.""" + + def test_version_exists(self) -> None: + from altissimo.terra import __version__ + + assert isinstance(__version__, str) + assert len(__version__) > 0 + + def test_all_is_accurate(self) -> None: + import altissimo.terra as mod + + for name in mod.__all__: + assert hasattr(mod, name), f"__all__ lists '{name}' but it is not defined" diff --git a/tests/test_placeholder.py b/tests/test_placeholder.py deleted file mode 100644 index 1d3edd3..0000000 --- a/tests/test_placeholder.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Placeholder tests until the client has real ones.""" - -import altissimo.terra - - -def test_package_imports() -> None: - """The package imports, which gives coverage something to measure.""" - assert altissimo.terra.__all__ == []