Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: default uv-sync clean-pyspark generate-pyspark check test-all test test-only docformat docformat-only doctest doctest-only mypy mypy-only lint-only update-baselines
.PHONY: default uv-sync clean-pyspark generate-pyspark check check-namespace test-all test test-only docformat docformat-only doctest doctest-only mypy mypy-only lint-only update-baselines

TESTMON ?= --testmon

Expand All @@ -23,7 +23,23 @@ generate-pyspark: uv-sync clean-pyspark
@uv run ruff format --quiet $(PYSPARK_EXPRESSIONS) $(PYSPARK_GENERATED_TESTS)

check: uv-sync generate-pyspark
@$(MAKE) -j test-only docformat-only doctest-only lint-only mypy-only
@$(MAKE) -j test-only docformat-only doctest-only lint-only mypy-only check-namespace

# Guard the PEP 420 namespace roots. overture/ and overture/schema/ are
# implicit namespace packages -- no __init__.py -- so every workspace package
# contributes its own leaf under the shared namespace. An __init__.py at either
# root turns that package into a regular package that shadows every other
# distribution's contribution at import time. -path patterns (not shell globs)
# keep this shell-independent and match only the two roots, never the leaves.
check-namespace:
@found=$$(find packages -type f -path '*/src/overture/__init__.py' \
-o -type f -path '*/src/overture/schema/__init__.py'); \
if [ -n "$$found" ]; then \
echo "ERROR: __init__.py at PEP 420 namespace root(s) -- delete these:" >&2; \
echo "$$found" >&2; \
echo "overture/ and overture/schema/ must stay implicit namespace packages." >&2; \
exit 1; \
fi

# test-all is the unconditional full run -- testmon-independent, unlike the
# incremental test/test-only targets -- so data-only changes (golden JSON,
Expand Down
8 changes: 4 additions & 4 deletions packages/overture-schema-addresses-theme/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ overture-schema-system = { workspace = true }


[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
requires = ["uv_build>=0.11.32,<0.13"]
build-backend = "uv_build"

[tool.hatch.build.targets.wheel]
packages = ["src/overture"]
[tool.uv.build-backend]
module-name = "overture.schema.addresses"

[tool.pytest.ini_options]
pythonpath = ["src"]
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from overture.schema.addresses import Address
from overture.schema.system.testing import assert_json_schema_golden

Expand Down
8 changes: 4 additions & 4 deletions packages/overture-schema-base-theme/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ overture-schema-system = { workspace = true }


[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
requires = ["uv_build>=0.11.32,<0.13"]
build-backend = "uv_build"

[tool.hatch.build.targets.wheel]
packages = ["src/overture"]
[tool.uv.build-backend]
module-name = "overture.schema.base"

[project.entry-points."overture.models"]
bathymetry = "overture.schema.base:Bathymetry"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from overture.schema.base import Bathymetry
from overture.schema.system.testing import assert_json_schema_golden

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from overture.schema.base import Infrastructure
from overture.schema.system.testing import assert_json_schema_golden

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from overture.schema.base import LandCover
from overture.schema.system.testing import assert_json_schema_golden

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from overture.schema.base import Land
from overture.schema.system.testing import assert_json_schema_golden

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from overture.schema.base import LandUse
from overture.schema.system.testing import assert_json_schema_golden

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from overture.schema.base import Water
from overture.schema.system.testing import assert_json_schema_golden

Expand Down
8 changes: 4 additions & 4 deletions packages/overture-schema-buildings-theme/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ overture-schema-system = { workspace = true }


[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
requires = ["uv_build>=0.11.32,<0.13"]
build-backend = "uv_build"

[tool.hatch.build.targets.wheel]
packages = ["src/overture"]
[tool.uv.build-backend]
module-name = "overture.schema.buildings"

[project.entry-points."overture.models"]
building = "overture.schema.buildings:Building"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from overture.schema.buildings.building import Building
from overture.schema.system.testing import assert_json_schema_golden

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from overture.schema.buildings.building_part import BuildingPart
from overture.schema.system.testing import assert_json_schema_golden

Expand Down
8 changes: 4 additions & 4 deletions packages/overture-schema-cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ overture-schema-common = { workspace = true }
overture-schema-system = { workspace = true }

[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
requires = ["uv_build>=0.11.32,<0.13"]
build-backend = "uv_build"

[dependency-groups]
dev = [
Expand All @@ -38,8 +38,8 @@ dev = [
"mypy>=1.17.0",
]

[tool.hatch.build.targets.wheel]
packages = ["src/overture"]
[tool.uv.build-backend]
module-name = "overture.schema.cli"

[project.scripts]
overture-schema = "overture.schema.cli:cli"
1 change: 0 additions & 1 deletion packages/overture-schema-cli/src/overture/__init__.py

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions packages/overture-schema-cli/tests/test_cli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest
from click.testing import CliRunner
from conftest import build_feature

from overture.schema.cli.commands import cli


Expand Down
3 changes: 2 additions & 1 deletion packages/overture-schema-cli/tests/test_cli_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import yaml
from click.exceptions import UsageError
from conftest import build_feature
from pydantic import BaseModel, ValidationError

from overture.schema.cli.commands import (
_best_fit_model,
_revalidate_undiscriminatable_items,
Expand All @@ -19,7 +21,6 @@
from overture.schema.cli.type_analysis import get_item_index
from overture.schema.cli.types import ValidationErrorDict
from overture.schema.system.discovery import TagSelector
from pydantic import BaseModel, ValidationError


class TestLoadInput:
Expand Down
5 changes: 3 additions & 2 deletions packages/overture-schema-cli/tests/test_data_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
from io import StringIO

from conftest import build_feature
from rich.console import Console
from rich.panel import Panel

from overture.schema.cli.data_display import (
create_feature_display,
extract_feature_data,
format_field_value,
select_context_fields,
)
from rich.console import Console
from rich.panel import Panel


class TestExtractFeatureData:
Expand Down
5 changes: 3 additions & 2 deletions packages/overture-schema-cli/tests/test_error_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

import pytest
from click.testing import CliRunner
from pydantic import BaseModel, Field, TypeAdapter, ValidationError
from rich.console import Console

from overture.schema.cli.commands import cli
from overture.schema.cli.error_formatting import (
format_path,
Expand All @@ -14,8 +17,6 @@
)
from overture.schema.cli.type_analysis import introspect_union
from overture.schema.cli.types import ErrorLocation, ValidationErrorDict
from pydantic import BaseModel, Field, TypeAdapter, ValidationError
from rich.console import Console


class TestErrorGrouping:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest
from click.testing import CliRunner
from conftest import build_feature

from overture.schema.cli.commands import cli


Expand Down
1 change: 1 addition & 0 deletions packages/overture-schema-cli/tests/test_resolve_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from unittest.mock import patch

import pytest

from overture.schema.cli.commands import resolve_types
from overture.schema.system.discovery import ModelKey, TagSelector

Expand Down
3 changes: 2 additions & 1 deletion packages/overture-schema-cli/tests/test_type_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
from typing import Annotated, Literal

import pytest
from pydantic import BaseModel, Discriminator, Field

from overture.schema.cli.type_analysis import (
StructuralTuple,
create_structural_tuple,
extract_discriminator_path,
get_or_create_structural_tuple,
introspect_union,
)
from pydantic import BaseModel, Discriminator, Field


class TestStructuralTuples:
Expand Down
8 changes: 4 additions & 4 deletions packages/overture-schema-codegen/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
requires = ["uv_build>=0.11.32,<0.13"]
build-backend = "uv_build"

[project]
dependencies = [
Expand Down Expand Up @@ -42,5 +42,5 @@ test = [
"overture-schema-transportation-theme",
]

[tool.hatch.build.targets.wheel]
packages = ["src/overture"]
[tool.uv.build-backend]
module-name = "overture.schema.codegen"
1 change: 0 additions & 1 deletion packages/overture-schema-codegen/src/overture/__init__.py

This file was deleted.

This file was deleted.

Loading
Loading