Skip to content

Commit

Permalink
Merge pull request #2155 from vacanza/dev
Browse files Browse the repository at this point in the history
v0.62
  • Loading branch information
arkid15r authored Dec 2, 2024
2 parents 17e7a16 + 164593c commit e2e7592
Show file tree
Hide file tree
Showing 141 changed files with 2,230 additions and 1,307 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.6.0
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
- --py39-plus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.8.1
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -39,7 +39,7 @@ repos:
- docs/file_header.txt

- repo: https://github.com/pycqa/bandit
rev: 1.7.10
rev: 1.8.0
hooks:
- id: bandit
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.62
============

Released December 2, 2024

- Introduce start/end year for entity (#2141 by @KJhellico)
- Add Guernsey holidays (#2135 by @PPsyrius)
- Update AZ holidays: add 2025 special holidays (#2154 by @KJhellico)
- Update Argentina holidays: Add 2025 Bridge Public Holidays (#2146 by @PPsyrius)
- Update CA holidays: Nunavut Day is NU public holiday since 2020 (#2143 by @KJhellico)
- Update Finland holidays: fix Independence Day appearing pre-1917 (#2145 by @PPsyrius)
- Update Paraguay holidays (#2151 by @KJhellico)
- Update Timor Leste holidays: Add 2024 Nov 29 Special Holiday (#2150 by @PPsyrius)
- Update pyproject.toml: clarify project summary (#2139 by @arkid15r)
- Add SECURITY.md (#2142 by @arkid15r)

Version 0.61
============

Expand Down
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Available Countries
.. _ISO 639-1 code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _ISO 639-2 code: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes

We currently support 154 country codes. The standard way to refer to a country
We currently support 155 country codes. The standard way to refer to a country
is by using its `ISO 3166-1 alpha-2 code`_, the same used for domain names, and
for a subdivision its `ISO 3166-2 code`_. Some countries have common or foreign
names or abbreviations as aliases for their subdivisions. These are defined in
Expand Down Expand Up @@ -480,6 +480,11 @@ All other default values are highlighted with bold:
-
- en_US, **es**
-
* - Guernsey
- GG
-
-
-
* - Haiti
- HT
-
Expand Down
7 changes: 5 additions & 2 deletions RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ How to release a new version of Holidays
- generate release notes by running ``make release-notes``
- insert the command's output into the top of ``CHANGES`` file
(see previous release notes for consistent formatting)
- commit the updated ``CHANGES`` file to ``dev`` branch with the following
commit message 'Finalize v<version>', e.g. 'Finalize v0.39'
- update the supported versions table at ``SECURITY.md`` file (the
table should contain the version being currently released)
- commit the updated ``CHANGES`` and ``SECURITY.md`` files to ``dev``
branch with the following commit message 'Finalize v<version>',
e.g. 'Finalize v0.39'
- push changes to https://github.com/vacanza/holidays ``dev`` branch
- make sure the push related CI/CD jobs have been completed successfully

Expand Down
12 changes: 12 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 0.62 | :white_check_mark: |
| < 0.62 | :x: |

## Reporting a Vulnerability

Please use [this form](https://github.com/vacanza/holidays/security/advisories/new) to report a security vulnerability.
3 changes: 3 additions & 0 deletions holidays/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@
HEBREW = "hebrew"
HINDU = "hindu"
ISLAMIC = "islamic"

DEFAULT_START_YEAR = 1901
DEFAULT_END_YEAR = 2100
1 change: 1 addition & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
from .greenland import Greenland, GL, GRL
from .guam import Guam, GU, GUM, HolidaysGU
from .guatemala import Guatemala, GT, GUA
from .guernsey import Guernsey, GG, GGY
from .haiti import Haiti, HT, HTI
from .honduras import Honduras, HN, HND
from .hongkong import HongKong, HK, HKG
Expand Down
6 changes: 2 additions & 4 deletions holidays/countries/albania.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class Albania(
# %s (observed, estimated).
observed_estimated_label = tr("%s (ditë pushimi e shtyrë, e vlerësuar)")
supported_languages = ("en_US", "sq", "uk")
# Law No. 7651 from 21.12.1992.
start_year = 1993

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand All @@ -53,10 +55,6 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# Law No. 7651 from 21.12.1992.
if self._year <= 1992:
return None

dts_observed = set()

# New Year's Day.
Expand Down
6 changes: 2 additions & 4 deletions holidays/countries/angola.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class Angola(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
supported_languages = ("en_US", "pt_AO", "uk")
# %s (observed).
observed_label = tr("%s (ponte)")
# Decree #5/75.
start_year = 1975

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand All @@ -68,10 +70,6 @@ def _add_observed(self, dt: date, **kwargs) -> tuple[bool, Optional[date]]:
return super()._add_observed(dt, **kwargs)

def _populate_public_holidays(self):
# Decree #5/75.
if self._year <= 1974:
return None

# New Year's Day.
name = self.tr("Dia do Ano Novo")
dt = self._add_new_years_day(name)
Expand Down
24 changes: 23 additions & 1 deletion holidays/countries/argentina.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,31 @@ class Argentina(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, S
- Based on:
https://es.wikipedia.org/wiki/Anexo:D%C3%ADas_feriados_en_Argentina
- [Ley 24455] Belgrano and San Martin Day as third Monday
https://servicios.infoleg.gob.ar/infolegInternet/anexos/0-4999/782/norma.htm
- [Ley 27399] - For 2018++
https://www.argentina.gob.ar/normativa/nacional/ley-27399-281835/texto
- [Decreto 1585/2010] - 2011-2013 Bridge Holidays, Movable Holidays Law
https://www.argentina.gob.ar/normativa/nacional/decreto-1585-2010-174391/texto
- [Decreto 1768/2013] - 2014-2016 Bridge Holidays
https://www.argentina.gob.ar/normativa/nacional/decreto-1768-2013-222021/texto
- [Decretos 52-80-923/2017] - 2017-2019 Bridge Holidays
https://www.argentina.gob.ar/normativa/nacional/decreto-52-2017-271094/texto
https://www.argentina.gob.ar/normativa/nacional/decreto-80-2017-271382/texto
https://www.argentina.gob.ar/normativa/nacional/decreto-923-2017-287145
- [Decreto 717/2019] - 2020 Bridge Holidays
https://www.argentina.gob.ar/normativa/nacional/decreto-717-2019-330204/texto
- [Decreto 297/2020] - Veteran Day moved due to Covid-19
https://www.argentina.gob.ar/normativa/nacional/decreto-297-2020-335741/texto
- [Decreto 947/2020] - 2021 Bridge Holidays
https://www.argentina.gob.ar/normativa/nacional/decreto-947-2020-344620/texto
- [Decreto 789/2021] - 2022 Bridge Holidays
https://www.argentina.gob.ar/normativa/nacional/decreto-789-2021-356678/texto
- [Decreto 764/2022] - 2023 Bridge Holidays
https://www.argentina.gob.ar/normativa/nacional/decreto-764-2022-375264/texto
- [Decreto 106/2023] - 2024 Bridge Holidays
https://www.argentina.gob.ar/normativa/nacional/decreto-106-2023-395689/texto
- [Decreto 1017/2024] - 2025 Bridge Holidays
https://www.argentina.gob.ar/normativa/nacional/decreto-1027-2024-406417/texto
- [Always Update Calendar Year Link]
https://www.argentina.gob.ar/interior/feriados
http://servicios.lanacion.com.ar/feriados
Expand All @@ -60,7 +75,8 @@ class Argentina(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, S
https://servicios.lanacion.com.ar/app-mobile/feriados/2016
https://servicios.lanacion.com.ar/app-mobile/feriados/2015
Movable Holidays Laws:
Movable Holidays Laws:
- Decreto 1584/2010: 2010-11-03
- AUG 17, OCT 12, NOV 20 Holidays will always be on MON
- Decreto 52/2017: 2017-01-23 (Reconfirmed in Ley 27399)
Expand All @@ -73,6 +89,7 @@ class Argentina(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, S
supported_languages = ("en_US", "es", "uk")
# %s (observed).
observed_label = tr("%s (observado)")
start_year = 1801

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand Down Expand Up @@ -345,4 +362,9 @@ class ArgentinaStaticHolidays:
(JUN, 21, arg_bridge_public_holiday),
(OCT, 11, arg_bridge_public_holiday),
),
2025: (
(MAY, 2, arg_bridge_public_holiday),
(AUG, 15, arg_bridge_public_holiday),
(NOV, 21, arg_bridge_public_holiday),
),
}
4 changes: 1 addition & 3 deletions holidays/countries/armenia.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ class Armenia(HolidayBase, ChristianHolidays, InternationalHolidays):
country = "AM"
default_language = "hy"
supported_languages = ("en_US", "hy")
start_year = 1991

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self, JULIAN_CALENDAR)
InternationalHolidays.__init__(self)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
if self._year <= 1990:
return None

# New Year's Day.
name = tr("Նոր տարվա օր")
self._add_new_years_day(name)
Expand Down
6 changes: 2 additions & 4 deletions holidays/countries/aruba.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@ class Aruba(HolidayBase, ChristianHolidays, InternationalHolidays):
country = "AW"
default_language = "pap_AW"
supported_languages = ("en_US", "nl", "pap_AW", "uk")
# AUG 1947: Autonomous State status in the Kingdom of the Netherlands.
start_year = 1947

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
InternationalHolidays.__init__(self)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# AUG 1947: Autonomous State status in the Kingdom of the Netherlands.
if self._year <= 1946:
return None

# Aña Nobo.
# Status: In-Use.

Expand Down
1 change: 1 addition & 0 deletions holidays/countries/australia.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Australia(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, S
"Victoria": "VIC",
"Western Australia": "WA",
}
start_year = 1801

@property
def sovereign_birthday(self) -> str:
Expand Down
39 changes: 31 additions & 8 deletions holidays/countries/azerbaijan.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@


class Azerbaijan(ObservedHolidayBase, InternationalHolidays, IslamicHolidays, StaticHolidays):
# [1] https://en.wikipedia.org/wiki/Public_holidays_in_Azerbaijan
# [2] https://az.wikipedia.org/wiki/Az%C9%99rbaycan%C4%B1n_d%C3%B6vl%C9%99t_bayramlar%C4%B1_v%C9%99_x%C3%BCsusi_g%C3%BCnl%C9%99ri
# [3] https://www.sosial.gov.az/en/prod-calendar
"""
References:
- https://en.wikipedia.org/wiki/Public_holidays_in_Azerbaijan
- https://az.wikipedia.org/wiki/Az%C9%99rbaycan%C4%B1n_d%C3%B6vl%C9%99t_bayramlar%C4%B1_v%C9%99_x%C3%BCsusi_g%C3%BCnl%C9%99ri
- https://www.sosial.gov.az/en/prod-calendar
"""

country = "AZ"
default_language = "az"
Expand All @@ -39,6 +42,7 @@ class Azerbaijan(ObservedHolidayBase, InternationalHolidays, IslamicHolidays, St
observed_estimated_label = tr("%s (müşahidə olunur, təxmini)")
supported_categories = (PUBLIC, WORKDAY)
supported_languages = ("az", "en_US", "uk")
start_year = 1990

def __init__(self, *args, **kwargs):
InternationalHolidays.__init__(self)
Expand All @@ -49,9 +53,6 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
if self._year <= 1989:
return None

dts_observed = set()
dts_non_observed = set()
dts_bairami = set()
Expand Down Expand Up @@ -246,6 +247,21 @@ class AzerbaijanIslamicHolidays(_CustomIslamicHolidays):


class AzerbaijanStaticHolidays:
"""
Substituted holidays references:
- https://nk.gov.az/az/senedler/qerarlar/is-va-istirahat-gunlarinin-yerlarinin-dayisdirilmasi-haqqinda-5423
- https://nk.gov.az/az/senedler/qerarlar/is-va-istirahat-gunlarinin-yerlarinin--dayisdirilmasi-haqqinda-5982
- https://nk.gov.az/az/senedler/qerarlar/is-va-istirahat-gunlarinin-yerlarinin-dayisdirilmasi-haqqinda-6488
- https://nk.gov.az/az/senedler/qerarlar/is-ve-istirahet-gunlerinin-yerlerinin-deyisdirilme-7047
- https://nk.gov.az/az/senedler/qerarlar/is-ve-istirahet-gunlerinin-yerlerinin-deyisdirilme-7466
- https://nk.gov.az/az/senedler/qerarlar/is-ve-istirahet-gunlerinin-yerlerinin-deyisdirilme-7576
- https://nk.gov.az/az/senedler/qerarlar/is-ve-istirahet-gunlerinin-yerlerinin-deyisdirilme-7843
- https://nk.gov.az/az/senedler/qerarlar/is-ve-istirahet-gunlerinin-yerlerinin-deyisdirilme-8332
- https://nk.gov.az/az/senedler/qerarlar/is-ve-istirahet-gunlerinin-yerlerinin-deyisdirilme-8449
Special holidays references:
- https://www.msk.gov.az/en/elections/pages/municipal-elections/belediyye-29-01-2025
"""

eid_al_adha = tr("Qurban bayrami")
# Substituted date format.
substituted_date_format = tr("%d.%m.%Y")
Expand All @@ -255,6 +271,9 @@ class AzerbaijanStaticHolidays:
# Presidential elections.
presidential_elections = tr("Prezidenti seçkiləri")

# Municipal elections.
municipal_elections = tr("Bələdiyyə seçkiləri")

special_public_holidays = {
2011: (AUG, 29, AUG, 27),
2013: (
Expand All @@ -266,8 +285,7 @@ class AzerbaijanStaticHolidays:
(JAN, 6, DEC, 29, 2013),
),
2018: (APR, 11, presidential_elections),
# Municipal elections.
2019: (DEC, 27, tr("Bələdiyyə seçkiləri")),
2019: (DEC, 27, municipal_elections),
2020: (
(MAR, 27, MAR, 29),
(MAY, 27, MAY, 30),
Expand Down Expand Up @@ -295,6 +313,11 @@ class AzerbaijanStaticHolidays:
(APR, 12, APR, 6),
(NOV, 12, NOV, 16),
(NOV, 13, NOV, 23),
(DEC, 30, DEC, 28),
),
2025: (
(JAN, 3, DEC, 29, 2024),
(JAN, 29, municipal_elections),
),
}

Expand Down
6 changes: 2 additions & 4 deletions holidays/countries/bahamas.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class Bahamas(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta

country = "BS"
observed_label = "%s (observed)"
# Gained Independence on Jul 10, 1973.
start_year = 1974

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand All @@ -48,10 +50,6 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# Gained Independence on Jul 10, 1973.
if self._year <= 1973:
return None

# New Year's Day.
# Pre-2012 Observance:
# - If TUE, New Year's Day (observed) prev MON.
Expand Down
6 changes: 2 additions & 4 deletions holidays/countries/barbados.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class Barbados(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, St

country = "BB"
observed_label = "%s (observed)"
# Public Holidays Act Cap.352, 1968-12-30
start_year = 1969

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand All @@ -42,10 +44,6 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# Public Holidays Act Cap.352, 1968-12-30
if self._year <= 1968:
return None

# New Year's Day
self._add_observed(self._add_new_years_day("New Year's Day"))

Expand Down
Loading

0 comments on commit e2e7592

Please sign in to comment.