Skip to content
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

Update Mexico holidays #1722

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions holidays/countries/mexico.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
class Mexico(HolidayBase, ChristianHolidays, InternationalHolidays):
"""
References:
- https://en.wikipedia.org/wiki/Public_holidays_in_Mexico
- https://es.wikipedia.org/wiki/Anexo:D%C3%ADas_festivos_en_M%C3%A9xico
- https://www.gob.mx/cms/uploads/attachment/file/156203/1044_Ley_Federal_del_Trabajo.pdf
- http://www.diputados.gob.mx/LeyesBiblio/ref/lft/LFT_orig_01abr70_ima.pdf
- https://en.wikipedia.org/wiki/Public_holidays_in_Mexico
- https://es.wikipedia.org/wiki/Anexo:D%C3%ADas_festivos_en_M%C3%A9xico
- https://www.gob.mx/cms/uploads/attachment/file/156203/1044_Ley_Federal_del_Trabajo.pdf
- http://www.diputados.gob.mx/LeyesBiblio/ref/lft/LFT_orig_01abr70_ima.pdf
- https://www.gob.mx/profedet/es/articulos/sabes-cuales-son-los-dias-de-descanso-obligatorio-para-este-2024 # noqa: E501
"""

country = "MX"
Expand Down Expand Up @@ -72,7 +73,11 @@ def _populate_public_holidays(self):

if self._year >= 1970 and (self._year - 1970) % 6 == 0:
# Change of Federal Government.
self._add_holiday_dec_1(tr("Transmisión del Poder Ejecutivo Federal"))
name = tr("Transmisión del Poder Ejecutivo Federal")
if self._year >= 2024:
self._add_holiday_oct_1(name)
else:
self._add_holiday_dec_1(name)

# Christmas Day.
self._add_christmas_day(tr("Navidad"))
Expand Down
10 changes: 5 additions & 5 deletions snapshots/countries/MX_COMMON.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@
"2024-03-18": "Benito Ju\u00e1rez's birthday",
"2024-05-01": "Labor Day",
"2024-09-16": "Independence Day",
"2024-10-01": "Change of Federal Government",
"2024-11-18": "Revolution Day",
"2024-12-01": "Change of Federal Government",
"2024-12-25": "Christmas Day",
"2025-01-01": "New Year's Day",
"2025-02-03": "Constitution Day",
Expand Down Expand Up @@ -574,8 +574,8 @@
"2030-03-18": "Benito Ju\u00e1rez's birthday",
"2030-05-01": "Labor Day",
"2030-09-16": "Independence Day",
"2030-10-01": "Change of Federal Government",
"2030-11-18": "Revolution Day",
"2030-12-01": "Change of Federal Government",
"2030-12-25": "Christmas Day",
"2031-01-01": "New Year's Day",
"2031-02-03": "Constitution Day",
Expand Down Expand Up @@ -617,8 +617,8 @@
"2036-03-17": "Benito Ju\u00e1rez's birthday",
"2036-05-01": "Labor Day",
"2036-09-16": "Independence Day",
"2036-10-01": "Change of Federal Government",
"2036-11-17": "Revolution Day",
"2036-12-01": "Change of Federal Government",
"2036-12-25": "Christmas Day",
"2037-01-01": "New Year's Day",
"2037-02-02": "Constitution Day",
Expand Down Expand Up @@ -660,8 +660,8 @@
"2042-03-17": "Benito Ju\u00e1rez's birthday",
"2042-05-01": "Labor Day",
"2042-09-16": "Independence Day",
"2042-10-01": "Change of Federal Government",
"2042-11-17": "Revolution Day",
"2042-12-01": "Change of Federal Government",
"2042-12-25": "Christmas Day",
"2043-01-01": "New Year's Day",
"2043-02-02": "Constitution Day",
Expand Down Expand Up @@ -703,8 +703,8 @@
"2048-03-16": "Benito Ju\u00e1rez's birthday",
"2048-05-01": "Labor Day",
"2048-09-16": "Independence Day",
"2048-10-01": "Change of Federal Government",
"2048-11-16": "Revolution Day",
"2048-12-01": "Change of Federal Government",
"2048-12-25": "Christmas Day",
"2049-01-01": "New Year's Day",
"2049-02-01": "Constitution Day",
Expand Down
3 changes: 2 additions & 1 deletion tests/countries/test_mexico.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_change_of_government(self):
"2006-12-01",
"2012-12-01",
"2018-12-01",
"2024-12-01",
"2024-10-01",
)
self.assertNoHoliday(
f"{year}-12-01" for year in range(1970, 2050) if (year - 1970) % 6 > 0
Expand All @@ -129,6 +129,7 @@ def test_change_of_government(self):
self.assertNoHolidayName(
name, (year for year in range(1970, 2050) if (year - 1970) % 6 > 0)
)
self.assertNoHoliday("2024-12-01")

def test_christmas_day(self):
self.assertHoliday(f"{year}-12-25" for year in range(1900, 2050))
Expand Down