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

v0.59 #2070

Merged
merged 24 commits into from
Oct 21, 2024
Merged

v0.59 #2070

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5c93ce7
Initialize v0.59
arkid15r Oct 7, 2024
7335779
Drop Python 3.8 support (#2042)
PPsyrius Oct 11, 2024
df48f79
Bump ruff from 0.6.8 to 0.6.9 (#2044)
dependabot[bot] Oct 11, 2024
041c7ae
Bump coverage from 7.6.1 to 7.6.2 (#2043)
dependabot[bot] Oct 11, 2024
3fc5f29
Bump pre-commit from 3.8.0 to 4.0.1 (#2046)
dependabot[bot] Oct 11, 2024
b364590
Update pre-commit hooks (#2050)
github-actions[bot] Oct 12, 2024
3238cb7
Bump tox from 4.21.1 to 4.21.2 (#2045)
dependabot[bot] Oct 12, 2024
3d2f6b0
Bump build from 1.2.2 to 1.2.2.post1 (#2047)
dependabot[bot] Oct 12, 2024
ebe2ca0
Update Johor (Malaysia) and United Arab Emirates `weekend` observance…
PPsyrius Oct 12, 2024
ad44b7c
Update Vietnam holidays (#2049)
KJhellico Oct 14, 2024
e492d09
Bump coverage from 7.6.2 to 7.6.3 (#2058)
dependabot[bot] Oct 16, 2024
f62614c
Bump tox from 4.21.2 to 4.22.0 (#2057)
dependabot[bot] Oct 16, 2024
34b4400
Bump cyclonedx-bom from 4.6.1 to 5.0.0 (#2056)
dependabot[bot] Oct 16, 2024
bb25790
Bump sphinx-rtd-theme from 2.0.0 to 3.0.1 (#2055)
dependabot[bot] Oct 16, 2024
6750bf1
Satisfy mypy requirements (#2053)
arkid15r Oct 17, 2024
ed048eb
Update Vietnam holidays: add `th` localization (#2060)
PPsyrius Oct 17, 2024
b0a7ecb
Update Germany holidays: add Liberation from Nazi Regime Day 2025 in …
hf-kklein Oct 17, 2024
15fc197
Add `EasternCalendarHolidays` to holidays groups (#2062)
KJhellico Oct 17, 2024
ce852f7
Update `holidays` package metadata (#2063)
arkid15r Oct 17, 2024
96d85fa
Update pre-commit hooks (#2065)
github-actions[bot] Oct 18, 2024
1e81ae8
Update `InternationalHolidays::_add_world_war_two_victory_day()` meth…
KJhellico Oct 18, 2024
208e8e5
Update pre-commit hooks (#2068)
github-actions[bot] Oct 21, 2024
17d910c
Update metadata Python versions (#2069)
arkid15r Oct 21, 2024
cd6bbea
Finalize v0.59
KJhellico Oct 21, 2024
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
1 change: 0 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ jobs:
- ubuntu-latest
- windows-latest
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ repos:
- rst

- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.18.0
hooks:
- id: pyupgrade
args:
- --py38-plus
- --py39-plus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.0
hooks:
- id: ruff
- id: ruff-format
Expand Down Expand Up @@ -54,7 +54,7 @@ repos:
exclude: ^(docs)

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.12.1
hooks:
- id: mypy
additional_dependencies:
Expand Down
16 changes: 16 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
Version 0.59
============

Released October 21, 2024

- Update Vietnam holidays: add `th` localization (#2060 by @PPsyrius)
- Update Germany holidays: add Liberation from Nazi Regime Day 2025 in Berlin (#2052 by @hf-kklein, @PPsyrius)
- Update Johor (Malaysia) and United Arab Emirates `weekend` observance, cleanup others (#2048 by @PPsyrius)
- Update Vietnam holidays (#2049 by @KJhellico)
- Update `InternationalHolidays::_add_world_war_two_victory_day()` method (#2064 by @KJhellico)
- Update `holidays` package metadata (#2063 by @arkid15r)
- Update metadata Python versions (#2069 by @arkid15r)
- Add `EasternCalendarHolidays` to holidays groups (#2062 by @KJhellico)
- Drop Python 3.8 support (#2042 by @PPsyrius)
- Satisfy mypy requirements (#2053 by @arkid15r)

Version 0.58
============

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ All other default values are highlighted with bold:
* - Vietnam
- VN
-
- en_US, **vi**
- en_US, th, **vi**
-
* - Virgin Islands (U.S.)
- VI
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns: List[str] = []
exclude_patterns: list[str] = []

# Add any paths that contain templates here, relative to this directory.
#
Expand Down Expand Up @@ -144,7 +144,7 @@
#
# See https://sphinx-rtd-theme.readthedocs.io/en/latest/configuring.html
#
html_theme_options: Dict[str, Union[str, bool, int]] = {
html_theme_options: dict[str, Union[str, bool, int]] = {
# 'canonical_url': '',
# 'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard
# 'analytics_anonymize_ip': False
Expand Down
2 changes: 1 addition & 1 deletion holidays/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from holidays.registry import EntityLoader
from holidays.utils import *

__version__ = "0.58"
__version__ = "0.59"


EntityLoader.load("countries", globals())
Expand Down
8 changes: 4 additions & 4 deletions holidays/calendars/buddhist.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# License: MIT (see LICENSE file)

from datetime import date
from typing import Optional, Tuple
from typing import Optional

from holidays.calendars.custom import _CustomCalendar
from holidays.calendars.gregorian import MAY, JUN
Expand Down Expand Up @@ -425,16 +425,16 @@ class _BuddhistLunisolar:
2099: (MAY, 4),
}

def _get_holiday(self, holiday: str, year: int) -> Tuple[Optional[date], bool]:
def _get_holiday(self, holiday: str, year: int) -> tuple[Optional[date], bool]:
estimated_dates = getattr(self, f"{holiday}_DATES", {})
exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
dt = exact_dates.get(year, estimated_dates.get(year, ()))
return date(year, *dt) if dt else None, year not in exact_dates

def vesak_date(self, year: int) -> Tuple[Optional[date], bool]:
def vesak_date(self, year: int) -> tuple[Optional[date], bool]:
return self._get_holiday(VESAK, year)

def vesak_may_date(self, year: int) -> Tuple[Optional[date], bool]:
def vesak_may_date(self, year: int) -> tuple[Optional[date], bool]:
return self._get_holiday(VESAK_MAY, year)


Expand Down
16 changes: 8 additions & 8 deletions holidays/calendars/chinese.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# License: MIT (see LICENSE file)

from datetime import date
from typing import Optional, Tuple
from typing import Optional

from holidays.calendars.custom import _CustomCalendar
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, SEP, OCT, NOV
Expand Down Expand Up @@ -1237,28 +1237,28 @@ class _ChineseLunisolar:
2099: (SEP, 29),
}

def _get_holiday(self, holiday: str, year: int) -> Tuple[Optional[date], bool]:
def _get_holiday(self, holiday: str, year: int) -> tuple[Optional[date], bool]:
estimated_dates = getattr(self, f"{holiday}_DATES", {})
exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
dt = exact_dates.get(year, estimated_dates.get(year, ()))
return date(year, *dt) if dt else None, year not in exact_dates

def buddha_birthday_date(self, year: int) -> Tuple[Optional[date], bool]:
def buddha_birthday_date(self, year: int) -> tuple[Optional[date], bool]:
return self._get_holiday(BUDDHA_BIRTHDAY, year)

def double_ninth_date(self, year: int) -> Tuple[Optional[date], bool]:
def double_ninth_date(self, year: int) -> tuple[Optional[date], bool]:
return self._get_holiday(DOUBLE_NINTH, year)

def dragon_boat_date(self, year: int) -> Tuple[Optional[date], bool]:
def dragon_boat_date(self, year: int) -> tuple[Optional[date], bool]:
return self._get_holiday(DRAGON_BOAT, year)

def hung_kings_date(self, year: int) -> Tuple[Optional[date], bool]:
def hung_kings_date(self, year: int) -> tuple[Optional[date], bool]:
return self._get_holiday(HUNG_KINGS, year)

def lunar_new_year_date(self, year: int) -> Tuple[Optional[date], bool]:
def lunar_new_year_date(self, year: int) -> tuple[Optional[date], bool]:
return self._get_holiday(LUNAR_NEW_YEAR, year)

def mid_autumn_date(self, year: int) -> Tuple[Optional[date], bool]:
def mid_autumn_date(self, year: int) -> tuple[Optional[date], bool]:
return self._get_holiday(MID_AUTUMN, year)


Expand Down
8 changes: 4 additions & 4 deletions holidays/calendars/hindu.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# License: MIT (see LICENSE file)

from datetime import date
from typing import Optional, Tuple
from typing import Optional

from holidays.calendars.custom import _CustomCalendar
from holidays.calendars.gregorian import JAN, FEB, MAR, OCT, NOV
Expand Down Expand Up @@ -425,16 +425,16 @@ class _HinduLunisolar:
2099: (JAN, 6),
}

def _get_holiday(self, holiday: str, year: int) -> Tuple[Optional[date], bool]:
def _get_holiday(self, holiday: str, year: int) -> tuple[Optional[date], bool]:
estimated_dates = getattr(self, f"{holiday}_DATES", {})
exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
dt = exact_dates.get(year, estimated_dates.get(year, ()))
return date(year, *dt) if dt else None, year not in exact_dates

def diwali_date(self, year: int) -> Tuple[Optional[date], bool]:
def diwali_date(self, year: int) -> tuple[Optional[date], bool]:
return self._get_holiday(DIWALI, year)

def thaipusam_date(self, year: int) -> Tuple[Optional[date], bool]:
def thaipusam_date(self, year: int) -> tuple[Optional[date], bool]:
return self._get_holiday(THAIPUSAM, year)


Expand Down
50 changes: 25 additions & 25 deletions holidays/calendars/islamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)

from collections.abc import Iterable
from datetime import date
from typing import Iterable, Tuple

from holidays.calendars.custom import _CustomCalendar
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
Expand Down Expand Up @@ -3641,80 +3641,80 @@ class _IslamicLunar:
2076: (DEC, 5),
}

def _get_holiday(self, holiday: str, year: int) -> Iterable[Tuple[date, bool]]:
def _get_holiday(self, holiday: str, year: int) -> Iterable[tuple[date, bool]]:
estimated_dates = getattr(self, f"{holiday}_DATES", {})
exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
for year in (year - 1, year):
for dt in _normalize_tuple(exact_dates.get(year, estimated_dates.get(year, ()))):
yield date(year, *dt), year not in exact_dates

def ali_al_rida_death_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def ali_al_rida_death_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(ALI_AL_RIDA_DEATH, year)

def ali_birthday_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def ali_birthday_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(ALI_BIRTHDAY, year)

def ali_death_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def ali_death_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(ALI_DEATH, year)

def arbaeen_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def arbaeen_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(ARBAEEN, year)

def ashura_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def ashura_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(ASHURA, year)

def eid_al_adha_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def eid_al_adha_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(EID_AL_ADHA, year)

def eid_al_fitr_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def eid_al_fitr_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(EID_AL_FITR, year)

def eid_al_ghadir_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def eid_al_ghadir_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(EID_AL_GHADIR, year)

def fatima_death_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def fatima_death_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(FATIMA_DEATH, year)

def hari_hol_johor_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def hari_hol_johor_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(HARI_HOL_JOHOR, year)

def hasan_al_askari_death_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def hasan_al_askari_death_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(HASAN_AL_ASKARI_DEATH, year)

def hijri_new_year_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def hijri_new_year_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(HIJRI_NEW_YEAR, year)

def imam_mahdi_birthday_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def imam_mahdi_birthday_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(IMAM_MAHDI_BIRTHDAY, year)

def isra_and_miraj_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def isra_and_miraj_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(ISRA_AND_MIRAJ, year)

def maldives_embraced_islam_day_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def maldives_embraced_islam_day_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(MALDIVES_EMBRACED_ISLAM_DAY, year)

def mawlid_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def mawlid_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(MAWLID, year)

def nuzul_al_quran_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def nuzul_al_quran_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(NUZUL_AL_QURAN, year)

def prophet_death_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def prophet_death_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(PROPHET_DEATH, year)

def quamee_dhuvas_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def quamee_dhuvas_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(QUAMEE_DHUVAS, year)

def ramadan_beginning_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def ramadan_beginning_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(RAMADAN_BEGINNING, year)

def sadiq_birthday_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def sadiq_birthday_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(SADIQ_BIRTHDAY, year)

def sadiq_death_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def sadiq_death_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(SADIQ_DEATH, year)

def tasua_dates(self, year: int) -> Iterable[Tuple[date, bool]]:
def tasua_dates(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday(TASUA, year)


Expand Down
4 changes: 2 additions & 2 deletions holidays/countries/angola.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from datetime import date
from gettext import gettext as tr
from typing import Optional, Tuple
from typing import Optional

from holidays.calendars.gregorian import AUG, SEP
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
Expand Down Expand Up @@ -59,7 +59,7 @@ def _is_observed(self, dt: date) -> bool:
# it rolls over to the following Monday.
return dt >= date(1996, SEP, 27)

def _add_observed(self, dt: date, **kwargs) -> Tuple[bool, Optional[date]]:
def _add_observed(self, dt: date, **kwargs) -> tuple[bool, Optional[date]]:
# As per Law # #11/18, from 2018/9/10, when public holiday falls on Tuesday or Thursday,
# the Monday or Friday is also a holiday.
kwargs.setdefault(
Expand Down
7 changes: 5 additions & 2 deletions holidays/countries/armenia.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ def _populate_public_holidays(self):
)

if self._year >= 1995:
# Victory and Peace Day.
self._add_world_war_two_victory_day(tr("Հաղթանակի և Խաղաղության տոն"))
self._add_world_war_two_victory_day(
# Victory and Peace Day.
tr("Հաղթանակի և Խաղաղության տոն"),
is_western=False,
)

# Republic Day.
self._add_holiday_may_28(tr("Հանրապետության օր"))
Expand Down
9 changes: 7 additions & 2 deletions holidays/countries/azerbaijan.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ def _populate_public_holidays(self):
dts_observed.add(self._add_holiday_mar_23(name))
dts_observed.add(self._add_holiday_mar_24(name))

# Victory over Fascism Day.
dts_observed.add(self._add_world_war_two_victory_day(tr("Faşizm üzərində qələbə günü")))
dts_observed.add(
self._add_world_war_two_victory_day(
# Victory over Fascism Day.
tr("Faşizm üzərində qələbə günü"),
is_western=False,
)
)

if self._year >= 1992:
dts_observed.add(
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/belarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _populate_public_holidays(self):
self._add_labor_day(tr("Свята працы"))

# Victory Day.
self._add_world_war_two_victory_day(tr("Дзень Перамогі"))
self._add_world_war_two_victory_day(tr("Дзень Перамогі"), is_western=False)

# Independence Day.
self._add_holiday_jul_3(tr("Дзень Незалежнасці Рэспублікі Беларусь (Дзень Рэспублікі)"))
Expand Down
4 changes: 2 additions & 2 deletions holidays/countries/bosnia_and_herzegovina.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def _populate_subdiv_bih_public_holidays(self):
self._add_labor_day_two(name)

# Victory Day.
self._add_world_war_two_victory_day(tr("Dan pobjede nad fašizmom"))
self._add_world_war_two_victory_day(tr("Dan pobjede nad fašizmom"), is_western=False)

# Statehood Day.
self._add_holiday_nov_25(tr("Dan državnosti"))
Expand Down Expand Up @@ -220,7 +220,7 @@ def _populate_subdiv_srp_public_holidays(self):
self._add_labor_day_two(name)

# Victory Day.
self._add_world_war_two_victory_day(tr("Dan pobjede nad fašizmom"))
self._add_world_war_two_victory_day(tr("Dan pobjede nad fašizmom"), is_western=False)

self._add_holiday_nov_21(
# Dayton Agreement Day.
Expand Down
Loading