May: dev commits to staging#515
Open
Stephen Epps (stepps00) wants to merge 144 commits intostagingfrom
Open
Conversation
This commit adds a GitHub Actions workflow that automatically publishes the Python schema packages to PyPI when they have a version number change that is pushed to the main branch.* Packages are published in topological order, which is for now determined by the hard-coded `def level` function in `scripts/package-versions.py`. Eventually, we also want to auto-cut a GitHub Release after a successful publish, but let's do that later. *: For now, PyPI = Overture internal CodeArtifact repo, but eventually it will be public PyPI.
Vehicle dimension selectors (height, length, weight, width) use float64 instead of float32 to match the double-precision values in the data platform. Level uses int32 instead of int16 for the same reason. Axle count stays uint8 since it's a discrete count.
Cartography types (Prominence, MinZoom, MaxZoom, SortKey) from uint8 to int32; ConfidenceScore from float32 to float64. Matches actual data ranges in Overture releases.
The mypy target only checked top-level test files via `packages/*/tests/*.py`. Subdirectory tests (model_constraint/, ref/, scoping/) were never type-checked. Switch to per-directory find so mypy discovers all test files while keeping each package's conftest.py visible (avoids duplicate module conflicts across packages). Fixes in test code: - Mapping[str, object] in assert_subset (dict invariance) - Missing return type annotations on test functions - Duplicate TestModel names within same scope - JsonDict annotations for ConfigDict json_schema_extra - type: ignore for dynamically-created .When classes
Every other package had its tests/ directory in pythonpath; cli was the only one missing, making its conftest imports rely on rootdir discovery.
These packages import from overture.schema.system without declaring it as a dependency. Works in the uv workspace but breaks isolated installs. - overture-schema-core - overture-schema-cli - overture-schema-base-theme - overture-schema-buildings-theme - overture-schema-transportation-theme
Update multiple packages' pyproject.toml files to add a maintainers list, common keywords, and a [project.urls] section (Homepage, Source, Issues). Affects core, system, cli, annex, and all theme packages under packages/overture-schema-*. This centralizes package metadata to improve discoverability, attribution, and tooling integration.
* Delete .github/workflows/copy-pr-docs-to-staging.yaml * Delete .github/workflows/copy-latest-docs-to-staging.yaml
[CHORE] Add maintainers, keywords, and URLs to pyproject
pytest-subtests merged into pytest core as of pytest 9. Update test imports from pytest_subtests.SubTests to _pytest.subtests.Subtests. uv.lock was fully re-resolved, upgrading all transitive dependencies to current versions. Notable: pytest 8.4→9.0, mypy 1.18→1.19, pdoc 15→16, ruff 0.14.0→0.14.14.
* Widen `AdminLevel` from `uint8` to `int32` to match divisions data currently being generated. * Fix Pydantic rebinding self in model constraint validator
Geometry constraint tests: replace full powerset (127 subsets of 7 geometry types) with singletons + pairs + full set (29 subsets). GeometryTypeConstraint is a set-membership check — combinatorial testing beyond pairs exercises no additional code paths. Makefile: run pytest, doctest, ruff, and mypy concurrently via make -j after a single upfront uv-sync. Added -only variants (no uv-sync dep) for the parallel invocation; standalone targets preserved with their original uv-sync dependencies.
* Treat None as absent in model constraint validation
require_any_of, require_if, and forbid_if now treat None as "not
present" for constraint purposes. Fields must be both in
model_fields_set and non-null to satisfy (or violate) a constraint.
- require_any_of: None no longer satisfies "at least one must be set"
- require_if: None no longer satisfies "must be set when condition holds"
- forbid_if: None no longer violates "must not be set when condition holds"
JSON Schema generation updated to emit {"not": {"type": "null"}}
property constraints alongside "required" assertions, via a shared
required_non_null helper in _json_schema.py. Shared predicate
_field_has_non_null_value extracted onto OptionalFieldGroupConstraint
so the check lives in one place. Also fixes a stray backtick in the
require_if error message.
* Use Python None terminology and clarify constraint docs
Use Python terminology (None) instead of null in docstrings, identifiers,
and error messages. Rewrite error messages to describe what's checked
("set to a value other than None") rather than using jargon.
Eliminates duplicated validate() and __get_pydantic_json_schema__() across CountryCodeAlpha2, HexColor, LanguageTag, NoWhitespace, SnakeCase, PhoneNumber, RegionCode, and WikidataId constraints. Each is now a thin __init__-only wrapper calling super().__init__(). PatternConstraint gains optional keyword-only description, min_length, max_length parameters for JSON Schema annotations. StringConstraint gains _raise_validation_error() to deduplicate error construction across PatternConstraint, JsonPointerConstraint, and StrippedConstraint.
The previous pattern ^(\S.*)?\S$ required at least one non-whitespace
character, rejecting empty string. The validator itself accepts empty
string ("" == "".strip()), so the JSON schema was more restrictive
than the Python validation.
New pattern ^(\S(.*\S)?)?$ matches empty string (outer group optional),
single non-whitespace chars, and strings bookended by non-whitespace.
Updated all JSON schema baselines and inline expectations.
Replace `len(errors()) > 0` with error message assertions in hex color and no-whitespace invalid tests. The weak assertions only checked that validation failed, not that the correct error was raised.
Replace 16 individual valid/invalid test methods with two parametrized tests driven by PATTERN_CONSTRAINT_CASES. Covers all 8 PatternConstraint subclasses: LanguageTag, CountryCodeAlpha2, RegionCode, WikidataId, PhoneNumber, HexColor, NoWhitespace, SnakeCase. Moved SnakeCaseConstraint tests from TestErrorHandling (where they were misplaced) into the parametrized data. Non-PatternConstraint tests remain as standalone methods: base PatternConstraint (custom pattern), StrippedConstraint, and JsonPointerConstraint (empty-string special case).
The dict branch of the Pydantic validator in BBox.__get_pydantic_core_schema__ constructed a BBox from the dict but didn't return it, silently producing None. Add the missing return statement. The test parametrize case for dict input covers this path.
Bare triple-quoted strings after NewType assignments are expression statements that Python never attaches to the NewType object, leaving __doc__ as None. Convert each to an explicit __doc__ assignment so codegen and introspection tools can read them at runtime. Same pattern DocumentedEnum uses for enum member docs.
- Add -q, --tb=short to `make test` for compact output - Set verbosity_subtests=0 to suppress per-subtest progress characters (the u/,/- markers from pytest's built-in subtests support) Signed-off-by: Seth Fitzsimmons <sethfitz@amazon.com>
OvertureFeature validator error message had two continuation
lines missing the f-prefix, so {self.__class__.__name__} was
rendered literally. Also add missing space before "and".
Signed-off-by: Seth Fitzsimmons <sethfitz@amazon.com>
Signed-off-by: John McCall <john@overturemaps.org>
Add id-token: write permissions to workflows (.github/workflows/publish-python-packages.yaml and reusable-check-python-package-versions.yaml) so reusable workflows can use OIDC for AWS CodeArtifact authentication. Also add contents: read to the publish job. Update schema-pr-preview.yml to remove the PREVIEW_PATH env var and inline the /schema/pr/${{ github.event.number }} path for S3 sync and CloudFront invalidation to ensure the preview is uploaded and invalidated at the correct location.
Signed-off-by: John McCall <john@overturemaps.org>
[SECURITY] Harden GitHub Workflows
Signed-off-by: John McCall <john@overturemaps.org>
…workflow-hardening [SECURITY] Harden GitHub Workflows Pt. 2
Bumps [marocchino/sticky-pull-request-comment](https://github.com/marocchino/sticky-pull-request-comment) from 3.0.3 to 3.0.4. - [Release notes](https://github.com/marocchino/sticky-pull-request-comment/releases) - [Commits](marocchino/sticky-pull-request-comment@d4d6b09...0ea0beb) --- updated-dependencies: - dependency-name: marocchino/sticky-pull-request-comment dependency-version: 3.0.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.0 to 7.0.1. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@bbbca2d...043fb46) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: John McCall <john@overturemaps.org>
…arocchino/sticky-pull-request-comment-3.0.4 [CHORE](deps)(deps): Bump marocchino/sticky-pull-request-comment from 3.0.3 to 3.0.4
Signed-off-by: John McCall <john@overturemaps.org>
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 8.0.0 to 8.1.0. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](astral-sh/setup-uv@cec2083...0880764) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-version: 8.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…ctions/upload-artifact-7.0.1 [CHORE](deps)(deps): Bump actions/upload-artifact from 7.0.0 to 7.0.1
…stral-sh/setup-uv-8.1.0 [CHORE](deps)(deps): Bump astral-sh/setup-uv from 8.0.0 to 8.1.0
Bumps the actions group with 2 updates: [actions/github-script](https://github.com/actions/github-script) and [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/github-script` from 8.0.0 to 9.0.0 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](actions/github-script@ed59741...3a2844b) Updates `actions/setup-node` from 6.3.0 to 6.4.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@53b8394...48b55a0) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-node dependency-version: 6.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
…ctions-f55440bc36 [CHORE](deps)(deps): Bump the actions group with 2 updates
The check-python-code workflow now runs across the supported Python minor versions (3.10-3.14), and adds a lowest-direct cell that re- resolves every direct dependency to its declared floor before running make check. Failures in that cell mean a declared minimum is wrong -- either the code uses a feature newer than the floor admits, or the pin needs to be raised. Setting UV_RESOLUTION=lowest-direct causes the existing make uv-sync to re-resolve from the lockfile rather than follow it, so no separate lock or constraints file is needed. The declared floors lie about the actual minimums in several places. Bump them to what the code requires today: - pydantic >= 2.12: optionality.py imports pydantic.experimental.missing_sentinel, which only exists in 2.12+. feature.py imports ModelWrapValidatorHandler at the top level (re-exported in 2.10.4) and Tag (added in 2.5). - ruff >= 0.13: 0.12.x still fires the deprecated UP038 rule under select = ["UP"], which the workspace config selects. - deepdiff >= 8.6: first version shipping a py.typed marker, without which mypy errors on import-untyped. Per-package dev deps that were unpinned (ruff, mypy, pytest in overture-schema-cli and overture-schema-system; pyyaml, deepdiff in overture-schema) now match the workspace dev-group floors. uv warns about unpinned direct deps under lowest-direct resolution; pinning silences the warnings and makes the floor explicit. Signed-off-by: Seth Fitzsimmons <seth@mojodna.net>
Signed-off-by: jeffdefacto <jeffdefacto@gmail.com>
🗺️ Schema reference docs preview is live!
Note ♻️ This preview updates automatically with each push to this PR. |
Seth Fitzsimmons (sethfitz)
approved these changes
May 8, 2026
Collaborator
Seth Fitzsimmons (sethfitz)
left a comment
There was a problem hiding this comment.
I don't understand the build failure, but don't see it as being a problem for this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bring staging up to dev so that it contains most recent changes from April/early May.
Documentation website
Update the hyperlink below to put the pull request number in.
Docs preview for this PR.