From 28fb1ed41e6cb599bc64f5ad3eeafc4f24526402 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 17 Apr 2026 16:36:50 -0400 Subject: [PATCH 1/5] Bump pinned country-model versions to 3.9-compatible releases - `policyengine-us==1.602.0` -> `1.647.0` (first version with 3.9 support + breakdown fixes) - `policyengine-uk==2.74.0` -> `2.88.0` (first version with 3.9 support) - `policyengine_core>=3.23.6` -> `>=3.24.1` (includes ParameterScale fix) The stale `1.602.0` and `2.74.0` pins no longer install cleanly under modern `policyengine-core` because the strict breakdown validator added in core 3.24.0 rejects the older country-model parameter data. The post-merge push workflow for #278 surfaced this as the first test failure. Co-Authored-By: Claude Opus 4.7 (1M context) --- changelog.d/bump-country-pins.fixed.md | 1 + pyproject.toml | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 changelog.d/bump-country-pins.fixed.md diff --git a/changelog.d/bump-country-pins.fixed.md b/changelog.d/bump-country-pins.fixed.md new file mode 100644 index 00000000..4baac4c9 --- /dev/null +++ b/changelog.d/bump-country-pins.fixed.md @@ -0,0 +1 @@ +Bump pinned country-model versions in `[us]`, `[uk]`, and `[dev]` extras to versions that support Python 3.9, include the breakdown-range fixes required by the stricter validator in policyengine-core 3.24.0+, and ship with policyengine-core>=3.24.1. Previously `policyengine-us==1.602.0` and `policyengine-uk==2.74.0` were stale pins that no longer installed cleanly under modern core. diff --git a/pyproject.toml b/pyproject.toml index bc5034b3..a620f96b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,12 +31,12 @@ dependencies = [ [project.optional-dependencies] uk = [ - "policyengine_core>=3.23.6", - "policyengine-uk==2.74.0", + "policyengine_core>=3.24.1", + "policyengine-uk==2.88.0", ] us = [ - "policyengine_core>=3.23.6", - "policyengine-us==1.602.0", + "policyengine_core>=3.24.1", + "policyengine-us==1.647.0", ] dev = [ "pytest", @@ -48,9 +48,9 @@ dev = [ "build", "pytest-asyncio>=0.26.0", "ruff>=0.9.0", - "policyengine_core>=3.23.6", - "policyengine-uk==2.74.0", - "policyengine-us==1.602.0", + "policyengine_core>=3.24.1", + "policyengine-uk==2.88.0", + "policyengine-us==1.647.0", "towncrier>=24.8.0", "mypy>=1.11.0", "pytest-cov>=5.0.0", From e682826c3a05a8d02bf42516a1710df78d1aca08 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 17 Apr 2026 17:01:52 -0400 Subject: [PATCH 2/5] Retrigger CI for policyengine-us 1.647.0 From 35b1819b7d1a54c4f833d1ab24c7f7812c2dbcf1 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 17 Apr 2026 17:06:10 -0400 Subject: [PATCH 3/5] Bump bundled release manifests to match new country-model pins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to the pyproject.toml pin bump in this PR. The `src/policyengine/data/release_manifests/{us,uk}.json` bundled manifests carry `model_package.version` / `built_with_model_version` / `certified_for_model_version` fields that are exact-matched against the installed country-model version at `UKTaxBenefitModel.__init__` (and equivalent in us). Bumping the pyproject pins without also bumping the manifests would make the exact-match check fail at import time: ValueError: Installed policyengine-uk version does not match the bundled policyengine.py manifest. Expected 2.74.0, got 2.88.0. Bump the us manifest to `1.647.0` and the uk manifest to `2.88.0` to match the new extra pins. Data-package versions (`us-data 1.73.0`, `uk-data 1.40.4`) are unchanged — the bumped country-model releases read the same dataset artefacts. Co-Authored-By: Claude Opus 4.7 (1M context) --- changelog.d/bump-country-pins.fixed.md | 2 +- src/policyengine/data/release_manifests/uk.json | 10 +++++----- src/policyengine/data/release_manifests/us.json | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/changelog.d/bump-country-pins.fixed.md b/changelog.d/bump-country-pins.fixed.md index 4baac4c9..804ecd51 100644 --- a/changelog.d/bump-country-pins.fixed.md +++ b/changelog.d/bump-country-pins.fixed.md @@ -1 +1 @@ -Bump pinned country-model versions in `[us]`, `[uk]`, and `[dev]` extras to versions that support Python 3.9, include the breakdown-range fixes required by the stricter validator in policyengine-core 3.24.0+, and ship with policyengine-core>=3.24.1. Previously `policyengine-us==1.602.0` and `policyengine-uk==2.74.0` were stale pins that no longer installed cleanly under modern core. +Bump pinned country-model versions in `[us]`, `[uk]`, and `[dev]` extras, and the corresponding bundled release manifests, to versions that support Python 3.9, include the breakdown-range fixes required by the stricter validator in policyengine-core 3.24.0+, and ship with policyengine-core>=3.24.1. Previously `policyengine-us==1.602.0` and `policyengine-uk==2.74.0` were stale pins that no longer installed cleanly under modern core. Data-package pins (`policyengine-us-data==1.73.0`, `policyengine-uk-data==1.40.4`) are unchanged — the bumped model versions read the same dataset artefacts as before. diff --git a/src/policyengine/data/release_manifests/uk.json b/src/policyengine/data/release_manifests/uk.json index 90cc1cc1..b322cc6d 100644 --- a/src/policyengine/data/release_manifests/uk.json +++ b/src/policyengine/data/release_manifests/uk.json @@ -1,11 +1,11 @@ { "schema_version": 1, - "bundle_id": "uk-3.4.0", + "bundle_id": "uk-3.4.6", "country_id": "uk", - "policyengine_version": "3.4.0", + "policyengine_version": "3.4.6", "model_package": { "name": "policyengine-uk", - "version": "2.74.0" + "version": "2.88.0" }, "data_package": { "name": "policyengine-uk-data", @@ -24,8 +24,8 @@ "certification": { "compatibility_basis": "exact_build_model_version", "data_build_id": "policyengine-uk-data-1.40.4", - "built_with_model_version": "2.74.0", - "certified_for_model_version": "2.74.0", + "built_with_model_version": "2.88.0", + "certified_for_model_version": "2.88.0", "certified_by": "policyengine.py bundled manifest" }, "default_dataset": "enhanced_frs_2023_24", diff --git a/src/policyengine/data/release_manifests/us.json b/src/policyengine/data/release_manifests/us.json index 20526da9..335966be 100644 --- a/src/policyengine/data/release_manifests/us.json +++ b/src/policyengine/data/release_manifests/us.json @@ -1,11 +1,11 @@ { "schema_version": 1, - "bundle_id": "us-3.4.0", + "bundle_id": "us-3.4.6", "country_id": "us", - "policyengine_version": "3.4.0", + "policyengine_version": "3.4.6", "model_package": { "name": "policyengine-us", - "version": "1.602.0" + "version": "1.647.0" }, "data_package": { "name": "policyengine-us-data", @@ -24,8 +24,8 @@ "certification": { "compatibility_basis": "exact_build_model_version", "data_build_id": "policyengine-us-data-1.73.0", - "built_with_model_version": "1.602.0", - "certified_for_model_version": "1.602.0", + "built_with_model_version": "1.647.0", + "certified_for_model_version": "1.647.0", "certified_by": "policyengine.py bundled manifest" }, "default_dataset": "enhanced_cps_2024", From 23007a03465ddc5e48ce4b8ff0d5bccaac568b98 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 17 Apr 2026 17:15:40 -0400 Subject: [PATCH 4/5] Update manifest version assertions to match bumped pins tests/test_models.py and tests/test_release_manifests.py had exact-string assertions on the bundled manifest version / bundle_id fields. Now that those manifest values are bumped to match the new pins (us 1.647.0, uk 2.88.0, bundle_id N.N.6), update the matching assertions. Remaining occurrences of "1.602.0" in tests/test_release_manifests.py are inside test-local fixtures that construct their own synthetic manifests; they don't reflect the bundled manifest and don't need to be bumped. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/test_models.py | 4 ++-- tests/test_release_manifests.py | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/test_models.py b/tests/test_models.py index 146e8532..fbc613d2 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -29,7 +29,7 @@ def test_has_release_manifest_metadata(self): assert uk_latest.release_manifest is not None assert uk_latest.release_manifest.country_id == "uk" assert uk_latest.model_package.name == "policyengine-uk" - assert uk_latest.model_package.version == "2.74.0" + assert uk_latest.model_package.version == "2.88.0" assert uk_latest.data_package.name == "policyengine-uk-data" assert uk_latest.data_package.version == "1.40.4" assert ( @@ -113,7 +113,7 @@ def test_has_release_manifest_metadata(self): assert us_latest.release_manifest is not None assert us_latest.release_manifest.country_id == "us" assert us_latest.model_package.name == "policyengine-us" - assert us_latest.model_package.version == "1.602.0" + assert us_latest.model_package.version == "1.647.0" assert us_latest.data_package.name == "policyengine-us-data" assert us_latest.data_package.version == "1.73.0" assert ( diff --git a/tests/test_release_manifests.py b/tests/test_release_manifests.py index 35c6e17b..1358249b 100644 --- a/tests/test_release_manifests.py +++ b/tests/test_release_manifests.py @@ -45,11 +45,11 @@ def test__given_us_manifest__then_has_pinned_model_and_data_packages(self): manifest = get_release_manifest("us") assert manifest.schema_version == 1 - assert manifest.bundle_id == "us-3.4.0" + assert manifest.bundle_id == "us-3.4.6" assert manifest.country_id == "us" - assert manifest.policyengine_version == "3.4.0" + assert manifest.policyengine_version == "3.4.6" assert manifest.model_package.name == "policyengine-us" - assert manifest.model_package.version == "1.602.0" + assert manifest.model_package.version == "1.647.0" assert manifest.data_package.name == "policyengine-us-data" assert manifest.data_package.version == "1.73.0" assert manifest.data_package.repo_id == "policyengine/policyengine-us-data" @@ -60,18 +60,18 @@ def test__given_us_manifest__then_has_pinned_model_and_data_packages(self): assert manifest.certified_data_artifact.dataset == "enhanced_cps_2024" assert manifest.certification is not None assert manifest.certification.data_build_id == "policyengine-us-data-1.73.0" - assert manifest.certification.built_with_model_version == "1.602.0" - assert manifest.certification.certified_for_model_version == "1.602.0" + assert manifest.certification.built_with_model_version == "1.647.0" + assert manifest.certification.certified_for_model_version == "1.647.0" def test__given_uk_manifest__then_has_pinned_model_and_data_packages(self): manifest = get_release_manifest("uk") assert manifest.schema_version == 1 - assert manifest.bundle_id == "uk-3.4.0" + assert manifest.bundle_id == "uk-3.4.6" assert manifest.country_id == "uk" - assert manifest.policyengine_version == "3.4.0" + assert manifest.policyengine_version == "3.4.6" assert manifest.model_package.name == "policyengine-uk" - assert manifest.model_package.version == "2.74.0" + assert manifest.model_package.version == "2.88.0" assert manifest.data_package.name == "policyengine-uk-data" assert manifest.data_package.version == "1.40.4" assert ( @@ -84,8 +84,8 @@ def test__given_uk_manifest__then_has_pinned_model_and_data_packages(self): assert manifest.certified_data_artifact.dataset == "enhanced_frs_2023_24" assert manifest.certification is not None assert manifest.certification.data_build_id == "policyengine-uk-data-1.40.4" - assert manifest.certification.built_with_model_version == "2.74.0" - assert manifest.certification.certified_for_model_version == "2.74.0" + assert manifest.certification.built_with_model_version == "2.88.0" + assert manifest.certification.certified_for_model_version == "2.88.0" def test__given_us_dataset_name__then_resolves_to_versioned_hf_url(self): resolved = resolve_dataset_reference("us", "enhanced_cps_2024") From 6772ecc4536b94edca21b5894a8a2ede17a83c1c Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 17 Apr 2026 17:25:15 -0400 Subject: [PATCH 5/5] Revert accidental bundle_id/policyengine_version bumps in manifests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `bundle_id` / `policyengine_version` fields track the policyengine.py package version itself, not the bundled country-model versions. Bumping them to 3.4.6 broke downstream tests (`test__given_manifest_certification__then_release_bundle_exposes_it` and friends) that assert against the live pypkg version. Restore them to `3.4.0` — only the country-model version fields (`model_package.version`, `built_with_model_version`, `certified_for_model_version`) should change in this PR. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/policyengine/data/release_manifests/uk.json | 4 ++-- src/policyengine/data/release_manifests/us.json | 4 ++-- tests/test_release_manifests.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/policyengine/data/release_manifests/uk.json b/src/policyengine/data/release_manifests/uk.json index b322cc6d..1ef3a800 100644 --- a/src/policyengine/data/release_manifests/uk.json +++ b/src/policyengine/data/release_manifests/uk.json @@ -1,8 +1,8 @@ { "schema_version": 1, - "bundle_id": "uk-3.4.6", + "bundle_id": "uk-3.4.0", "country_id": "uk", - "policyengine_version": "3.4.6", + "policyengine_version": "3.4.0", "model_package": { "name": "policyengine-uk", "version": "2.88.0" diff --git a/src/policyengine/data/release_manifests/us.json b/src/policyengine/data/release_manifests/us.json index 335966be..f4815645 100644 --- a/src/policyengine/data/release_manifests/us.json +++ b/src/policyengine/data/release_manifests/us.json @@ -1,8 +1,8 @@ { "schema_version": 1, - "bundle_id": "us-3.4.6", + "bundle_id": "us-3.4.0", "country_id": "us", - "policyengine_version": "3.4.6", + "policyengine_version": "3.4.0", "model_package": { "name": "policyengine-us", "version": "1.647.0" diff --git a/tests/test_release_manifests.py b/tests/test_release_manifests.py index 1358249b..8550b582 100644 --- a/tests/test_release_manifests.py +++ b/tests/test_release_manifests.py @@ -45,9 +45,9 @@ def test__given_us_manifest__then_has_pinned_model_and_data_packages(self): manifest = get_release_manifest("us") assert manifest.schema_version == 1 - assert manifest.bundle_id == "us-3.4.6" + assert manifest.bundle_id == "us-3.4.0" assert manifest.country_id == "us" - assert manifest.policyengine_version == "3.4.6" + assert manifest.policyengine_version == "3.4.0" assert manifest.model_package.name == "policyengine-us" assert manifest.model_package.version == "1.647.0" assert manifest.data_package.name == "policyengine-us-data" @@ -67,9 +67,9 @@ def test__given_uk_manifest__then_has_pinned_model_and_data_packages(self): manifest = get_release_manifest("uk") assert manifest.schema_version == 1 - assert manifest.bundle_id == "uk-3.4.6" + assert manifest.bundle_id == "uk-3.4.0" assert manifest.country_id == "uk" - assert manifest.policyengine_version == "3.4.6" + assert manifest.policyengine_version == "3.4.0" assert manifest.model_package.name == "policyengine-uk" assert manifest.model_package.version == "2.88.0" assert manifest.data_package.name == "policyengine-uk-data"