+
Skip to content

Conversation

PPsyrius
Copy link
Collaborator

@PPsyrius PPsyrius commented Oct 9, 2025

Proposed change

  • Drops Python 3.9 support due to its impending EOL status as of October 2025 - I'm waiting for the final deprecation notice before marking this as ready.
  • Upgrades syntax to Python 3.10 standard (mainly PEP 604 and dropping importlib-metadata which is now built-in as importlib.metadata).
  • Remove zipp>=3.19.1 pinning in dev and test requirements (from what I understand, this was previously only used by importlib-metadata).

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

Summary by CodeRabbit

  • Chores
    • Dropped Python 3.9 support; minimum required version is now 3.10.
    • Updated tooling configs to target Python 3.10+.
  • Refactor
    • Modernized type hints across the codebase to use PEP 604 unions (X | None), with no functional changes.
    • Streamlined public API annotations for holiday utilities and exporters.
  • Tests
    • Updated CI/tox targets to Python 3.10–3.14.
    • Simplified test requirements (numpy constraints, removed legacy pins).
    • Cleaned up metadata imports for tests.

Walkthrough

Dropped Python 3.9 support and modernized many type hints to PEP 604 union syntax (A | B) across CI, tooling, core, calendars, groups, countries, scripts, and tests. Adjusted pyproject/tox/CI matrices and cleaned up unused typing imports. No runtime logic changes reported.

Changes

Cohort / File(s) Summary of changes
CI & tooling
\.github/workflows/ci-cd.yml, tox.ini, pyproject.toml, \.pre-commit-config.yaml, requirements/dev.txt, requirements/tests.txt
Removed Python 3.9 from CI/tox matrices; bumped requires-python to >=3.10; updated ruff/pyupgrade targets to py310; consolidated test dependency pins; removed zipp pin.
Core framework & utils
holidays/holiday_base.py, holidays/observed_holiday_base.py, holidays/utils.py, holidays/registry.py, holidays/ical.py, holidays/mixins/child_entity.py, holidays/observed_holiday_base.py
Replaced Optional/Union type hints with PEP 604 unions (`X
Calendars
holidays/calendars/* (e.g., balinese_saka.py, buddhist.py, burmese.py, chinese.py, hebrew.py, hindu.py, mandaean.py, mongolian.py, persian.py, sinhala.py, thai.py, tibetan.py)
Converted return/tuple annotations from Optional[...]/Union[...] to `date
Groups
holidays/groups/* (e.g., balinese_saka.py, buddhist.py, burmese.py, chinese.py, eastern.py, hebrew.py, hindu.py, mandaean.py, mongolian.py, persian.py, sinhala.py, thai.py, tibetan.py)
Migrated many internal helper and add* methods to PEP 604 unions for optional dates and union params (e.g., `int
Countries
holidays/countries/* (e.g., angola.py, guernsey.py, jersey.py, taiwan.py, united_kingdom.py, united_states.py)
Updated field and method annotations to use `
Scripts & misc
scripts/archive_links.py, tests/test_package.py
Updated script type hints from Optional[...] to `X

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • arkid15r
  • KJhellico

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Drop Python 3.9 support” directly reflects the pull request’s primary change of removing Python 3.9 compatibility and is both concise and specific, giving reviewers immediate clarity on the update.
Description Check ✅ Passed The description clearly outlines the removal of Python 3.9 support, the switch to Python 3.10 PEP 604 union syntax, and the elimination of the zipp pin and importlib-metadata dependency, which directly matches the changes in the diff and provides relevant context for reviewers.
Docstring Coverage ✅ Passed Docstring coverage is 81.25% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60d2a9c and cd48446.

📒 Files selected for processing (1)
  • holidays/holiday_base.py (14 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-04-08T14:46:10.656Z
Learnt from: KJhellico
PR: vacanza/holidays#2437
File: holidays/countries/bhutan.py:27-30
Timestamp: 2025-04-08T14:46:10.656Z
Learning: For country classes in the holidays library, there's no need to explicitly specify `supported_categories = (PUBLIC,)` when PUBLIC is the only category being used, as it's already the default category inherited from HolidayBase.

Applied to files:

  • holidays/holiday_base.py
🪛 Ruff (0.13.3)
holidays/holiday_base.py

205-205: Mutable class attributes should be annotated with typing.ClassVar

(RUF012)


235-235: Boolean-typed positional argument in function definition

(FBT001)


235-235: Boolean default positional argument in function definition

(FBT002)


236-236: Boolean-typed positional argument in function definition

(FBT001)


236-236: Boolean default positional argument in function definition

(FBT002)


798-798: Missing type annotation for *args

(ANN002)


957-957: Dynamically typed expressions (typing.Any) are disallowed in default

(ANN401)


957-957: Dynamically typed expressions (typing.Any) are disallowed in get

(ANN401)


1174-1174: Dynamically typed expressions (typing.Any) are disallowed in default

(ANN401)


1174-1174: Dynamically typed expressions (typing.Any) are disallowed in pop

(ANN401)

⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test docs build
  • GitHub Check: Build distribution
🔇 Additional comments (1)
holidays/holiday_base.py (1)

24-24: Remove unused Union import after completing migration.

Once the remaining Union usages on lines 385 and 1335 are migrated to PEP 604 syntax, this import can be removed.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

codecov bot commented Oct 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ad444fb) to head (cd48446).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2998   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          305       305           
  Lines        18039     18005   -34     
  Branches      2329      2329           
=========================================
- Hits         18039     18005   -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载