+
Skip to content

Conversation

PPsyrius
Copy link
Collaborator

@PPsyrius PPsyrius commented Oct 13, 2025

Proposed change

Add Western Sahara holidays (with ar, en_US, es, and fr l10n support).

We've finally have support for all ISO 3166 entities 🎉

Resolves #2657 .

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 13, 2025

Summary by CodeRabbit

  • New Features
    • Added Western Sahara holiday calendar (EH/ESH) with national and Islamic holidays.
    • Added multilingual names (ar, en_US, es, fr) and optional “estimated” labels for Islamic dates.
  • Documentation
    • Updated README: supported countries now 249; clarified ISO references and language handling; minor URL punctuation fix.
  • Tests
    • Added comprehensive tests for Western Sahara holidays and localizations.
  • Chores
    • Added locale translations and snapshot data for Western Sahara.

Walkthrough

Adds Western Sahara (EH/ESH): new country Holiday class with fixed and Islamic holidays, exports aliases, registers it, adds locale PO files (ar, en_US, es, fr), includes tests and snapshots, and updates README country count. No existing country logic modified.

Changes

Cohort / File(s) Summary
Country implementation & registration
holidays/countries/western_sahara.py, holidays/countries/__init__.py, holidays/registry.py
Added WesternSahara Holidays class (inherits IslamicHolidays), exported aliases EH/ESH, and registered western_sahara in COUNTRIES.
Locales
holidays/locale/ar/LC_MESSAGES/EH.po, holidays/locale/en_US/LC_MESSAGES/EH.po, holidays/locale/es/LC_MESSAGES/EH.po, holidays/locale/fr/LC_MESSAGES/EH.po
Added PO files for Western Sahara holiday names (Arabic placeholders; en_US, es, fr translations provided).
Tests
tests/countries/test_western_sahara.py
New test suite covering aliases, fixed-date holidays, Islamic holidays (with/without estimated), and localization checks.
Snapshots
snapshots/countries/EH_COMMON.json
Added snapshot data for Western Sahara holidays (2000–2050) used in regression tests.
Docs
README.md
Updated available countries count and refined country/language wording; added Western Sahara row and minor formatting edits.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • KJhellico

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Add Western Sahara holidays” succinctly and accurately captures the main change of the pull request by focusing on the addition of support for Western Sahara holidays, making it clear to reviewers what the core update entails.
Linked Issues Check ✅ Passed The pull request fully implements the primary objective of issue #2657 by adding a WesternSahara holiday class, registering it, providing localization files, snapshots, and tests, thereby delivering comprehensive holiday support for Western Sahara.
Out of Scope Changes Check ✅ Passed All modifications are focused on introducing Western Sahara holiday support, including code, localization, registry updates, snapshots, and tests, with no unrelated or out-of-scope changes detected.
Description Check ✅ Passed The description clearly outlines the addition of Western Sahara holidays complete with localization support and references the resolved issue, directly aligning with the content of the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (66a5f43) to head (26477b5).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #3003   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          305       306    +1     
  Lines        18041     18072   +31     
  Branches      2330      2332    +2     
=========================================
+ Hits         18041     18072   +31     

☔ 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.

KJhellico
KJhellico previously approved these changes Oct 14, 2025
Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

arkid15r
arkid15r previously approved these changes Oct 14, 2025
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaand done!
LGTM 👍

Thanks everyone for being part of this!

@arkid15r arkid15r added this pull request to the merge queue Oct 14, 2025
@arkid15r arkid15r removed this pull request from the merge queue due to a manual request Oct 14, 2025
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 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 104a084 and 26477b5.

📒 Files selected for processing (1)
  • README.md (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: KJhellico
PR: vacanza/holidays#2774
File: tests/countries/test_liberia.py:15-16
Timestamp: 2025-08-08T14:37:03.045Z
Learning: When adding a new country in vacanza/holidays, also re-export it in holidays/countries/__init__.py (e.g., from .liberia import Liberia, LR, LBR) so tests and users can import from holidays.countries consistently.
Learnt from: KJhellico
PR: vacanza/holidays#2820
File: holidays/countries/__init__.py:199-203
Timestamp: 2025-08-31T19:34:20.731Z
Learning: In Saint Helena, Ascension and Tristan da Cunha holidays implementation (holidays/countries/saint_helena_ascension_and_tristan_da_cunha.py), only three classes are defined: SaintHelenaAscensionAndTristanDaCunha (main class), SH (alias), and SHN (alias). There is no HolidaysSH class, despite it being referenced in the registry.py entry.
📚 Learning: 2025-03-26T08:55:08.917Z
Learnt from: PPsyrius
PR: vacanza/holidays#2362
File: holidays/ical.py:53-80
Timestamp: 2025-03-26T08:55:08.917Z
Learning: The holidays library intentionally limits language code support to ISO 639-1 and ISO 639-2 standards (2-3 letter language codes with optional region) to maintain consistency with other modules like `common_holidays` and `financial_holidays`, rather than implementing full RFC 5646 compliance.

Applied to files:

  • README.md
📚 Learning: 2025-06-09T19:39:38.818Z
Learnt from: KJhellico
PR: vacanza/holidays#2601
File: README.md:108-108
Timestamp: 2025-06-09T19:39:38.818Z
Learning: The correct way to count supported countries in the holidays library is by counting unique country module files in holidays/countries/ (excluding __init__.py) or by counting entries in the COUNTRIES registry, not by counting individual class definitions which include alias classes.

Applied to files:

  • README.md
🪛 LanguageTool
README.md

[grammar] ~60-~60: Use correct spacing
Context: ... Docs](https://holidays.readthedocs.io). ## Quick Start ``` python from datetime im...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~103-~103: There might be a mistake here.
Context: ...rg/wiki/List_of_ISO_3166_country_codes), the same used for domain names, and for ...

(QB_NEW_EN)


[grammar] ~104-~104: There might be a mistake here.
Context: ...e same used for domain names, and for a subdivision its [ISO 3166-2 code](https://en.wikipe...

(QB_NEW_EN_OTHER)


[grammar] ~104-~104: There might be a mistake here.
Context: ...s, and for a subdivision its [ISO 3166-2 code](https://en.wikipedia.org/wiki/ISO_...

(QB_NEW_EN)

⏰ 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). (1)
  • GitHub Check: Test Python 3.14 on windows-latest
🔇 Additional comments (1)
README.md (1)

102-114: Verify country count and apply grammar tweak

  • Confirm the actual count in COUNTRIES via:
    grep -E '^\s*"[a-z0-9_ ]+"\s*:' holidays/registry.py | wc -l
    If it’s not 249, update the README.
  • Change “the same used” to “the same as used” and add a comma after “subdivision”.
-The standard way to refer to a country is by using its [ISO 3166-1 alpha-2 code](…),
-the same used for domain names, and for a subdivision its [ISO 3166-2 code](…).
+The standard way to refer to a country is by using its [ISO 3166-1 alpha-2 code](…),
+the same as used for domain names, and for a subdivision, its [ISO 3166-2 code](…).

@arkid15r arkid15r added this pull request to the merge queue Oct 14, 2025
Merged via the queue into vacanza:dev with commit 0f97ba3 Oct 14, 2025
36 checks passed
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.

Add Western Sahara holidays

3 participants

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