Skip to content

Commit 04f527e

Browse files
santoso-wijayaThe Meridian Authors
authored andcommitted
Move schema package as meridian.schema
PiperOrigin-RevId: 868851002
1 parent 88c2cac commit 04f527e

File tree

5 files changed

+44
-27
lines changed

5 files changed

+44
-27
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -94,30 +94,6 @@ jobs:
9494
# Run tests (in parallel)
9595
- name: Run core tests
9696
if: ${{ !contains(github.event.head_commit.message, '#skip-pytest') }}
97-
run: pytest -vv --ignore=schema
97+
run: pytest -vv
9898
env:
9999
MERIDIAN_BACKEND: ${{ matrix.meridian-backend }}
100-
101-
pytest-schema:
102-
runs-on: ubuntu-latest
103-
timeout-minutes: 20
104-
name: pytest-schema
105-
steps:
106-
- uses: actions/checkout@v4
107-
if: ${{ !contains(github.event.head_commit.message, '#skip-pytest') }}
108-
- uses: actions/setup-python@v5
109-
if: ${{ !contains(github.event.head_commit.message, '#skip-pytest') }}
110-
with:
111-
python-version: ${{ matrix.python-version }}
112-
cache: pip
113-
cache-dependency-path: '**/pyproject.toml'
114-
- name: Install proto dependencies and test tools
115-
if: ${{ !contains(github.event.head_commit.message, '#skip-pytest') }}
116-
run: |
117-
pip install semver
118-
pip install -e proto --config-settings editable_mode=strict
119-
pip install -e . --config-settings editable_mode=strict
120-
pip install pytest pytest-xdist
121-
- name: Run schema tests
122-
if: ${{ !contains(github.event.head_commit.message, '#skip-pytest') }}
123-
run: pytest -vv -n auto schema

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ To release a new version (e.g. from `1.0.0` -> `2.0.0`):
2323

2424
## [Unreleased]
2525

26+
* Move `schema` package as `meridian.schema`.
27+
* Introduce a temporary shim `schema.py` module for backwards compatibility.
28+
This shim will be removed in the next cut release.
29+
2630
## [1.5.1] - 2026-02-04
2731

2832
* Fix serialization for binary and text files.

meridian/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@
1313
# limitations under the License.
1414

1515
"""Meridian API."""
16+
1617
from meridian import analysis
1718
from meridian import backend
1819
from meridian import data
1920
from meridian import model
20-
from meridian.version import __version__
21+
from meridian.version import __version__ # pylint: disable=g-importing-member
2122

2223
try:
2324
from meridian import mlflow # pylint: disable=g-import-not-at-top
2425
except ImportError:
2526
pass
27+
28+
try:
29+
from meridian import schema
30+
except ImportError:
31+
pass

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ build-backend = "setuptools.build_meta"
110110

111111
[tool.setuptools]
112112
include-package-data = true
113+
py-modules = ["schema"] # TODO: Remove this shim.
113114

114115
[tool.setuptools.packages.find]
115-
include = ["meridian*", "schema*", "scenarioplanner*"]
116+
include = ["meridian*", "scenarioplanner*"]
116117
exclude = ["*test"]
117118

118119
[tool.setuptools.dynamic]

schema.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2026 The Meridian Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""A temporary shim for backwards compatibility."""
16+
# TODO: Remove this file in a future release cut.
17+
18+
import warnings
19+
20+
warnings.warn(
21+
"This top-level 'schema' import is deprecated and will be removed in a"
22+
" future version. Please update your imports to use 'from meridian.schema"
23+
" import ...'.",
24+
DeprecationWarning,
25+
stacklevel=2,
26+
)
27+
28+
# Import and re-export the contents from the new location
29+
# pylint: disable=g-import-not-at-top,wildcard-import
30+
from meridian.schema import *

0 commit comments

Comments
 (0)