Drop Python 3.9 support (cleanup checklist)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- python
- 領域
- build-system, ci-cd, tooling
調査の方向性
4つのリポジトリの pyproject.toml ファイルと CI マトリックスから始め、次に記載されている Python ファイルと policyengine.py の Ruff および mypy の設定を調べます。条件付き項目を変更する前に、依存関係のバージョンと既存の 3.9 互換対応を確認してください。4つすべてのリポジトリが Python 3.10+ をサポートし、CI がグリーンで、新しい 3.10 環境から us および uk extras をインストールできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Trigger
File when all confirmed 3.9 users (currently: Census) have migrated to 3.10+.
Background
Supporting 3.9 across the stack required working around non-trivial syntax and dependency cruft in four repos. ~95% of the cruft is 3.9-specific — dropping 3.9 alone recovers most of it, even if 3.10 support remains (3.10 hits EOL Oct 2026, ~6 months out, so keeping it through natural life is cheap).
Landed as: PolicyEngine/policyengine-core#454, PolicyEngine/policyengine-us#8035, PolicyEngine/policyengine-uk#1625, PolicyEngine/policyengine.py#278.
Checklist
All 4 repos
-
pyproject.toml: raiserequires-pythonfrom>=3.9to>=3.10 - Remove
Programming Language :: Python :: 3.9classifier - Remove
"3.9"from all CI Python matrices
policyengine-core (PolicyEngine/policyengine-core)
- Remove numpy env marker; go back to single
numpy>=2.1.0,<3(2.1+ supports 3.10+) - Hand-revert
Optional[X]/Tuple[X]→X | None/tuple[X]inpolicyengine_core/tools/hugging_face.pyandpolicyengine_core/tools/google_cloud.py(~5 sites; this repo's ruff config doesn't have UP rules enabled)
policyengine-us (PolicyEngine/policyengine-us)
- Remove
[tool.uv] environmentsblock inpyproject.tomlif it still exists (likely already gone once downstream core picks up 3.9-compat release) - Hand-revert
Optional[X]→X | Nonein:policyengine_us/system.py,data/economic_assumptions.py,data/dataset_schema.py,tests/core/test_payroll_contributions.py,tests/microsimulation/data/fixtures/test_extend_single_year_dataset.py(5 sites) - Regenerate
uv.lock
policyengine-uk (PolicyEngine/policyengine-uk)
- Remove
[tool.uv] environmentsblock (if still present) - Hand-revert 3 sites in
policyengine_uk/data/dataset_schema.pyandpolicyengine_uk/simulation.py -
policyengine_uk/tests/test_build_metadata.py: revertExitStackback to parenthesizedwith (a, b, c): -
[tool.ruff] target-version = "py39"→"py310" - Regenerate
uv.lock
policyengine.py (this repo)
-
pyproject.toml:[tool.ruff] target-version = "py39"→"py310"[tool.mypy] python_version = "3.9"→"3.10"- Remove
UP006,UP007,UP035,UP045from[tool.ruff.lint] ignore
- Auto-revert ~210 annotation sites:
ruff check --fix --unsafe-fixes .— this re-applies UP045 (Optional[X]→X | None), UP007 (Union[X, Y]→X | Y), UP006/UP035 (List→list). - Hand-revert the two discriminated-union sites ruff's UP rules don't cover:
src/policyengine/core/scoping_strategy.py:222(insideAnnotated[]) andsrc/policyengine/core/region.py:18(module-level type alias). - Simplify
Python-CompatCI job in.github/workflows/pr_code_changes.yaml— drop the explicith5pyinstall (needed becausescoping_strategy.pyimports it but extras weren't available; once[us]/[uk]extras are bumped to versions that pull h5py via core, it's redundant). - Bump
[us]/[uk]/[dev]extras offpolicyengine-us==1.602.0/policyengine-uk==2.74.0to versions that don't pin 3.11+ themselves (separate follow-up from this cleanup — may already be bumped by the time this issue is actioned).
Not in scope
Keep until 3.10 EOL (October 2026):
class Foo(str, Enum)pattern (4 files:outputs/{aggregate,change_aggregate,inequality,poverty}.py) — StrEnum is 3.11+timezone.utcincore/tax_benefit_model_version.py—datetime.UTCis 3.11+- Gotcha when
StrEnumreturns:str(Foo.X)differs —StrEnumreturns"x",(str, Enum)returns"Foo.X". Audit any code relying onstr()of enum members before reverting.
Keep until 3.12 EOL (October 2028):
TypeVar+Generic[T]pattern incore/cache.pyandcore/output.py— PEP 695class Foo[T]is 3.12+.
Verification
After cleanup, each repo's CI should be green with reduced matrix (3.10+). Cross-repo smoke: pip install policyengine[us] and pip install policyengine[uk] succeed on 3.10 in a fresh venv.
- 主要言語
- Python
- スター
- 8
- フォーク
- 10
- 平均マージ
- 12時間 26分
- マージ済み PR(30日)
- 22
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PolicyEngine/policyengine.py のほかの issue
-
Raise the simulation cache memory warning to 16 GiB対応中かも @anth-volk が 13 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
PolicyEngine/policyengine.py#549 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
PolicyEngine/policyengine.py#473 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PolicyEngine/policyengine.py#436 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Certify populace-uk as the UK certified default再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
PolicyEngine/policyengine.py#408 ·
メンテナーはふだん 1 日以内に返信
-
Temporarily supply the certified SPM independence role for ACS-local ASEC and PUF records対応中かも @anth-volk が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
PolicyEngine/policyengine.py#598 ·
メンテナーはふだん 1 日以内に返信
PolicyEngine/policyengine.py の issue をすべて見る
似ている issue
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunk対応中かも @rodricksz4h5 が今日担当しました。 オープンarea/streaming comp/gateway P2 type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#138245 ·
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS step対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
correction metadata
難易度 2/5 1時間未満 初心者へのやさしさ 68/100
acl-org/acl-anthology#10378 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom name対応中かも @12YYCCYY16 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
prowler-cloud/prowler#13033 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
graygarbage/HermesKey#23 ·