diff --git a/.github/scripts/update-policyengine-package.sh b/.github/scripts/update-policyengine-package.sh index 8a8a52c97..14f6ca9b6 100755 --- a/.github/scripts/update-policyengine-package.sh +++ b/.github/scripts/update-policyengine-package.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # # Check PyPI for a newer policyengine.py package, update the simulation project -# pin, sync country package pins to that policyengine.py bundle, and open one +# pin, sync runtime package pins to that policyengine.py bundle, and open one # bundle-level PR. # # Usage: @@ -39,7 +39,8 @@ create_pr_body_file() { echo echo "Update policyengine.py from ${CURRENT} to ${LATEST} in the simulation API runtime." echo - echo "This also syncs country package pins to the versions bundled by policyengine.py ${LATEST}:" + echo "This also syncs runtime package pins to the versions bundled by policyengine.py ${LATEST}:" + echo "- policyengine-core: ${BUNDLED_CORE_VERSION:-resolved from bundle during update}" echo "- policyengine-us: ${BUNDLED_US_VERSION:-resolved from bundle during update}" echo "- policyengine-uk: ${BUNDLED_UK_VERSION:-resolved from bundle during update}" echo @@ -160,26 +161,29 @@ BUNDLE_OUTPUT=$( ) BUNDLED_US_VERSION=$(printf '%s\n' "$BUNDLE_OUTPUT" | awk -F= '$1 == "us_version" {print $2}') BUNDLED_UK_VERSION=$(printf '%s\n' "$BUNDLE_OUTPUT" | awk -F= '$1 == "uk_version" {print $2}') +BUNDLED_CORE_VERSION=$(printf '%s\n' "$BUNDLE_OUTPUT" | awk -F= '$1 == "policyengine_core_version" {print $2}') -if [[ -z "$BUNDLED_US_VERSION" || -z "$BUNDLED_UK_VERSION" ]]; then - echo "ERROR: Could not resolve bundled country package versions." >&2 +if [[ -z "$BUNDLED_CORE_VERSION" || -z "$BUNDLED_US_VERSION" || -z "$BUNDLED_UK_VERSION" ]]; then + echo "ERROR: Could not resolve bundled runtime package versions." >&2 echo "$BUNDLE_OUTPUT" >&2 exit 1 fi -echo "Bundled country pins:" +echo "Bundled runtime pins:" +echo " policyengine-core==${BUNDLED_CORE_VERSION}" echo " policyengine-us==${BUNDLED_US_VERSION}" echo " policyengine-uk==${BUNDLED_UK_VERSION}" -python3 - "$PYPROJECT" "$BUNDLED_US_VERSION" "$BUNDLED_UK_VERSION" <<'PY' +python3 - "$PYPROJECT" "$BUNDLED_CORE_VERSION" "$BUNDLED_US_VERSION" "$BUNDLED_UK_VERSION" <<'PY' import re import sys from pathlib import Path -pyproject_path, us_version, uk_version = sys.argv[1:] +pyproject_path, core_version, us_version, uk_version = sys.argv[1:] pyproject = Path(pyproject_path) text = pyproject.read_text(encoding="utf-8") pins = { + "policyengine-core": core_version, "policyengine-us": us_version, "policyengine-uk": uk_version, } diff --git a/projects/policyengine-api-simulation/fixtures/test_policyengine_package_update_scripts.py b/projects/policyengine-api-simulation/fixtures/test_policyengine_package_update_scripts.py index 77dd580c9..082e27f1f 100644 --- a/projects/policyengine-api-simulation/fixtures/test_policyengine_package_update_scripts.py +++ b/projects/policyengine-api-simulation/fixtures/test_policyengine_package_update_scripts.py @@ -22,7 +22,7 @@ def fake_repo(tmp_path: Path) -> Path: "\n".join( [ "[project]", - 'dependencies = ["policyengine==4.0.0", "policyengine-us==1.0.0", "policyengine-uk==2.0.0"]', + 'dependencies = ["policyengine==4.0.0", "policyengine-core==0.0.0", "policyengine-us==1.0.0", "policyengine-uk==2.0.0"]', ] ), encoding="utf-8", @@ -35,6 +35,10 @@ def fake_repo(tmp_path: Path) -> Path: 'version = "4.0.0"', "", "[[package]]", + 'name = "policyengine-core"', + 'version = "0.0.0"', + "", + "[[package]]", 'name = "policyengine-us"', 'version = "1.0.0"', "", @@ -124,6 +128,7 @@ def install_fake_uv( fake_bin: Path, *, log: Path, + bundled_core_version: str = "999.999.999", bundled_us_version: str = "1.1.0", bundled_uk_version: str = "2.1.0", ) -> None: @@ -135,7 +140,7 @@ def install_fake_uv( if [[ "$1" == "run" && "$2" == "python" && "$3" == "-m" && "$4" == "src.modal.utils.extract_bundle_versions" ]]; then echo "policyengine_version=4.1.0" - echo "policyengine_core_version=3.26.1" + echo "policyengine_core_version={bundled_core_version}" echo "us_version={bundled_us_version}" echo "us_data_version=1.10.0" echo "uk_version={bundled_uk_version}" diff --git a/projects/policyengine-api-simulation/pyproject.toml b/projects/policyengine-api-simulation/pyproject.toml index cd6f7b041..f1a9a6996 100644 --- a/projects/policyengine-api-simulation/pyproject.toml +++ b/projects/policyengine-api-simulation/pyproject.toml @@ -16,10 +16,10 @@ dependencies = [ "pydantic-settings (>=2.7.1,<3.0.0)", "opentelemetry-instrumentation-fastapi (>=0.51b0,<0.52)", "policyengine-fastapi", - "policyengine==4.18.3", - "policyengine-core==3.27.1", + "policyengine==4.18.5", + "policyengine-core==3.28.0", "policyengine-uk==2.89.2", - "policyengine-us==1.729.0", + "policyengine-us==1.745.0", "tables>=3.10.2", "modal>=0.73.0", "logfire>=3.0.0", diff --git a/projects/policyengine-api-simulation/tests/test_policyengine_package_update_scripts.py b/projects/policyengine-api-simulation/tests/test_policyengine_package_update_scripts.py index 6849c19f6..ba88d2241 100644 --- a/projects/policyengine-api-simulation/tests/test_policyengine_package_update_scripts.py +++ b/projects/policyengine-api-simulation/tests/test_policyengine_package_update_scripts.py @@ -128,7 +128,7 @@ def test_update_policyengine_package_opens_pr_for_existing_branch_without_open_p assert "--head auto/update-policyengine-4.1.0" in gh_calls -def test_update_policyengine_package_updates_py_and_bundled_country_pins( +def test_update_policyengine_package_updates_py_and_bundled_runtime_pins( fake_bin: Path, fake_repo: Path, tmp_path: Path ) -> None: git_log = tmp_path / "git.log" @@ -149,6 +149,7 @@ def test_update_policyengine_package_updates_py_and_bundled_country_pins( encoding="utf-8" ) assert "policyengine==4.1.0" in pyproject_text + assert "policyengine-core==999.999.999" in pyproject_text assert "policyengine-us==1.1.0" in pyproject_text assert "policyengine-uk==2.1.0" in pyproject_text uv_calls = uv_log.read_text(encoding="utf-8") diff --git a/projects/policyengine-api-simulation/uv.lock b/projects/policyengine-api-simulation/uv.lock index 38f4848cd..2cf1d0aac 100644 --- a/projects/policyengine-api-simulation/uv.lock +++ b/projects/policyengine-api-simulation/uv.lock @@ -1635,7 +1635,7 @@ name = "pexpect" version = "4.9.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "ptyprocess", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" }, + { name = "ptyprocess" }, ] sdist = { url = "https://files.pythonhosted.org/packages/42/92/cc564bf6381ff43ce1f4d06852fc19a2f11d180f23dc32d9588bee2f149d/pexpect-4.9.0.tar.gz", hash = "sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f", size = 166450, upload-time = "2023-11-25T09:07:26.339Z" } wheels = [ @@ -1675,7 +1675,7 @@ wheels = [ [[package]] name = "policyengine" -version = "4.18.3" +version = "4.18.5" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "diskcache" }, @@ -1689,14 +1689,14 @@ dependencies = [ { name = "pydantic" }, { name = "requests" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/de/13/0dd4f39d7ec5d14add10c08e4d61aad296831802edae526e1907fc023aec/policyengine-4.18.3.tar.gz", hash = "sha256:ed95cfea02770e62bc0945a9e88bcbc96c94bf1fc717162c194b33948564a089", size = 697659, upload-time = "2026-06-25T19:05:19.468Z" } +sdist = { url = "https://files.pythonhosted.org/packages/21/2c/5e600a757fd03e227b99009067c6e4e05c97c9d05cc1e28410f7a3fef9b5/policyengine-4.18.5.tar.gz", hash = "sha256:a4d484964856debd1ce18fcf71ac9957e8a4cf897a2bb2652953bd191695b8c7", size = 697884, upload-time = "2026-06-27T06:44:22.182Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7f/b9/b3651013363f71c90795c7fd11ae7eed2b9acb2bafeb743260b972f2d58b/policyengine-4.18.3-py3-none-any.whl", hash = "sha256:fe2adbb576c08acb874ad98b5b03b8c41c38f654cd41ad6ada14a32427774aa0", size = 211031, upload-time = "2026-06-25T19:05:17.906Z" }, + { url = "https://files.pythonhosted.org/packages/d7/b7/d2abead0bb24e497950b2e2cbd847c544c25d97dd4ad6c641084e6f754ed/policyengine-4.18.5-py3-none-any.whl", hash = "sha256:960469cec0ad47d85e64151c3c9cf0db6b38624b2bae66cedbd993ae32ee7a55", size = 211057, upload-time = "2026-06-27T06:44:20.607Z" }, ] [[package]] name = "policyengine-core" -version = "3.27.1" +version = "3.28.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "dpath" }, @@ -1716,9 +1716,9 @@ dependencies = [ { name = "standard-imghdr" }, { name = "wheel" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/15/28/cbc23d0c61d431cbfdbaea3f7a71b2230187ab2e57f1430a551598b39515/policyengine_core-3.27.1.tar.gz", hash = "sha256:21471e3f6e95b8d5c00babcb5a5d363fdc1cd4b02c338e5eb4c9da18e08b6a10", size = 484853, upload-time = "2026-06-11T18:18:36.753Z" } +sdist = { url = "https://files.pythonhosted.org/packages/69/bf/d870af03abe76a64249fe9e95d7561c99c0484af1d3f3ae3773caa1c57d8/policyengine_core-3.28.0.tar.gz", hash = "sha256:3ae894577d8c40cb6c6d0f7d1df8ccdce2ee46aecbe52de0604e0af7ed454ecb", size = 484615, upload-time = "2026-06-26T13:38:51.09Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/30/81/098994e62401e9ce0d799e3f01329ba4a8792599d17ae0ef67fff1ddd3ff/policyengine_core-3.27.1-py3-none-any.whl", hash = "sha256:dac7928b502baa56fd22956f089689faa4d7e04a21aab7f1f29b34961d684ef8", size = 238480, upload-time = "2026-06-11T18:18:35.203Z" }, + { url = "https://files.pythonhosted.org/packages/49/b6/efec8f49cc926cd8aa4f6767ae56d1d29e31fc42fc1efebed611cb8499c3/policyengine_core-3.28.0-py3-none-any.whl", hash = "sha256:069b83f76f636c138975ca85270500e47b81f191bc00da47090b237500eeabc0", size = 238479, upload-time = "2026-06-26T13:38:49.705Z" }, ] [[package]] @@ -1798,11 +1798,11 @@ requires-dist = [ { name = "openapi-python-client", marker = "extra == 'build'", specifier = ">=0.21.6" }, { name = "opentelemetry-instrumentation-fastapi", specifier = ">=0.51b0,<0.52" }, { name = "opentelemetry-instrumentation-sqlalchemy", specifier = ">=0.51b0,<0.52" }, - { name = "policyengine", specifier = "==4.18.3" }, - { name = "policyengine-core", specifier = "==3.27.1" }, + { name = "policyengine", specifier = "==4.18.5" }, + { name = "policyengine-core", specifier = "==3.28.0" }, { name = "policyengine-fastapi", editable = "../../libs/policyengine-fastapi" }, { name = "policyengine-uk", specifier = "==2.89.2" }, - { name = "policyengine-us", specifier = "==1.729.0" }, + { name = "policyengine-us", specifier = "==1.745.0" }, { name = "pydantic-settings", specifier = ">=2.7.1,<3.0.0" }, { name = "pyright", marker = "extra == 'build'", specifier = ">=1.1.401" }, { name = "pytest", marker = "extra == 'test'", specifier = ">=8.3.4" }, @@ -1829,7 +1829,7 @@ wheels = [ [[package]] name = "policyengine-us" -version = "1.729.0" +version = "1.745.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "microdf-python" }, @@ -1839,9 +1839,9 @@ dependencies = [ { name = "tables" }, { name = "tqdm" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/69/cb/b2efba2094a708cd71890d98d72b99394fabc5894a4cceec14381e03fa35/policyengine_us-1.729.0.tar.gz", hash = "sha256:ac05c4d621c7f848b0806effc14e913160d5d47d777eadced6bc18edf392d75c", size = 10373862, upload-time = "2026-06-14T18:05:25.747Z" } +sdist = { url = "https://files.pythonhosted.org/packages/3f/87/bb5e15d5e63208d6451393818f35a1824f8808e44d9a491ade601e59e20c/policyengine_us-1.745.0.tar.gz", hash = "sha256:7c93f8e7c46ef85fb50871f44bceed7da697400484fe79318db7b2d981c855c0", size = 10561674, upload-time = "2026-06-25T04:18:52.45Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b9/7d/778f92ae94997b00c3c9ac34b345f6c9333435f905670ee4eeb2f5e19809/policyengine_us-1.729.0-py3-none-any.whl", hash = "sha256:8d21d3f7c0e82a9415edffe8ea53939330a63d9c8f6bd334299bddb697cf2c00", size = 11905076, upload-time = "2026-06-14T18:05:21.806Z" }, + { url = "https://files.pythonhosted.org/packages/49/36/ef50de1108cd0e0b89a7820ac3262bda7701d5ac6d998c27e570e63b7b82/policyengine_us-1.745.0-py3-none-any.whl", hash = "sha256:2af30b694b681adca7c2e2bd695bbeb41c03769d9ae908f82f671f8502ce32d9", size = 12300884, upload-time = "2026-06-25T04:18:49.056Z" }, ] [[package]]