feat: add pyproject.toml, smoke tests, and Gitea CI workflow
- pyproject.toml: hatchling build, ruff + pytest dev deps, CLI entrypoint - tests/test_smoke.py: import validation for all modules - .gitea/workflows/ci.yaml: lint, test, publish to Gitea PyPI, ntfy notifications - .gitignore: exclude __pycache__
This commit is contained in:
59
tests/test_smoke.py
Normal file
59
tests/test_smoke.py
Normal file
@@ -0,0 +1,59 @@
|
||||
"""Smoke tests for mlflow_utils package."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def test_package_imports() -> None:
|
||||
"""All public symbols are importable."""
|
||||
from mlflow_utils import ( # noqa: F401
|
||||
MLflowConfig,
|
||||
MLflowTracker,
|
||||
InferenceMetricsTracker,
|
||||
get_mlflow_client,
|
||||
get_tracking_uri,
|
||||
ensure_experiment,
|
||||
)
|
||||
|
||||
|
||||
def test_version() -> None:
|
||||
import mlflow_utils
|
||||
|
||||
assert mlflow_utils.__version__
|
||||
|
||||
|
||||
def test_mlflow_config_defaults() -> None:
|
||||
from mlflow_utils.client import MLflowConfig
|
||||
|
||||
cfg = MLflowConfig()
|
||||
assert "mlflow" in cfg.tracking_uri
|
||||
assert cfg.tracking_uri.startswith("http")
|
||||
|
||||
|
||||
def test_cli_entrypoint() -> None:
|
||||
"""CLI main function exists and is callable."""
|
||||
from mlflow_utils.cli import main
|
||||
|
||||
assert callable(main)
|
||||
|
||||
|
||||
def test_kfp_components_importable() -> None:
|
||||
kfp = pytest.importorskip("kfp") # noqa: F841
|
||||
from mlflow_utils.kfp_components import ( # noqa: F401
|
||||
create_mlflow_run,
|
||||
log_metrics_component,
|
||||
)
|
||||
|
||||
|
||||
def test_model_registry_importable() -> None:
|
||||
from mlflow_utils.model_registry import ( # noqa: F401
|
||||
register_model_for_kserve,
|
||||
generate_kserve_manifest,
|
||||
)
|
||||
|
||||
|
||||
def test_experiment_comparison_importable() -> None:
|
||||
from mlflow_utils.experiment_comparison import ( # noqa: F401
|
||||
ExperimentAnalyzer,
|
||||
)
|
||||
Reference in New Issue
Block a user