From 956dd3fe308e052b057738e03f3b692a6248e759 Mon Sep 17 00:00:00 2001 From: Artfizer Date: Tue, 8 Sep 2026 19:11:47 +0300 Subject: [PATCH 1/4] chore: fix pyton versions collision in 'install-local' Signed-off-by: Artfizer --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5874cb7..58c163b 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,11 @@ build: py-env $(PYTHON) -m build --outdir dist ./gts # Install the locally built wheel, equivalent to installing the published gts package -install-local: build - $(PYTHON) -m pip install --force-reinstall dist/gts-*.whl +install-local: + @rm -rf dist/ + $(PYTHON) -m pip install --upgrade build + $(PYTHON) -m build --outdir dist ./gts + $(PYTHON) -m pip install --no-deps --force-reinstall dist/gts-*.whl # Uninstall gts from the selected interpreter uninstall-local: From 0d5529161225c661f3e0db8a72ccfbe7f01f8577 Mon Sep 17 00:00:00 2001 From: Artfizer Date: Tue, 8 Sep 2026 19:12:17 +0300 Subject: [PATCH 2/4] fix: update the CLI options to make it aligned with gears-rust Signed-off-by: Artfizer --- gts/src/gts/_cli.py | 16 ++++++++++++++++ tests/test_cli.py | 10 ++++++++++ 2 files changed, 26 insertions(+) diff --git a/gts/src/gts/_cli.py b/gts/src/gts/_cli.py index 31c16f7..fc5cd1b 100644 --- a/gts/src/gts/_cli.py +++ b/gts/src/gts/_cli.py @@ -39,6 +39,18 @@ def build_parser() -> argparse.ArgumentParser: ) s.add_argument("--gts-id", required=True, help="GTS ID of the object") + s = sub.add_parser( + "validate-type-schema", + help="Validate a type schema against its base type schema (OP#12 schema-vs-schema)", + ) + s.add_argument("--gts-id", required=True, help="GTS ID of the type schema") + + s = sub.add_parser( + "validate-entity", + help="Validate an entity (instance or schema) by GTS ID", + ) + s.add_argument("--gts-id", required=True, help="GTS ID of the entity") + s = sub.add_parser( "resolve-relationships", help="Resolve relationships for an entity" ) @@ -144,6 +156,10 @@ def main(argv: list[str] | None = None) -> None: out = ops.uuid(args.gts_id).to_dict() elif args.op == "validate-instance": out = ops.validate_instance(args.gts_id).to_dict() + elif args.op == "validate-type-schema": + out = ops.validate_schema(args.gts_id).to_dict() + elif args.op == "validate-entity": + out = ops.validate_entity(args.gts_id).to_dict() elif args.op == "resolve-relationships": out = ops.schema_graph(args.gts_id).to_dict() elif args.op == "compatibility": diff --git a/tests/test_cli.py b/tests/test_cli.py index ae7177d..9ce6a62 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -25,6 +25,16 @@ "--gts-id", "gts.vendor.package.namespace.type.v1~vendor.package.namespace.item.v1", ], + [ + "validate-type-schema", + "--gts-id", + "gts.vendor.package.namespace.type.v1~", + ], + [ + "validate-entity", + "--gts-id", + "gts.vendor.package.namespace.type.v1~", + ], ["resolve-relationships", "--gts-id", "gts.vendor.package.namespace.type.v1~"], [ "compatibility", From 00e0828d33a5a49c97b455e375ae17fc275612a5 Mon Sep 17 00:00:00 2001 From: Artfizer Date: Tue, 8 Sep 2026 21:17:50 +0300 Subject: [PATCH 3/4] chore: update Makefile based on CodeRabbit comments Signed-off-by: Artfizer --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 58c163b..68eab22 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ PYTHON ?= $(PY_ENV_DIR)/bin/python endif PY_ENV_STAMP := $(PY_ENV_DIR)/.stamp INSTALL_STAMP := $(PY_ENV_DIR)/.install-stamp +LOCAL_DIST_DIR := dist/install-local ifneq ($(filter install-local uninstall-local,$(MAKECMDGOALS)),) ifeq ($(origin PYTHON),file) @@ -38,6 +39,9 @@ help: # Create/update the virtual environment and install dev/test dependencies py-env: $(PY_ENV_STAMP) +$(PY_ENV_DIR)/bin/python: + $(PYTHON_BOOTSTRAP) -m venv $(PY_ENV_DIR) + $(PY_ENV_STAMP): gts/pyproject.toml .gts-spec/tests/requirements.txt Makefile @echo "Creating/updating Python virtual environment in $(PY_ENV_DIR)..." $(PYTHON_BOOTSTRAP) -m venv $(PY_ENV_DIR) @@ -60,11 +64,11 @@ build: py-env $(PYTHON) -m build --outdir dist ./gts # Install the locally built wheel, equivalent to installing the published gts package -install-local: - @rm -rf dist/ +install-local: $(if $(filter $(PY_ENV_DIR)/bin/python,$(PYTHON)),$(PY_ENV_DIR)/bin/python) + @rm -rf $(LOCAL_DIST_DIR) $(PYTHON) -m pip install --upgrade build - $(PYTHON) -m build --outdir dist ./gts - $(PYTHON) -m pip install --no-deps --force-reinstall dist/gts-*.whl + $(PYTHON) -m build --outdir $(LOCAL_DIST_DIR) ./gts + $(PYTHON) -m pip install --force-reinstall $(LOCAL_DIST_DIR)/gts-*.whl # Uninstall gts from the selected interpreter uninstall-local: From 13f74b9a266d0acf1d5d6f1cd4696c2486709c1d Mon Sep 17 00:00:00 2001 From: Artfizer Date: Tue, 8 Sep 2026 21:17:50 +0300 Subject: [PATCH 4/4] chore: update Makefile based on CodeRabbit comments Signed-off-by: Artfizer --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 68eab22..f9f3f1b 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ PYTHON ?= $(PY_ENV_DIR)/bin/python endif PY_ENV_STAMP := $(PY_ENV_DIR)/.stamp INSTALL_STAMP := $(PY_ENV_DIR)/.install-stamp -LOCAL_DIST_DIR := dist/install-local +LOCAL_DIST_DIR := dist-install-local ifneq ($(filter install-local uninstall-local,$(MAKECMDGOALS)),) ifeq ($(origin PYTHON),file) @@ -77,7 +77,7 @@ uninstall-local: # Remove venv and build artifacts clean: - rm -rf $(PY_ENV_DIR) dist/ gts/dist/ gts/*.egg-info + rm -rf $(PY_ENV_DIR) dist/ $(LOCAL_DIST_DIR) gts/dist/ gts/*.egg-info # -------- Code quality --------