python-holidays icon indicating copy to clipboard operation
python-holidays copied to clipboard

Add Faroe Islands holidays

Open Shrot101 opened this issue 6 months ago • 10 comments

Proposed change

  • Introduced a new holiday provider: Faroe Islands.
  • Implemented all official public holidays based on trusted sources.
  • Included half-day recognition (e.g., Ólavsøkuaftan).
  • Created country aliases: FO and FRO.

Type of change

  • [x] 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)

Fixed: #2511

Checklist

  • [x] I've followed the contributing guidelines
  • [x] I've successfully run make check, all checks and tests are green

References

https://visitfaroeislands.com/en/plan-your-stay/before-you-arrive-in-the-faroe-islands/public-holidays https://en.wikipedia.org/wiki/Public_holidays_in_the_Faroe_Islands

Shrot101 avatar Jun 06 '25 11:06 Shrot101

Summary by CodeRabbit

  • New Features

    • Added support for Faroe Islands holidays, including both public and half-day holidays, from 1948 onwards.
    • Introduced aliases and country codes for Faroe Islands (FO, FRO).
    • Added localizations for Faroe Islands holidays in Faroese, Danish, English (US), Icelandic, Norwegian, and Swedish.
  • Documentation

    • Updated the README to include Faroe Islands in the list of supported countries.
  • Tests

    • Added comprehensive tests for Faroe Islands holiday calculations and localizations.
  • Chores

    • Updated ignore patterns to exclude all __pycache__ directories.

Summary by CodeRabbit

  • New Features

    • Added support for Faroe Islands holidays, including both public and half-day holidays, with coverage from 1948 onward.
    • Introduced aliases for Faroe Islands using FO and FRO country codes.
    • Faroe Islands holidays are now available in multiple languages: Faroese, Danish, English, Icelandic, Norwegian, and Swedish.
  • Documentation

    • Updated the documentation to include Faroe Islands in the list of supported countries and languages.
  • Tests

    • Added tests to verify correct holiday names, aliases, and localization for the Faroe Islands.
  • Chores

    • Updated configuration to ignore all __pycache__ directories recursively.

Walkthrough

The changes introduce support for Faroe Islands holidays by adding a new country module, updating the country imports and registry, adding multiple localization files, and providing comprehensive tests. The .gitignore file is also updated to exclude all __pycache__ directories recursively.

Changes

Files/Paths Change Summary
.gitignore Added pattern to ignore all __pycache__ directories recursively.
holidays/countries/__init__.py Imported Faroe Islands holiday module and its aliases.
holidays/countries/faroe_islands.py New module defining Faroe Islands holidays, aliases, and localization metadata.
holidays/registry.py Added Faroe Islands entry to the countries registry dictionary.
holidays/locale/{da,en_US,fo,is,no,sv}/LC_MESSAGES/FO.po Added localization files with translations of Faroe Islands holiday names in multiple languages.
tests/countries/test_faroe_islands.py New tests for Faroe Islands holidays, aliases, and localization.
README.md Updated supported countries count and added Faroe Islands entry with supported languages info.

Assessment against linked issues

Objective Addressed Explanation
Add Faroe Islands holidays and aliases (2511)
Define public and Christian holidays correctly
Provide localized holiday names
Include tests verifying holidays and localization

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes detected.

Possibly related PRs

  • vacanza/holidays#2442: Adds support for French Southern Territories holidays with similar structure and files modified, closely related in approach to adding a new country.

Suggested reviewers

  • KJhellico
  • PPsyrius
✨ Finishing Touches
  • [ ] 📝 Generate Docstrings
🧪 Generate Unit Tests
  • [ ] Create PR with Unit Tests
  • [ ] Post Copyable Unit Tests in 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jun 06 '25 11:06 coderabbitai[bot]

@Shrot101, it's good start, but it needs to be significantly improved. I advise you to look at latest merged PRs as example (#2583, #2582, #2571, #2562), to better understand requirements and standards established in this project.

KJhellico avatar Jun 06 '25 13:06 KJhellico

@Shrot101, it's good start, but it needs to be significantly improved. I advise you to look at latest merged PRs as example (#2583, #2582, #2571, #2562), to better understand requirements and standards established in this project.

Thank you for guiding me. Please tell me how to implement a translation file in the locale folder. Do I have to create it for all the languages "da", "en_US", "fo", "is", "no", "sv".

Shrot101 avatar Jun 06 '25 14:06 Shrot101

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (5176c05) to head (82a258c). Report is 12 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2606   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          253       254    +1     
  Lines        15201     15239   +38     
  Branches      2095      2095           
=========================================
+ Hits         15201     15239   +38     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jun 06 '25 15:06 codecov[bot]

Please tell me how to implement a translation file in the locale folder. Do I have to create it for all the languages "da", "en_US", "fo", "is", "no", "sv".

Usual way is run make l10n - it's create .po file for default language. Then use it as a base for other translations.

KJhellico avatar Jun 06 '25 15:06 KJhellico

First of all, you need to merge latest changes from dev and resolve conflicts.

KJhellico avatar Jun 07 '25 17:06 KJhellico

[ ] I've followed the contributing guidelines [ ] I've successfully run make check, all checks and tests are green

These statements are not just a formality here.

KJhellico avatar Jun 07 '25 17:06 KJhellico

First of all, you need to merge latest changes from dev and resolve conflicts.

Yes, just found that. I just started so learning it.

Shrot101 avatar Jun 07 '25 17:06 Shrot101

@KJhellico, I updated the code. Please check it. I tried to resolve the issues. If there are any further issues, please guide me. Thank you for guiding me until now. I am learning a lot from this repo and you.

Shrot101 avatar Jun 08 '25 09:06 Shrot101

Hi @Shrot101 It's been 2 weeks since last update -- any progress/plans on addressing the comments?

arkid15r avatar Jun 30 '25 19:06 arkid15r

Hi @Shrot101 It's been 2 weeks since last update -- any progress/plans on addressing the comments?

I was outside due to some reasons. I will do it till tomorrow.

Shrot101 avatar Jul 01 '25 03:07 Shrot101

Not completed by expected date.

arkid15r avatar Jul 07 '25 15:07 arkid15r