+
Skip to content

Conversation

arkid15r
Copy link
Collaborator

@arkid15r arkid15r commented Sep 28, 2025

Proposed change

This is a PoC for 3 no holiday entities we need to cover for ISO 3166-1 compliance:

I started it trying to optimize it by overriding HolidayBase::__init__ but then switched to keep it simpler approach and left as is for now. Any suggestions are welcome.

Resolves #2425 .
Resolves #2661 .
Resolves #2663 .

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 Sep 28, 2025

Summary by CodeRabbit

  • New Features
    • Added support for Bouvet Island (BV/BVT), British Indian Ocean Territory (IO/IOT), and Heard Island and McDonald Islands (HM/HMD). These currently list no holidays.
  • Documentation
    • Updated Available Countries table to include the new territories; total country codes now 248.
  • Tests
    • Added test coverage for the new territories and their aliases.

Walkthrough

Adds three uninhabited-territory providers (Bouvet Island BV/BVT, British Indian Ocean Territory IO/IOT, Heard Island and McDonald Islands HM/HMD) as NoHoliday providers: new country modules, exports and registry entries, a NoHolidayBase, README update, and unit tests confirming aliases and no holidays.

Changes

Cohort / File(s) Summary of changes
Docs update
README.md
Added Bouvet Island (BV), British Indian Ocean Territory (IO), and Heard Island and McDonald Islands (HM) to Available Countries table; updated total count from 245 to 248.
Country exports / registry
holidays/countries/__init__.py, holidays/registry.py
Registered and exported three new territory providers and their aliases: BouvetIsland (BV, BVT), BritishIndianOceanTerritory (IO, IOT), HeardIslandAndMcDonaldIslands (HM, HMD).
New country providers (no holidays)
holidays/countries/bouvet_island.py, holidays/countries/british_indian_ocean_territory.py, holidays/countries/heard_island_and_mcdonald_islands.py
Added provider classes subclassing NoHolidayBase and alias subclasses (BV/BVT, IO/IOT, HM/HMD); no holiday rules implemented.
Base class addition
holidays/no_holiday_base.py
Introduced NoHolidayBase (subclass of HolidayBase) with an empty _populate(year: int) to represent providers without holidays.
Unit tests
tests/countries/test_bouvet_island.py, tests/countries/test_british_indian_ocean_territory.py, tests/countries/test_heard_island_and_mcdonald_islands.py
Added tests verifying alias classes and asserting no holidays across years 1900–2049.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • KJhellico
  • PPsyrius

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly conveys the addition of country entries that have no holidays, directly reflecting the main change of introducing three no-holiday country modules.
Linked Issues Check ✅ Passed The implementation adds Bouvet Island, British Indian Ocean Territory, and Heard Island and McDonald Islands as NoHolidayBase subclasses with appropriate aliases and tests verifying absence of holidays, fulfilling the objectives of issues #2425, #2661, and #2663.
Out of Scope Changes Check ✅ Passed All changes including the new NoHolidayBase class, country modules, registry updates, README table entries, and tests directly support adding the no-holiday countries and none introduce unrelated functionality.
Description Check ✅ Passed The pull request description clearly explains the proof-of-concept for adding three no-holiday country entities to comply with ISO 3166-1 and links to the relevant issues, matching the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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 333d4f2 and d8432d6.

📒 Files selected for processing (8)
  • README.md (3 hunks)
  • holidays/countries/bouvet_island.py (1 hunks)
  • holidays/countries/british_indian_ocean_territory.py (1 hunks)
  • holidays/countries/heard_island_and_mcdonald_islands.py (1 hunks)
  • holidays/no_holiday_base.py (1 hunks)
  • tests/countries/test_bouvet_island.py (1 hunks)
  • tests/countries/test_british_indian_ocean_territory.py (1 hunks)
  • tests/countries/test_heard_island_and_mcdonald_islands.py (1 hunks)
🧰 Additional context used
🧠 Learnings (21)
📚 Learning: 2025-07-12T20:54:28.749Z
Learnt from: KJhellico
PR: vacanza/holidays#2719
File: README.md:108-108
Timestamp: 2025-07-12T20:54:28.749Z
Learning: In PR #2719 adding Faroe Islands, KJhellico confirmed that the country count in README.md should be updated from 213 to 214, making 214 the accurate total after this addition.

Applied to files:

  • README.md
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.

Applied to files:

  • tests/countries/test_bouvet_island.py
  • tests/countries/test_british_indian_ocean_territory.py
  • tests/countries/test_heard_island_and_mcdonald_islands.py
📚 Learning: 2025-09-18T03:19:23.722Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_algeria.py:28-30
Timestamp: 2025-09-18T03:19:23.722Z
Learning: In the vacanza/holidays project, tests now use self.start_year and self.end_year from the TestCase class instead of country-specific aliases (like DZ.start_year) for start_year and end_year references. This approach provides the test framework with better control over test year ranges rather than being tied to specific country start years.

Applied to files:

  • tests/countries/test_bouvet_island.py
  • tests/countries/test_british_indian_ocean_territory.py
  • tests/countries/test_heard_island_and_mcdonald_islands.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.

Applied to files:

  • tests/countries/test_bouvet_island.py
  • tests/countries/test_british_indian_ocean_territory.py
  • tests/countries/test_heard_island_and_mcdonald_islands.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.

Applied to files:

  • tests/countries/test_bouvet_island.py
  • tests/countries/test_british_indian_ocean_territory.py
  • tests/countries/test_heard_island_and_mcdonald_islands.py
📚 Learning: 2025-09-20T12:21:50.877Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_belgium.py:28-30
Timestamp: 2025-09-20T12:21:50.877Z
Learning: Belgium holidays implementation currently lacks a start_year attribute. In tests/countries/test_belgium.py, do not suggest adding test_no_holidays methods that rely on start_year until the start_year attribute is introduced to Belgium's holiday implementation.

Applied to files:

  • tests/countries/test_bouvet_island.py
  • holidays/no_holiday_base.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.

Applied to files:

  • tests/countries/test_bouvet_island.py
  • tests/countries/test_british_indian_ocean_territory.py
  • tests/countries/test_heard_island_and_mcdonald_islands.py
📚 Learning: 2025-08-08T14:37:03.045Z
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.

Applied to files:

  • tests/countries/test_bouvet_island.py
📚 Learning: 2025-09-14T06:39:32.896Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_switzerland.py:22-23
Timestamp: 2025-09-14T06:39:32.896Z
Learning: In tests/countries/test_switzerland.py, the cls.full_range = range(1970, 2050) is intentionally hard-coded rather than using CH.start_year until a proper test case refactor is completed for Switzerland's implementation.

Applied to files:

  • tests/countries/test_bouvet_island.py
📚 Learning: 2025-09-10T16:17:30.428Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_bosnia_and_herzegovina.py:21-24
Timestamp: 2025-09-10T16:17:30.428Z
Learning: Bosnia and Herzegovina holidays implementation currently lacks a start_year attribute. In tests/countries/test_bosnia_and_herzegovina.py, using cls.full_range = range(2000, 2050) is intentional to bound assertions and setup. Do not suggest replacing it with harness default full_range until start_year is introduced.

Applied to files:

  • tests/countries/test_bouvet_island.py
📚 Learning: 2025-09-25T08:56:22.473Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_azerbaijan.py:23-24
Timestamp: 2025-09-25T08:56:22.473Z
Learning: In the vacanza/holidays project's test framework, TestCase.setUpClass is designed to handle pre-existing cls.full_range attributes. If a test class manually sets cls.full_range before calling super().setUpClass(), the framework will use cls.full_range.start and cls.full_range.stop to set start_year and end_year, then use cls.full_range as the years parameter. This allows test classes to define custom year ranges when needed while still integrating with the framework.

Applied to files:

  • tests/countries/test_bouvet_island.py
📚 Learning: 2025-09-02T08:02:03.604Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/financial/test_ice_futures_europe.py:22-22
Timestamp: 2025-09-02T08:02:03.604Z
Learning: In the vacanza/holidays project, cls.full_range should only be introduced in financial test classes when there are test methods that actually iterate over or use the full year range. For test classes like ICEFuturesEurope that only have year-specific tests (e.g., test_2021, test_2022), using the range directly in setUpClass is preferred to avoid premature abstraction.

Applied to files:

  • tests/countries/test_bouvet_island.py
📚 Learning: 2025-09-17T09:07:56.459Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_paraguay.py:134-139
Timestamp: 2025-09-17T09:07:56.459Z
Learning: In the vacanza/holidays project, when testing holidays that start from a specific year (not the country's start_year), the standard pattern is to use `range(specific_year, self.end_year)` for the holiday dates and `assertNoHolidayName(name, range(self.start_year, specific_year))` for the gap period. Using `self.full_range` with year conditions like `if year >= specific_year` is not the established pattern and would be inconsistent with the codebase.

Applied to files:

  • tests/countries/test_bouvet_island.py
📚 Learning: 2025-09-14T16:03:13.558Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_barbados.py:21-23
Timestamp: 2025-09-14T16:03:13.558Z
Learning: In tests/countries/test_barbados.py, using years_non_observed=range(2000, 2024) is intentional because all observed holiday examples fall within 2001-2023, making this range appropriate for limiting testing to years where observed holidays actually exist in the test data.

Applied to files:

  • tests/countries/test_bouvet_island.py
  • tests/countries/test_british_indian_ocean_territory.py
📚 Learning: 2025-09-17T09:07:56.459Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_paraguay.py:134-139
Timestamp: 2025-09-17T09:07:56.459Z
Learning: In the vacanza/holidays project, for holidays that start from a specific year (not the country's start_year), the standard pattern is to use `range(specific_year, self.end_year)` rather than `self.full_range` with year conditions. This maintains consistency across the codebase and clearly separates the holiday period from the pre-holiday period using `assertNoHolidayName(name, range(self.start_year, specific_year))`.

Applied to files:

  • tests/countries/test_bouvet_island.py
📚 Learning: 2025-09-03T14:05:10.592Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_aruba.py:77-79
Timestamp: 2025-09-03T14:05:10.592Z
Learning: The assertNoHolidayName helper method in the vacanza/holidays test framework accepts both individual years (scalars) and iterables of years, making calls like assertNoHolidayName(name, AW.start_year, range(2023, 2050)) valid where AW.start_year is a single integer year.

Applied to files:

  • tests/countries/test_bouvet_island.py
📚 Learning: 2025-09-14T16:05:55.205Z
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_iran.py:28-28
Timestamp: 2025-09-14T16:05:55.205Z
Learning: In tests/countries/test_iran.py, using years=(self.start_year - 1, 2102) in the no-holiday test is intentional because Iran uses the Persian Calendar which has specific supported year range constraints, and 2102 represents the upper limit of the Persian Calendar's supported range, not just an arbitrary far-future date.

Applied to files:

  • tests/countries/test_bouvet_island.py
📚 Learning: 2025-06-14T11:04:31.180Z
Learnt from: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:57-60
Timestamp: 2025-06-14T11:04:31.180Z
Learning: In the holidays library, the base `HolidayBase._populate()` method already includes a guard clause that prevents holiday population methods like `_populate_public_holidays()` from being called when the year is before `start_year` or after `end_year`. Therefore, individual country implementations do not need to add their own guard clauses for years before independence or other start dates.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-03-30T20:18:46.006Z
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:24-26
Timestamp: 2025-03-30T20:18:46.006Z
Learning: In the holidays library, country classes do not directly implement `_populate()`. Instead, they implement specialized methods like `_populate_public_holidays()`, and the base class `HolidayBase` handles the orchestration by calling these specialized methods.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-04-25T20:27:59.086Z
Learnt from: KJhellico
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:85-92
Timestamp: 2025-04-25T20:27:59.086Z
Learning: The `_populate_observed` method in holiday classes should maintain the same signature as the parent class `ObservedHolidayBase`, even if specific child class implementations don't use all parameters.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-08-31T19:34:20.731Z
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.

Applied to files:

  • holidays/countries/heard_island_and_mcdonald_islands.py
🧬 Code graph analysis (7)
holidays/countries/bouvet_island.py (1)
holidays/no_holiday_base.py (1)
  • NoHolidayBase (16-21)
tests/countries/test_bouvet_island.py (4)
tests/common.py (4)
  • TestCase (31-370)
  • CommonCountryTests (426-431)
  • assertAliases (124-133)
  • assertNoHolidays (324-326)
holidays/countries/bouvet_island.py (3)
  • BouvetIsland (16-23)
  • BV (26-27)
  • BVT (30-31)
tests/countries/test_british_indian_ocean_territory.py (3)
  • setUpClass (21-23)
  • test_country_aliases (25-26)
  • test_no_holidays (28-29)
tests/countries/test_heard_island_and_mcdonald_islands.py (3)
  • setUpClass (25-27)
  • test_country_aliases (29-30)
  • test_no_holidays (32-33)
holidays/countries/british_indian_ocean_territory.py (1)
holidays/no_holiday_base.py (1)
  • NoHolidayBase (16-21)
holidays/no_holiday_base.py (1)
holidays/holiday_base.py (1)
  • HolidayBase (57-1297)
tests/countries/test_british_indian_ocean_territory.py (2)
tests/common.py (3)
  • TestCase (31-370)
  • assertAliases (124-133)
  • assertNoHolidays (324-326)
holidays/countries/british_indian_ocean_territory.py (3)
  • BritishIndianOceanTerritory (16-23)
  • IO (26-27)
  • IOT (30-31)
tests/countries/test_heard_island_and_mcdonald_islands.py (2)
tests/common.py (4)
  • TestCase (31-370)
  • CommonCountryTests (426-431)
  • assertAliases (124-133)
  • assertNoHolidays (324-326)
holidays/countries/heard_island_and_mcdonald_islands.py (3)
  • HeardIslandAndMcDonaldIslands (16-23)
  • HM (26-27)
  • HMD (30-31)
holidays/countries/heard_island_and_mcdonald_islands.py (1)
holidays/no_holiday_base.py (1)
  • NoHolidayBase (16-21)
⏰ 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: Build distribution
  • GitHub Check: Test docs build
🔇 Additional comments (7)
README.md (1)

108-108: LGTM!

Country count updated correctly to 248, and the three new territory entries are properly formatted and alphabetically placed.

Also applies to: 360-365, 374-379, 829-834

holidays/countries/heard_island_and_mcdonald_islands.py (1)

16-31: LGTM!

Implementation follows the established pattern for no-holiday territories with proper aliases and documentation.

tests/countries/test_bouvet_island.py (1)

19-29: LGTM!

Test structure follows project conventions and past review feedback has been addressed.

holidays/countries/bouvet_island.py (1)

16-31: LGTM!

Clean implementation following the no-holiday entity pattern with proper aliases.

holidays/countries/british_indian_ocean_territory.py (1)

16-31: LGTM!

Consistent implementation with proper documentation and alias structure.

tests/countries/test_british_indian_ocean_territory.py (1)

19-29: LGTM!

Test implementation follows established patterns and provides appropriate coverage.

tests/countries/test_heard_island_and_mcdonald_islands.py (1)

23-33: LGTM!

Test structure is consistent with project conventions and provides proper coverage for the no-holiday entity.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Ruff (0.13.3)
holidays/countries/bouvet_island.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to load configuration /ruff.toml
�[1mCause:�[0m Failed to parse /ruff.toml
�[1mCause:�[0m TOML parse error at line 26, column 3
|
26 | "RSE100", # Use of assert detected
| ^^^^^^^^
Unknown rule selector: RSE100

holidays/countries/british_indian_ocean_territory.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to load configuration /ruff.toml
�[1mCause:�[0m Failed to parse /ruff.toml
�[1mCause:�[0m TOML parse error at line 26, column 3
|
26 | "RSE100", # Use of assert detected
| ^^^^^^^^
Unknown rule selector: RSE100

tests/countries/test_british_indian_ocean_territory.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to load configuration /ruff.toml
�[1mCause:�[0m Failed to parse /ruff.toml
�[1mCause:�[0m TOML parse error at line 26, column 3
|
26 | "RSE100", # Use of assert detected
| ^^^^^^^^
Unknown rule selector: RSE100

  • 4 others

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.

@github-actions github-actions bot added the test label Sep 28, 2025
Copy link

codecov bot commented Sep 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c954f5e) to head (d8432d6).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2969   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          301       305    +4     
  Lines        17968     17996   +28     
  Branches      2321      2321           
=========================================
+ Hits         17968     17996   +28     

☔ 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
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: 1

📜 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 8273239 and 333d4f2.

📒 Files selected for processing (2)
  • README.md (3 hunks)
  • holidays/no_holiday_base.py (1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_belgium.py:28-30
Timestamp: 2025-09-20T12:21:50.877Z
Learning: Belgium holidays implementation currently lacks a start_year attribute. In tests/countries/test_belgium.py, do not suggest adding test_no_holidays methods that rely on start_year until the start_year attribute is introduced to Belgium's holiday implementation.
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.
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 the Saint Helena, Ascension and Tristan da Cunha implementation, there's a discrepancy between the registry.py entry (which references "HolidaysSH") and the actual implementation (which only defines SaintHelenaAscensionAndTristanDaCunha, SH, SHN, and SaintHelenaAscensionAndTristanDaCunhaStaticHolidays classes). The HolidaysSH class doesn't exist and according to the maintainer isn't needed.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_southern_territories.py:41-44
Timestamp: 2025-06-18T10:07:58.780Z
Learning: Territorial holiday classes that inherit from parent countries (like HolidaysAX from Finland, HolidaysSJ from Norway, HolidaysTF from France) follow a standard pattern of silently overriding self.subdiv in their _populate_public_holidays() method without validation, as this ensures they always use the correct subdivision code for their territory regardless of user input.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_saint_helena_ascension_and_tristan_da_cunha.py:209-209
Timestamp: 2025-09-14T17:17:14.387Z
Learning: In tests/countries/test_saint_helena_ascension_and_tristan_da_cunha.py, the explicit loop iteration pattern for subdivision-specific holiday checks (like Anniversary Day for TA subdivision) is intentionally preferred over using assertSubdivTa helper methods, as confirmed by PPsyrius.
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:17:53.342Z
Learning: In the Saint Vincent and the Grenadines holidays implementation, New Year's Day is added without observed rules using `_add_new_years_day()` and should not include observed rule testing in its test method. Only holidays explicitly wrapped with `_add_observed()` have observed behavior.
Learnt from: PPsyrius
PR: vacanza/holidays#2881
File: tests/countries/test_indonesia.py:221-223
Timestamp: 2025-09-28T05:42:12.755Z
Learning: In tests/countries/test_indonesia.py, the manual set inclusion checks using get_named and years_found for Lunar New Year (test_lunar_new_year) and Vesak Day (test_vesak_day) are intentional and should remain until both holidays get their own `{insert}_no_estimated` flags implemented, rather than using standard harness assertions like assertHolidayName/assertNoHolidayName.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
📚 Learning: 2025-06-21T16:30:12.749Z
Learnt from: KJhellico
PR: vacanza/holidays#2654
File: holidays/countries/cape_verde.py:1-12
Timestamp: 2025-06-21T16:30:12.749Z
Learning: The holidays project does not use module docstrings in country holiday files. All country files start directly with the copyright header comment block without module docstrings, maintaining a consistent coding style across the project.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-06-16T11:42:28.293Z
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-06-22T21:33:17.854Z
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: holidays/countries/libya.py:1-1
Timestamp: 2025-06-22T21:33:17.854Z
Learning: In the holidays library, country files do not use module docstrings. The established pattern is: license header comment block, imports, then class definitions with class docstrings. Module docstrings should not be added to country files as they don't follow this convention.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-06-01T17:58:53.279Z
Learnt from: KJhellico
PR: vacanza/holidays#2583
File: holidays/countries/niger.py:1-1
Timestamp: 2025-06-01T17:58:53.279Z
Learning: In the holidays project, module-level docstrings are not required or needed for country holiday files in the holidays/countries/ directory.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-06-16T15:48:48.680Z
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:1-12
Timestamp: 2025-06-16T15:48:48.680Z
Learning: Test files in the holidays repository follow a standardized structure without module or class docstrings. All country test files use the same pattern: license header, imports, and class definition (`class Test{Country}(CommonCountryTests, TestCase):`) without docstrings. This is an established codebase convention that should be maintained for consistency.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-06-19T05:54:49.792Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_polynesia.py:1-12
Timestamp: 2025-06-19T05:54:49.792Z
Learning: The holidays library uses a standard file header format across all country implementation files consisting of a comprehensive comment block with project description, authors, website, and license information. Country files do not use module-level docstrings but instead rely on this header format followed by class-level docstrings.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-06-10T12:43:10.577Z
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/calendars/mongolian.py:1-1
Timestamp: 2025-06-10T12:43:10.577Z
Learning: The holidays project's calendar files (in holidays/calendars/) follow a consistent pattern of NOT having module-level docstrings. They only use class-level docstrings for their main classes. When reviewing calendar files, maintain this consistency and do not suggest adding module docstrings.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-04-26T19:55:09.581Z
Learnt from: KJhellico
PR: vacanza/holidays#2501
File: scripts/docs/gen_index.py:1-12
Timestamp: 2025-04-26T19:55:09.581Z
Learning: The holidays project uses a standard header for all Python (.py) files in the repository that describes the overall holidays library, including authors, website and license information, regardless of the specific purpose of individual script files.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-06-15T15:24:53.055Z
Learnt from: KJhellico
PR: vacanza/holidays#2606
File: holidays/countries/faroe_islands.py:62-67
Timestamp: 2025-06-15T15:24:53.055Z
Learning: The `HolidayBase` class uses `__getattr__` to dynamically implement `_add_holiday_*` methods through pattern matching, including patterns like `_add_holiday_<n>_days_past_easter`, `_add_holiday_<month>_<day>`, and various weekday-relative patterns. Methods like `_add_holiday_26_days_past_easter` are not explicitly defined but are dynamically generated when called.

Applied to files:

  • holidays/no_holiday_base.py
📚 Learning: 2025-07-12T20:54:28.749Z
Learnt from: KJhellico
PR: vacanza/holidays#2719
File: README.md:108-108
Timestamp: 2025-07-12T20:54:28.749Z
Learning: In PR #2719 adding Faroe Islands, KJhellico confirmed that the country count in README.md should be updated from 213 to 214, making 214 the accurate total after this addition.

Applied to files:

  • README.md
📚 Learning: 2025-06-06T16:02:09.910Z
Learnt from: KJhellico
PR: vacanza/holidays#2606
File: README.md:562-568
Timestamp: 2025-06-06T16:02:09.910Z
Learning: The README.md country table displays ISO 3166-1 alpha-2 codes only in the "Code" column. Alpha-3 codes or country aliases should not be included in this table format, maintaining consistency with all other country entries.

Applied to files:

  • README.md
🧬 Code graph analysis (1)
holidays/no_holiday_base.py (1)
holidays/holiday_base.py (1)
  • HolidayBase (57-1297)
⏰ 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.13 on windows-latest
🔇 Additional comments (4)
README.md (4)

108-120: Count bump looks good.

Nice to see the total refreshed to 248 right alongside the new providers.


360-365: Bouvet Island row lands perfectly.

Placement, formatting, and blank fields line up with the established pattern.


374-379: British Indian Ocean Territory entry reads clean.

Everything mirrors the no-holiday template—no tweaks needed.


829-834: Heard Island and McDonald Islands entry checks out.

Alphabetical slotting and empty fields look right on target.

arkid15r and others added 2 commits October 5, 2025 14:53
Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>
Copy link

sonarqubecloud bot commented Oct 5, 2025

Copy link
Collaborator Author

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

PTAL

@arkid15r arkid15r requested a review from KJhellico October 5, 2025 22:10
@arkid15r arkid15r marked this pull request as ready for review October 5, 2025 22:15
@arkid15r arkid15r requested a review from PPsyrius as a code owner October 5, 2025 22:16
Copy link
Collaborator

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

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

LGTM 🌐

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 added this pull request to the merge queue Oct 6, 2025
Merged via the queue into vacanza:dev with commit ffccf0c Oct 6, 2025
36 checks passed
@arkid15r arkid15r deleted the ark/empty-entities-poc branch October 6, 2025 17:30
@arkid15r arkid15r mentioned this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add British Indian Ocean Territory holidays Heard Island and McDonald Islands holidays Add Bouvet Island holidays

3 participants

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