diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bc72c2..a1f8cd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: pip install -e ".[dev]" - name: Lint with ruff - run: pip install ruff && ruff check src/ --target-version py310 + run: pip install ruff && ruff check src/ tests/ --target-version py310 - name: Run tests run: | python -m pytest tests/ -v --cov=schemaforge --cov-report=term-missing diff --git a/src/schemaforge/cli.py b/src/schemaforge/cli.py index b743107..d54639e 100644 --- a/src/schemaforge/cli.py +++ b/src/schemaforge/cli.py @@ -13,6 +13,7 @@ def decorator(func): return func return decorator +from . import __version__ from .check import check_directory from .convert import convert_schema from .diff import diff_schemas @@ -27,7 +28,7 @@ def decorator(func): @click.group() -@click.version_option() +@click.version_option(version=__version__) def main() -> None: """SchemaForge — bidirectional ORM schema converter. diff --git a/tests/test_cli.py b/tests/test_cli.py index 67776e2..3b7ade5 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -7,10 +7,8 @@ import sys import tempfile -from pathlib import Path - -import pytest from click.testing import CliRunner +from pathlib import Path sys.path.insert(0, str(Path(__file__).parent.parent / "src")) @@ -370,7 +368,7 @@ def test_check_directory_with_type_map(self): Path(tmpdir, "schema.sql").write_text(SAMPLE_SQL) Path(tmpdir, "schema.prisma").write_text(SAMPLE_PRISMA) - result = runner.invoke(main, [ + runner.invoke(main, [ "check", "--dir", tmpdir, "--type-map", str(type_map),