Skip to content

May: dev commits to staging#515

Open
Stephen Epps (stepps00) wants to merge 144 commits intostagingfrom
staging_2026_05_07
Open

May: dev commits to staging#515
Stephen Epps (stepps00) wants to merge 144 commits intostagingfrom
staging_2026_05_07

Conversation

@stepps00
Copy link
Copy Markdown
Contributor

@stepps00 Stephen Epps (stepps00) commented May 7, 2026

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.

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>
John McCall (lowlydba) and others added 20 commits April 9, 2026 12:40
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>
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>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

🗺️ Schema reference docs preview is live!

🌍 Preview https://staging.overturemaps.org/schema/pr/515/schema/index.html
🕐 Updated May 07, 2026 15:36 UTC
📝 Commit 2f1829e
🔧 env SCHEMA_PREVIEW true

Note

♻️ This preview updates automatically with each push to this PR.

@stepps00 Stephen Epps (stepps00) added the change type - minor 🤏 Minor schema change. See https://lf-overturemaps.atlassian.net/wiki/x/GgDa label May 7, 2026
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the build failure, but don't see it as being a problem for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change type - minor 🤏 Minor schema change. See https://lf-overturemaps.atlassian.net/wiki/x/GgDa

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants