-
-
Notifications
You must be signed in to change notification settings - Fork 688
Add French Southern Territories holidays #2442
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
598369c
implements French Southern Territories holidays
LuccaAug d1a499d
implements French Southern Territories tests
LuccaAug c533df7
setup French Southern Territories
LuccaAug 6bff1ad
Fixes typo on country code
LuccaAug 3bba492
Fixes typo and pre-commit
LuccaAug 20b5418
Fixes locale files
LuccaAug 13d503f
Removes unused test
LuccaAug 19cd6b0
Fixes wrong names
LuccaAug cff7986
Update tests/countries/test_french_southern_territories.py
LuccaAug 5c14820
Improves quality code with Copilot recommendation
LuccaAug 3d21ad7
Merge remote-tracking branch 'origin/french-southern-territories' int…
LuccaAug 5dbff5f
Merge remote-tracking branch 'origin/dev' into french-southern-territ…
LuccaAug f1b4c0c
Merge branch 'dev' into french-southern-territories
LuccaAug 9cfbb64
Updates TF main code to subdivision structure
LuccaAug b71ae77
Adds uk locale to match with super class France
LuccaAug fe24a59
Updates subdivision alias structure to allow empty value
LuccaAug 6f926e1
Fixes tests to new subdivision pattern
LuccaAug 2b1663f
Merge branch 'dev' into french-southern-territories
LuccaAug 53ed898
Fixes comment on uk locale
LuccaAug 8b26d01
Fixes HolidaysTF setup with languages
LuccaAug bc679d2
Registries HolidaysTF
LuccaAug 4f78230
Removes unnecessary code
LuccaAug ee04186
Fixes HolidaysTF setup to match with HolidaysGU (Guam)
LuccaAug 5ded1ba
Apply suggestions from code review
LuccaAug e6a6788
Updates project version on po files
LuccaAug f88ac5e
Updates po files to empty ones
LuccaAug dc65839
Removes redundant tests
LuccaAug 8d14e65
Merge branch 'dev' into french-southern-territories
LuccaAug 45ac5b9
Improves docstring
LuccaAug 133085e
Update doctring
LuccaAug 4a8d956
Update code
arkid15r 5877deb
Merge branch 'dev' into pr/LuccaAug/2442
arkid15r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # holidays | ||
| # -------- | ||
| # A fast, efficient Python library for generating country, province and state | ||
| # specific sets of holidays on the fly. It aims to make determining whether a | ||
| # specific date is a holiday as fast and flexible as possible. | ||
| # | ||
| # Authors: Vacanza Team and individual contributors (see AUTHORS.md file) | ||
| # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023 | ||
| # ryanss <ryanssdev@icloud.com> (c) 2014-2017 | ||
| # Website: https://github.com/vacanza/holidays | ||
| # License: MIT (see LICENSE file) | ||
|
|
||
| from holidays.countries.france import France | ||
|
|
||
|
|
||
| class HolidaysTF(France): | ||
| """French Southern Territories holidays. | ||
|
|
||
| Alias of a French subdivision that is also officially assigned | ||
| its own country code in ISO 31661. | ||
|
|
||
| !!! note "Note" | ||
| Since most islands doesn't have a permanent population, | ||
| the holidays are just the public ones from France. | ||
|
|
||
| References: | ||
| * <https://www.iso.org/obp/ui#iso:code:3166:TF> | ||
| * <https://en.wikipedia.org/wiki/French_Southern_and_Antarctic_Lands> | ||
| * <https://en.wikipedia.org/wiki/Public_holidays_in_France> | ||
| """ | ||
|
|
||
| country = "TF" | ||
| parent_entity = France | ||
| subdivisions = () # Override France subdivisions. | ||
| subdivisions_aliases = {} # Override France subdivisions aliases. | ||
|
LuccaAug marked this conversation as resolved.
|
||
| # This overseas territory was separated in 1955. | ||
| start_year = 1956 | ||
|
|
||
|
LuccaAug marked this conversation as resolved.
|
||
| def _populate_public_holidays(self) -> None: | ||
| self.subdiv = "TF" | ||
| super()._populate_public_holidays() | ||
|
|
||
|
|
||
| class FrenchSouthernTerritories(HolidaysTF): | ||
| pass | ||
|
|
||
|
|
||
| class TF(HolidaysTF): | ||
| pass | ||
|
|
||
|
|
||
| class ATF(HolidaysTF): | ||
| pass | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # holidays | ||
| # -------- | ||
| # A fast, efficient Python library for generating country, province and state | ||
| # specific sets of holidays on the fly. It aims to make determining whether a | ||
| # specific date is a holiday as fast and flexible as possible. | ||
| # | ||
| # Authors: Vacanza Team and individual contributors (see AUTHORS.md file) | ||
| # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023 | ||
| # ryanss <ryanssdev@icloud.com> (c) 2014-2017 | ||
| # Website: https://github.com/vacanza/holidays | ||
| # License: MIT (see LICENSE file) | ||
| # | ||
| # French Southern Territories holidays en_US localization. | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays 0.71\n" | ||
| "POT-Creation-Date: 2023-03-23 14:44+0200\n" | ||
| "PO-Revision-Date: 2023-03-23 14:47+0200\n" | ||
| "Last-Translator: ~Jhellico <jhellico@gmail.com>\n" | ||
| "Language-Team: Holidays Localization Team\n" | ||
| "Language: en_US\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: 8bit\n" | ||
| "Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
| "Generated-By: Lingua 4.15.0\n" | ||
| "X-Generator: Poedit 3.2.2\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # holidays | ||
| # -------- | ||
| # A fast, efficient Python library for generating country, province and state | ||
| # specific sets of holidays on the fly. It aims to make determining whether a | ||
| # specific date is a holiday as fast and flexible as possible. | ||
| # | ||
| # Authors: Vacanza Team and individual contributors (see AUTHORS.md file) | ||
| # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023 | ||
| # ryanss <ryanssdev@icloud.com> (c) 2014-2017 | ||
| # Website: https://github.com/vacanza/holidays | ||
| # License: MIT (see LICENSE file) | ||
| # | ||
| # French Southern Territories holidays. | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays 0.71\n" | ||
| "POT-Creation-Date: 2023-03-23 14:44+0200\n" | ||
| "PO-Revision-Date: 2023-03-23 14:45+0200\n" | ||
| "Last-Translator: ~Jhellico <jhellico@gmail.com>\n" | ||
| "Language-Team: Holidays Localization Team\n" | ||
| "Language: fr\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: 8bit\n" | ||
| "Plural-Forms: nplurals=2; plural=(n > 1);\n" | ||
| "Generated-By: Lingua 4.15.0\n" | ||
| "X-Generator: Poedit 3.2.2\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # holidays | ||
| # -------- | ||
| # A fast, efficient Python library for generating country, province and state | ||
| # specific sets of holidays on the fly. It aims to make determining whether a | ||
| # specific date is a holiday as fast and flexible as possible. | ||
| # | ||
| # Authors: Vacanza Team and individual contributors (see AUTHORS.md file) | ||
| # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023 | ||
| # ryanss <ryanssdev@icloud.com> (c) 2014-2017 | ||
| # Website: https://github.com/vacanza/holidays | ||
| # License: MIT (see LICENSE file) | ||
| # | ||
| # French Southern Territories holidays uk localization. | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays 0.71\n" | ||
| "POT-Creation-Date: 2023-03-23 14:44+0200\n" | ||
| "PO-Revision-Date: 2024-01-23 20:54+0200\n" | ||
| "Last-Translator: ~Jhellico <jhellico@gmail.com>\n" | ||
| "Language-Team: Holidays Localization Team\n" | ||
| "Language: uk\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: 8bit\n" | ||
| "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" | ||
| "Generated-By: Lingua 4.15.0\n" | ||
| "X-Generator: Poedit 3.4\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # holidays | ||
| # -------- | ||
| # A fast, efficient Python library for generating country, province and state | ||
| # specific sets of holidays on the fly. It aims to make determining whether a | ||
| # specific date is a holiday as fast and flexible as possible. | ||
| # | ||
| # Authors: Vacanza Team and individual contributors (see AUTHORS.md file) | ||
| # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023 | ||
| # ryanss <ryanssdev@icloud.com> (c) 2014-2017 | ||
| # Website: https://github.com/vacanza/holidays | ||
| # License: MIT (see LICENSE file) | ||
|
|
||
| from unittest import TestCase | ||
|
|
||
| from holidays.countries.french_southern_territories import ( | ||
| HolidaysTF, | ||
| FrenchSouthernTerritories, | ||
| TF, | ||
| ATF, | ||
| ) | ||
| from tests.common import CommonCountryTests | ||
|
|
||
|
|
||
| class TestTF(CommonCountryTests, TestCase): | ||
| @classmethod | ||
| def setUpClass(cls): | ||
| super().setUpClass(HolidaysTF) | ||
|
|
||
| def test_country_aliases(self): | ||
| self.assertAliases(HolidaysTF, FrenchSouthernTerritories, TF, ATF) | ||
|
|
||
| def test_2022(self): | ||
| self.assertHolidayDates( | ||
| HolidaysTF(years=2022), | ||
| "2022-01-01", | ||
| "2022-04-18", | ||
| "2022-05-01", | ||
| "2022-05-08", | ||
| "2022-05-26", | ||
| "2022-06-06", | ||
| "2022-07-14", | ||
| "2022-08-15", | ||
| "2022-11-01", | ||
| "2022-11-11", | ||
| "2022-12-25", | ||
| ) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.