-
-
Notifications
You must be signed in to change notification settings - Fork 554
Add Mauritius holidays #2643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Mauritius holidays #2643
Conversation
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughMauritius holiday support was added, including a new country module, localizations, registry entry, and comprehensive tests. Documentation was updated to reflect the addition, and all relevant files were modified or created to support Mauritius holidays and their localization. Changes
Assessment against linked issues
Suggested reviewers
✨ Finishing Touches
🧪 Generate Unit Tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #2643 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 246 247 +1
Lines 15063 15114 +51
Branches 2069 2071 +2
=========================================
+ Hits 15063 15114 +51 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
🔭 Outside diff range comments (1)
holidays/locale/en_MU/LC_MESSAGES/MU.po (1)
29-101
: Populate msgstr entries. All translation strings (msgstr
) are empty, which will lead to blank outputs. Please fill eachmsgstr
—for en_MU you can mirror themsgid
or adjust British spellings as needed.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
README.md
(2 hunks)holidays/countries/__init__.py
(1 hunks)holidays/countries/mauritius.py
(1 hunks)holidays/locale/en_MU/LC_MESSAGES/MU.po
(1 hunks)holidays/locale/en_US/LC_MESSAGES/MU.po
(1 hunks)holidays/registry.py
(1 hunks)tests/countries/test_mauritius.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
holidays/locale/en_MU/LC_MESSAGES/MU.po (1)
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.
holidays/locale/en_US/LC_MESSAGES/MU.po (1)
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.
🪛 Pylint (3.3.7)
holidays/countries/mauritius.py
[convention] 40-40: Line too long (129/100)
(C0301)
[convention] 41-41: Line too long (146/100)
(C0301)
[convention] 54-54: Line too long (116/100)
(C0301)
[convention] 55-55: Line too long (117/100)
(C0301)
[convention] 56-56: Line too long (133/100)
(C0301)
[convention] 192-192: Line too long (129/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[refactor] 28-28: Too many ancestors (8/7)
(R0901)
[convention] 136-136: Missing class docstring
(C0115)
[refactor] 136-136: Too many ancestors (9/7)
(R0901)
[convention] 140-140: Missing class docstring
(C0115)
[refactor] 140-140: Too many ancestors (9/7)
(R0901)
[convention] 144-144: Missing class docstring
(C0115)
[convention] 171-171: Missing class docstring
(C0115)
[refactor] 187-187: Too few public methods (0/2)
(R0903)
tests/countries/test_mauritius.py
[convention] 1-1: Missing module docstring
(C0114)
[convention] 20-20: Missing class docstring
(C0115)
[warning] 22-22: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestMauritius.setUpClass' method
(W0221)
[convention] 27-27: Missing function or method docstring
(C0116)
[convention] 30-30: Missing function or method docstring
(C0116)
[convention] 33-33: Missing function or method docstring
(C0116)
[convention] 41-41: Missing function or method docstring
(C0116)
[convention] 45-45: Missing function or method docstring
(C0116)
[convention] 49-49: Missing function or method docstring
(C0116)
[convention] 53-53: Missing function or method docstring
(C0116)
[convention] 57-57: Missing function or method docstring
(C0116)
[convention] 61-61: Missing function or method docstring
(C0116)
[convention] 66-66: Missing function or method docstring
(C0116)
[convention] 70-70: Missing function or method docstring
(C0116)
[convention] 77-77: Missing function or method docstring
(C0116)
[convention] 81-81: Missing function or method docstring
(C0116)
[convention] 93-93: Missing function or method docstring
(C0116)
[convention] 105-105: Missing function or method docstring
(C0116)
[convention] 117-117: Missing function or method docstring
(C0116)
[convention] 129-129: Missing function or method docstring
(C0116)
[convention] 141-141: Missing function or method docstring
(C0116)
[convention] 153-153: Missing function or method docstring
(C0116)
[convention] 165-165: Missing function or method docstring
(C0116)
[convention] 185-185: Missing function or method docstring
(C0116)
[convention] 204-204: Missing function or method docstring
(C0116)
[refactor] 20-20: Too many public methods (23/20)
(R0904)
⏰ Context from checks skipped due to timeout of 300000ms (1)
- GitHub Check: Test Python 3.13 on windows-latest
🔇 Additional comments (18)
README.md (2)
108-108
: Confirm country count update. The supported countries count was updated to 192 to include Mauritius. This aligns with the new registry entry.
927-932
: Mauritius entry added correctly. The row for Mauritius (MU) is positioned alphabetically, with supported languages and no subdivisions or categories.holidays/registry.py (1)
134-134
: Add Mauritius to country registry. The key"mauritius"
with("Mauritius", "MU", "MUS")
is correctly added in alphabetical order.holidays/countries/__init__.py (1)
131-131
: Import Mauritius module. The importfrom holidays.countries.mauritius import Mauritius, MU, MUS
is inserted in the correct alphabetical position.holidays/locale/en_MU/LC_MESSAGES/MU.po (1)
15-28
: Check metadata headers. The PO file header metadata (version, language, creation date) follow the standard format.holidays/locale/en_US/LC_MESSAGES/MU.po (2)
15-28
: Validate metadata. The header correctly specifiesLanguage: en_US
and references the source language en_MU.
29-101
: ```shell
#!/bin/bashSearch for references to the original and translated holiday names in tests or code
rg -n '"Labour Day"' -A3
rg -n '"Labor Day"' -A3
rg -n '"Divali"' -A3
rg -n '"Diwali"' -A3</details> <details> <summary>tests/countries/test_mauritius.py (5)</summary> `20-26`: **Solid test setup and comprehensive coverage** The test class setup is well-structured with proper year range coverage and Islamic estimation handling. The comprehensive test suite covers all holidays effectively. --- `61-75`: **Well-implemented conditional holiday logic tests** The tests correctly validate the alternating year patterns for Assumption Day (even years from 2016) and All Saints' Day (odd years or before 2016). The logic properly handles the edge cases. --- `93-103`: **Robust Islamic holiday testing with estimation support** Good approach testing Eid-ul-Fitr with both estimated and non-estimated instances to ensure the Islamic calendar integration works correctly. --- `165-183`: **Comprehensive annual validation test** The 2024 test provides excellent full-year validation, ensuring all holidays are correctly calculated and named for a complete year. --- `204-222`: **Thorough localization testing** The en_US localization test validates proper translation of holiday names, including the subtle differences like "Thaipusam" vs "Thaipoosam Cavadee" and "Labor Day" vs "Labour Day". </details> <details> <summary>holidays/countries/mauritius.py (6)</summary> `28-82`: **Excellent class design with comprehensive mixin integration** The Mauritius class is well-architected, properly inheriting from all necessary holiday mixins and correctly initializing each with appropriate custom classes. The constructor parameter for Islamic estimation is a thoughtful addition. --- `37-58`: **Outstanding documentation with authoritative references** The docstring provides comprehensive background with proper legal references and helpful notes about implementation decisions. The explanation of why 1988 is the start year and the rationale for holiday mappings adds valuable context. --- `100-110`: **Clean implementation of conditional holiday logic** The conditional logic for alternating holidays (Assumption Day for even years from 2016, All Saints' Day for odd years or before 2016) is implemented clearly and matches the test expectations perfectly. --- `144-169`: **Well-structured custom Hindu holidays with accurate dates** The MauritiusHinduHolidays class properly extends the custom calendar with Mauritius-specific dates for Ganesh Chaturthi and Thaipusam, backed by authoritative timeanddate.com references. --- `171-185`: **Properly implemented custom Islamic holidays** The MauritiusIslamicHolidays class correctly overrides Eid al-Fitr dates with Mauritius-specific observances, properly referenced to timeanddate.com. --- `187-203`: **Well-documented static holidays implementation** The special public holidays for 2019 are properly implemented with clear gazette notification references. Good use of the StaticHolidays base class. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
There was a problem hiding this 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: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
holidays/countries/mauritius.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/mauritius.py (1)
Learnt from: KJhellico
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:149-154
Timestamp: 2025-06-09T19:50:56.039Z
Learning: In the holidays library project, never suggest adding docstrings for alias classes (like NR, NRU country code aliases that inherit from main country classes). The project deliberately omits docstrings for these simple alias classes.
🪛 Pylint (3.3.7)
holidays/countries/mauritius.py
[convention] 40-40: Line too long (172/100)
(C0301)
[convention] 41-41: Line too long (188/100)
(C0301)
[convention] 51-51: Line too long (122/100)
(C0301)
[convention] 52-52: Line too long (112/100)
(C0301)
[convention] 53-53: Line too long (112/100)
(C0301)
[convention] 54-54: Line too long (159/100)
(C0301)
[convention] 55-55: Line too long (160/100)
(C0301)
[convention] 56-56: Line too long (176/100)
(C0301)
[convention] 57-57: Line too long (125/100)
(C0301)
[convention] 192-192: Line too long (172/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[refactor] 28-28: Too many ancestors (8/7)
(R0901)
[convention] 136-136: Missing class docstring
(C0115)
[refactor] 136-136: Too many ancestors (9/7)
(R0901)
[convention] 140-140: Missing class docstring
(C0115)
[refactor] 140-140: Too many ancestors (9/7)
(R0901)
[convention] 144-144: Missing class docstring
(C0115)
[convention] 171-171: Missing class docstring
(C0115)
[refactor] 187-187: Too few public methods (0/2)
(R0903)
⏰ Context from checks skipped due to timeout of 300000ms (1)
- GitHub Check: Test Python 3.13 on windows-latest
🔇 Additional comments (4)
holidays/countries/mauritius.py (4)
28-83
: Excellent implementation following project patterns.This comprehensive class definition properly inherits from all necessary holiday mixins and includes thorough documentation with authoritative references. The conditional initialization parameters and proper parent class initialization demonstrate solid architecture.
100-110
: Smart conditional logic for alternating holidays.The year-based conditions for Assumption of Mary (even years from 2016) and All Saints' Day (odd years or pre-2016) are well-implemented and clearly documented in the references.
136-141
: Alias classes correctly implemented.Per project standards, these simple inheritance aliases appropriately omit docstrings, maintaining consistency with the established codebase patterns.
187-203
: Well-documented static holidays implementation.The special holidays class includes proper documentation and references for the gazette notifications. Good work maintaining traceability to official sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very impeccable implementation as always 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great work! 👍 Just a few technical suggestions:
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com> Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com> Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
There was a problem hiding this 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
♻️ Duplicate comments (1)
holidays/locale/en_US/LC_MESSAGES/MU.po (1)
62-65
: Consider if this needs simplification.Past review comments suggested using just "Assumption Day" for en_US locale instead of the full "Assumption of the Blessed Virgin Mary". However, the current translation aligns with the learned pattern that "Assumption Day" is standard for American English.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
holidays/countries/mauritius.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/MU.po
(1 hunks)tests/countries/test_mauritius.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
holidays/locale/en_US/LC_MESSAGES/MU.po (2)
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/locale/en_US/LC_MESSAGES/GN.po:56-56
Timestamp: 2025-04-01T18:46:16.152Z
Learning: In the holidays library, "Assumption Day" is the standard name used for the holiday "Assomption de Marie" in American English (en_US) locale, without the explicit reference to Mary that exists in the French name.
tests/countries/test_mauritius.py (1)
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.
holidays/countries/mauritius.py (3)
Learnt from: KJhellico
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:149-154
Timestamp: 2025-06-09T19:50:56.039Z
Learning: In the holidays library project, never suggest adding docstrings for alias classes (like NR, NRU country code aliases that inherit from main country classes). The project deliberately omits docstrings for these simple alias classes.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:171-184
Timestamp: 2025-06-19T02:34:14.456Z
Learning: In the holidays library, `_CustomIslamicHolidays` subclasses follow a consistent pattern of NOT having docstrings. They go directly to defining date dictionaries, as evidenced by Malaysia, Singapore, UAE, and dozens of other country implementations.
🪛 Pylint (3.3.7)
tests/countries/test_mauritius.py
[convention] 1-1: Missing module docstring
(C0114)
[convention] 20-20: Missing class docstring
(C0115)
[warning] 22-22: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestMauritius.setUpClass' method
(W0221)
[convention] 27-27: Missing function or method docstring
(C0116)
[convention] 30-30: Missing function or method docstring
(C0116)
[convention] 33-33: Missing function or method docstring
(C0116)
[convention] 36-36: Missing function or method docstring
(C0116)
[convention] 39-39: Missing function or method docstring
(C0116)
[convention] 43-43: Missing function or method docstring
(C0116)
[convention] 47-47: Missing function or method docstring
(C0116)
[convention] 51-51: Missing function or method docstring
(C0116)
[convention] 55-55: Missing function or method docstring
(C0116)
[convention] 60-60: Missing function or method docstring
(C0116)
[convention] 64-64: Missing function or method docstring
(C0116)
[convention] 71-71: Missing function or method docstring
(C0116)
[convention] 75-75: Missing function or method docstring
(C0116)
[convention] 87-87: Missing function or method docstring
(C0116)
[convention] 99-99: Missing function or method docstring
(C0116)
[convention] 111-111: Missing function or method docstring
(C0116)
[convention] 123-123: Missing function or method docstring
(C0116)
[convention] 135-135: Missing function or method docstring
(C0116)
[convention] 147-147: Missing function or method docstring
(C0116)
[convention] 159-159: Missing function or method docstring
(C0116)
[convention] 179-179: Missing function or method docstring
(C0116)
[convention] 198-198: Missing function or method docstring
(C0116)
[refactor] 20-20: Too many public methods (23/20)
(R0904)
holidays/countries/mauritius.py
[convention] 40-40: Line too long (172/100)
(C0301)
[convention] 41-41: Line too long (188/100)
(C0301)
[convention] 46-46: Line too long (102/100)
(C0301)
[convention] 47-47: Line too long (109/100)
(C0301)
[convention] 48-48: Line too long (159/100)
(C0301)
[convention] 49-49: Line too long (160/100)
(C0301)
[convention] 50-50: Line too long (176/100)
(C0301)
[convention] 51-51: Line too long (125/100)
(C0301)
[convention] 185-185: Line too long (187/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[refactor] 28-28: Too many ancestors (8/7)
(R0901)
[convention] 130-130: Missing class docstring
(C0115)
[refactor] 130-130: Too many ancestors (9/7)
(R0901)
[convention] 134-134: Missing class docstring
(C0115)
[refactor] 134-134: Too many ancestors (9/7)
(R0901)
[convention] 138-138: Missing class docstring
(C0115)
[convention] 165-165: Missing class docstring
(C0115)
[refactor] 181-181: Too few public methods (0/2)
(R0903)
🪛 Ruff (0.11.9)
holidays/countries/mauritius.py
46-46: Line too long (102 > 99)
(E501)
47-47: Line too long (109 > 99)
(E501)
🪛 GitHub Actions: CI/CD
holidays/countries/mauritius.py
[error] 46-46: Ruff: Line too long (102 > 99) (E501)
[error] 47-47: Ruff: Line too long (109 > 99) (E501)
🔇 Additional comments (14)
holidays/locale/en_US/LC_MESSAGES/MU.po (2)
50-57
: Good localization work.The American English spellings are correct and consistent with past review feedback. The translation from "Labour Day" to "Labor Day" and "Labourers" to "Laborers" properly reflects American English conventions.
74-97
: Excellent standardization of religious holiday names.The translations properly standardize the holiday names for American English: "Thaipusam", "Maha Shivaratri", "Ugadi", "Diwali", and "Eid al-Fitr" are the correct conventional spellings used in American English contexts.
tests/countries/test_mauritius.py (6)
20-26
: Solid test foundation.The test setup correctly initializes the years range and creates an instance without estimated Islamic holidays for testing. The structure follows established project patterns.
33-35
: Good coverage of special holidays.The test correctly verifies the two special public holidays declared in 2019. This matches the implementation and historical records.
55-59
: Conditional holiday logic is correctly tested.The test properly validates that Assumption Day occurs only on even years from 2016 onward, matching the implementation logic. The dual assertion pattern ensures both presence and absence are verified.
64-70
: Complex conditional logic properly tested.The All Saints' Day test correctly handles the complex condition: present before 2016 and on odd years from 2017 onward, absent on even years from 2016 onward. The range logic is sound.
159-178
: Comprehensive year validation.The 2024 test provides excellent coverage by validating all expected holidays for a specific year, ensuring the complete implementation works together correctly.
198-217
: Localization testing is thorough.The en_US localization test properly validates that all holiday names are correctly translated, including the standardized religious holiday names and American English spellings.
holidays/countries/mauritius.py (6)
94-97
: Conditional holiday logic is correct.The implementation properly handles Assumption Day only on even years from 2016 onward, matching the legal requirements and test expectations.
101-104
: All Saints' Day logic correctly implemented.The condition
self._year <= 2015 or self._year % 2 != 0
properly implements the rule: before 2016 or on odd years from 2017 onward.
130-136
: Alias classes follow project conventions.The MU and MUS alias classes correctly omit docstrings, following the established project pattern for simple country code aliases.
138-163
: Custom Hindu holiday dates properly implemented.The custom date overrides for Ganesh Chaturthi and Thaipusam provide specific dates for Mauritius, with proper documentation references. The implementation follows project patterns without unnecessary docstrings.
165-179
: Islamic holiday overrides are well-structured.The Eid al-Fitr date overrides provide accurate local dates for Mauritius from 2016-2025, following the established pattern for custom Islamic holiday classes.
181-197
: Static holidays class properly documented.Unlike the custom calendar holiday classes, this static holidays class appropriately includes a docstring since it defines special one-off holidays with specific historical context.
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com> Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
|
There was a problem hiding this 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: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
README.md
(2 hunks)holidays/countries/__init__.py
(1 hunks)holidays/countries/mauritius.py
(1 hunks)holidays/registry.py
(1 hunks)tests/countries/test_mauritius.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
tests/countries/test_mauritius.py (1)
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.
holidays/countries/mauritius.py (3)
Learnt from: KJhellico
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:149-154
Timestamp: 2025-06-09T19:50:56.039Z
Learning: In the holidays library project, never suggest adding docstrings for alias classes (like NR, NRU country code aliases that inherit from main country classes). The project deliberately omits docstrings for these simple alias classes.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:171-184
Timestamp: 2025-06-19T02:34:14.456Z
Learning: In the holidays library, `_CustomIslamicHolidays` subclasses follow a consistent pattern of NOT having docstrings. They go directly to defining date dictionaries, as evidenced by Malaysia, Singapore, UAE, and dozens of other country implementations.
🪛 Pylint (3.3.7)
tests/countries/test_mauritius.py
[convention] 1-1: Missing module docstring
(C0114)
[convention] 20-20: Missing class docstring
(C0115)
[warning] 22-22: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestMauritius.setUpClass' method
(W0221)
[convention] 27-27: Missing function or method docstring
(C0116)
[convention] 30-30: Missing function or method docstring
(C0116)
[convention] 33-33: Missing function or method docstring
(C0116)
[convention] 36-36: Missing function or method docstring
(C0116)
[convention] 39-39: Missing function or method docstring
(C0116)
[convention] 44-44: Missing function or method docstring
(C0116)
[convention] 49-49: Missing function or method docstring
(C0116)
[convention] 54-54: Missing function or method docstring
(C0116)
[convention] 57-57: Missing function or method docstring
(C0116)
[convention] 62-62: Missing function or method docstring
(C0116)
[convention] 69-69: Missing function or method docstring
(C0116)
[convention] 74-74: Missing function or method docstring
(C0116)
[convention] 77-77: Missing function or method docstring
(C0116)
[convention] 89-89: Missing function or method docstring
(C0116)
[convention] 101-101: Missing function or method docstring
(C0116)
[convention] 113-113: Missing function or method docstring
(C0116)
[convention] 125-125: Missing function or method docstring
(C0116)
[convention] 137-137: Missing function or method docstring
(C0116)
[convention] 149-149: Missing function or method docstring
(C0116)
[convention] 161-161: Missing function or method docstring
(C0116)
[convention] 181-181: Missing function or method docstring
(C0116)
[convention] 200-200: Missing function or method docstring
(C0116)
[refactor] 20-20: Too many public methods (23/20)
(R0904)
holidays/countries/mauritius.py
[convention] 40-40: Line too long (172/100)
(C0301)
[convention] 41-41: Line too long (188/100)
(C0301)
[convention] 49-49: Line too long (159/100)
(C0301)
[convention] 50-50: Line too long (160/100)
(C0301)
[convention] 51-51: Line too long (176/100)
(C0301)
[convention] 52-52: Line too long (125/100)
(C0301)
[convention] 186-186: Line too long (187/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[refactor] 28-28: Too many ancestors (8/7)
(R0901)
[convention] 131-131: Missing class docstring
(C0115)
[refactor] 131-131: Too many ancestors (9/7)
(R0901)
[convention] 135-135: Missing class docstring
(C0115)
[refactor] 135-135: Too many ancestors (9/7)
(R0901)
[convention] 139-139: Missing class docstring
(C0115)
[convention] 166-166: Missing class docstring
(C0115)
[refactor] 182-182: Too few public methods (0/2)
(R0903)
⏰ Context from checks skipped due to timeout of 300000ms (3)
- GitHub Check: Test build on windows-latest
- GitHub Check: Test build on ubuntu-latest
- GitHub Check: Test build on macos-latest
🔇 Additional comments (14)
README.md (2)
108-108
: LGTM!Country count correctly updated to reflect the addition of Mauritius.
955-960
: LGTM!Mauritius entry properly added to the supported countries table with correct formatting and information.
holidays/registry.py (1)
138-138
: LGTM!Registry entry correctly added with proper tuple format and alphabetical placement.
holidays/countries/__init__.py (1)
135-135
: LGTM!Import statement correctly added in alphabetical order following the established pattern.
tests/countries/test_mauritius.py (4)
20-31
: Well-structured test class setup.Test class follows project conventions with proper inheritance, year range setup, and no_estimated_holidays configuration for Islamic holidays.
36-87
: Excellent test coverage for fixed holidays.Individual test methods for each holiday follow the recommended pattern from learnings, using generators for date ranges and testing across the full supported period.
89-159
: Thorough testing of movable holidays.Good coverage of Islamic, Hindu, and Chinese holidays with specific date validation and proper use of no_estimated_holidays for Islamic calendar events.
181-218
: Comprehensive localization testing.Both default (en_MU) and en_US locales properly tested with appropriate holiday name variations for each language.
holidays/countries/mauritius.py (6)
28-77
: Well-structured class implementationThe Mauritius class follows established patterns with proper inheritance, comprehensive documentation, and correct initialization of all holiday group mixins.
79-129
: Comprehensive holiday implementationThe method properly implements Mauritius holidays with correct conditional logic for alternating holidays and appropriate use of translation strings.
131-136
: Alias classes correctly implementedThe MU and MUS alias classes follow the established project pattern without docstrings, which is the correct approach for this codebase.
139-164
: Custom Hindu holidays correctly implementedThe class follows the established pattern with proper date overrides and source references. The omission of docstrings is correct for this project.
166-180
: Custom Islamic holidays correctly implementedThe class follows the established pattern with proper Eid al-Fitr date overrides and source references. The implementation is consistent with project standards.
182-197
: Static holidays properly implementedThe class correctly handles special one-off public holidays with appropriate documentation and government source references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thank you @kritibirda26!
Proposed change
Add Mauritius holidays.
Fixes #1197.
Type of change
holidays
functionality in general)Checklist
make check
, all checks and tests are green