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
17 changes: 17 additions & 0 deletions .github/workflows/backfill_release_manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
description: "Exact policyengine-us version used with this data release"
required: true
type: string
compatible_model_package_versions:
description: "Optional newline-separated additional exact policyengine-us runtime versions to certify"
required: false
default: ""
type: string
core_package_version:
description: "Exact policyengine-core version used with this data release"
required: true
Expand Down Expand Up @@ -107,6 +112,7 @@ jobs:
VERSION: ${{ inputs.version }}
ARTIFACTS: ${{ inputs.artifacts }}
MODEL_PACKAGE_VERSION: ${{ inputs.model_package_version }}
COMPATIBLE_MODEL_PACKAGE_VERSIONS: ${{ inputs.compatible_model_package_versions }}
CORE_PACKAGE_VERSION: ${{ inputs.core_package_version }}
COMPATIBLE_CORE_PACKAGE_VERSIONS: ${{ inputs.compatible_core_package_versions }}
MODEL_PACKAGE_GIT_SHA: ${{ inputs.model_package_git_sha }}
Expand Down Expand Up @@ -154,6 +160,17 @@ jobs:
"${artifact_args[@]}"
)

while IFS= read -r model_version; do
if [ -z "${model_version}" ]; then
continue
fi
if [[ ! "${model_version}" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then
echo "::error::Compatible model version must use x.y.z form, got '${model_version}'."
exit 1
fi
cmd+=(--compatible-model-package-version "${model_version}")
done <<< "${COMPATIBLE_MODEL_PACKAGE_VERSIONS}"

while IFS= read -r core_version; do
if [ -z "${core_version}" ]; then
continue
Expand Down
1 change: 1 addition & 0 deletions changelog.d/backfill-compatible-model-versions.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Expose additional compatible policyengine-us versions in release manifest backfill and bump policyengine-us to 1.722.4.
16 changes: 16 additions & 0 deletions policyengine_us_data/storage/backfill_release_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def build_backfilled_release_manifest(
artifacts: Sequence[HfArtifactMetadata],
model_package_version: str,
core_package_version: str,
compatible_model_package_versions: Sequence[str] | None = None,
compatible_core_package_versions: Sequence[str] | None = None,
hf_repo_name: str = DEFAULT_HF_REPO_NAME,
model_package_name: str = DEFAULT_MODEL_PACKAGE_NAME,
Expand All @@ -132,6 +133,9 @@ def build_backfilled_release_manifest(
"name": DEFAULT_CORE_PACKAGE_NAME,
"version": core_package_version,
},
additional_compatible_specifiers=[
f"=={version}" for version in compatible_model_package_versions or ()
],
additional_core_compatible_specifiers=[
f"=={version}" for version in compatible_core_package_versions or ()
],
Expand Down Expand Up @@ -220,6 +224,17 @@ def _parse_args() -> argparse.Namespace:
)
parser.add_argument("--model-package-version", required=True)
parser.add_argument("--core-package-version", required=True)
parser.add_argument(
"--compatible-model-package-version",
action="append",
dest="compatible_model_package_versions",
default=[],
help=(
"Additional exact policyengine-us runtime version to certify as "
"compatible. Repeat for multiple versions. The build model remains "
"--model-package-version."
),
)
parser.add_argument(
"--compatible-core-package-version",
action="append",
Expand Down Expand Up @@ -278,6 +293,7 @@ def main() -> int:
artifacts=artifacts,
model_package_version=args.model_package_version,
core_package_version=args.core_package_version,
compatible_model_package_versions=args.compatible_model_package_versions,
compatible_core_package_versions=args.compatible_core_package_versions,
hf_repo_name=args.hf_repo_name,
model_package_git_sha=args.model_package_git_sha,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3.14",
]
dependencies = [
"policyengine-us==1.715.3",
"policyengine-us==1.722.4",
# policyengine-core 3.26.1 is the current 3.26.x runtime and includes the fix for
# PolicyEngine/policyengine-core#482 (user-set ETERNITY inputs lost
# after _invalidate_all_caches) and is required by policyengine-us 1.682.1+.
Expand Down
22 changes: 22 additions & 0 deletions tests/unit/test_backfill_release_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,28 @@ def test_build_backfilled_release_manifest_records_additional_core_compatibility
]


def test_build_backfilled_release_manifest_records_additional_model_compatibility():
manifest = build_backfilled_release_manifest(
version="1.73.0",
artifacts=[
HfArtifactMetadata(
path="enhanced_cps_2024.h5",
sha256="a" * 64,
size_bytes=1,
)
],
model_package_version="1.653.3",
compatible_model_package_versions=["1.722.4"],
core_package_version="3.26.0",
)

assert manifest["build"]["built_with_model_package"]["version"] == "1.653.3"
assert manifest["compatible_model_packages"] == [
{"name": "policyengine-us", "specifier": "==1.653.3"},
{"name": "policyengine-us", "specifier": "==1.722.4"},
]


def test_upload_backfilled_release_manifest_uploads_manifest_and_trace(monkeypatch):
api = MagicMock()
api.create_commit.return_value = SimpleNamespace(oid="commit-sha")
Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading