Skip to content

Commit

Permalink
Merge pull request #1621 from vacanza/beta
Browse files Browse the repository at this point in the history
v0.40
  • Loading branch information
KJhellico committed Jan 1, 2024
2 parents 08f1a16 + 88b4cc9 commit 6c26b43
Show file tree
Hide file tree
Showing 165 changed files with 28,878 additions and 26,549 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
make package
- name: Upload package artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Get package artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist
path: dist
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- rst

- repo: https://github.com/python/black
rev: 23.12.0
rev: 23.12.1
hooks:
- id: black
exclude: ^(docs)
Expand All @@ -41,7 +41,7 @@ repos:
exclude: ^(docs)

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies: [types-all]
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.40
============

Released January 1, 2024

- Refactor Germany special holidays (#1595 by @KJhellico)
- Add Papua New Guinea holidays (#1605 by @PPsyrius)
- Fix United States and Guam holidays (#1607 by @KJhellico)
- Fix inconsistent localization team naming in .po files (#1602 by @PPsyrius)
- Update IL snapshot (#1608 by @arkid15r)
- Update Kazakhstan: fix URL escaping (#1619 by @heikkiorsila, @arkid15r)
- Update README: fix shields style (#1620 by @arkid15r)
- Update Spain holidays, add l10n support (#1610 by @KJhellico)
- Update Taiwan holidays, add l10n support (#1600 by @PPsyrius)
- Extend native holiday categories support (#1597 by @arkid15r)

Version 0.39
============

Expand Down
37 changes: 21 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,59 @@ It aims to make determining whether a specific date is a holiday as fast and
flexible as possible.

:PyPI:
.. image:: https://img.shields.io/pypi/dm/holidays?color=%2341B5BE
.. image:: https://img.shields.io/pypi/dm/holidays?color=%2341B5BE&style=flat
:target: https://pypi.org/project/holidays
:alt: Downloads

.. image:: https://img.shields.io/pypi/v/holidays?label=version&color=%2341B5BE
.. image:: https://img.shields.io/pypi/v/holidays?color=%2341B5BE&label=version&style=flat
:target: https://pypi.org/project/holidays
:alt: PyPI version

.. image:: https://img.shields.io/github/release-date/vacanza/python-holidays?color=%2341B5BE
.. image:: https://img.shields.io/github/release-date/vacanza/python-holidays?color=%2341B5BE&style=flat
:target: https://github.com/vacanza/python-holidays/releases
:alt: Release date

:CI/CD:
.. image:: https://img.shields.io/github/actions/workflow/status/vacanza/python-holidays/ci-cd.yml?color=%2341BE4A
.. image:: https://img.shields.io/github/actions/workflow/status/vacanza/python-holidays/ci-cd.yml?color=%2341BE4A&style=flat
:target: https://github.com/vacanza/python-holidays/actions
:alt: CI/CD status

.. image:: https://img.shields.io/readthedocs/python-holidays?color=%2341BE4A
.. image:: https://img.shields.io/readthedocs/python-holidays?color=%2341BE4A&style=flat
:target: https://python-holidays.readthedocs.io/en/latest/?badge=latest
:alt: Documentation status

:Code:
.. image:: https://img.shields.io/github/license/vacanza/python-holidays?color=%2341B5BE
.. image:: https://img.shields.io/github/license/vacanza/python-holidays?color=%2341B5BE&style=flat
:target: LICENSE
:alt: License

.. image:: https://img.shields.io/pypi/pyversions/holidays?label=python&color=%2341B5BE
.. image:: https://img.shields.io/pypi/pyversions/holidays?label=python&color=%2341B5BE&style=flat
:target: https://pypi.org/project/holidays
:alt: Python supported versions

.. image:: https://img.shields.io/badge/code%20style-black-%252333F93C0?label=style&color=%2341B5BE
.. image:: https://img.shields.io/badge/code%20style-black-%252333F93C0?label=style&color=%2341B5BE&style=flat
:target: https://github.com/psf/black
:alt: Code style

.. image:: https://img.shields.io/coverallsCoverage/github/vacanza/python-holidays?branch=master&color=%2341B5BE
.. image:: https://img.shields.io/coverallsCoverage/github/vacanza/python-holidays?branch=master&color=%2341B5BE&style=flat
:target: https://coveralls.io/r/vacanza/python-holidays
:alt: Code coverage


:GitHub:
.. image:: https://img.shields.io/github/stars/vacanza/python-holidays?color=%2341BE4A
.. image:: https://img.shields.io/github/stars/vacanza/python-holidays?color=%2341BE4A&style=flat
:target: https://github.com/vacanza/python-holidays/stargazers
:alt: GitHub stars

.. image:: https://img.shields.io/github/forks/vacanza/python-holidays?color=%2341BE4A
.. image:: https://img.shields.io/github/forks/vacanza/python-holidays?color=%2341BE4A&style=flat
:target: https://github.com/vacanza/python-holidays/forks
:alt: GitHub forks

.. image:: https://img.shields.io/github/contributors/vacanza/python-holidays?color=%2341BE4A
.. image:: https://img.shields.io/github/contributors/vacanza/python-holidays?color=%2341BE4A&style=flat
:target: https://github.com/vacanza/python-holidays/graphs/contributors
:alt: GitHub contributors

.. image:: https://img.shields.io/github/last-commit/vacanza/python-holidays/beta?color=%2341BE4A
.. image:: https://img.shields.io/github/last-commit/vacanza/python-holidays/beta?color=%2341BE4A&style=flat
:target: https://github.com/vacanza/python-holidays/commits/beta
:alt: GitHub last commit

Expand Down Expand Up @@ -142,7 +142,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 140 country codes. The standard way to refer to a country
We currently support 141 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 of the countries support more
than one language for holiday names output.
Expand Down Expand Up @@ -673,6 +673,11 @@ All other default values are highlighted with bold:
-
-
-
* - Papua New Guinea
- PG
-
-
-
* - Paraguay
- PY
-
Expand Down Expand Up @@ -756,7 +761,7 @@ All other default values are highlighted with bold:
* - Spain
- ES
- Autonomous communities: AN, AR, AS, CB, CE, CL, CM, CN, CT, EX, GA, IB, MC, MD, ML, NC, PV, RI, VC
-
- en_US, **es**, uk
-
* - Sweden
- SE
Expand All @@ -771,7 +776,7 @@ All other default values are highlighted with bold:
* - Taiwan
- TW
-
-
- en_US, th, zh_CN, **zh_TW**
-
* - Tanzania
- TZ
Expand Down
2 changes: 1 addition & 1 deletion holidays/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from holidays.registry import EntityLoader
from holidays.utils import *

__version__ = "0.39"
__version__ = "0.40"


EntityLoader.load("countries", globals())
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
from .norway import Norway, NO, NOR
from .pakistan import Pakistan, PK, PAK
from .panama import Panama, PA, PAN
from .papua_new_guinea import PapuaNewGuinea, PG, PNG
from .paraguay import Paraguay, PY, PRY
from .peru import Peru, PE, PER
from .philippines import Philippines, PH, PHL
Expand Down
13 changes: 6 additions & 7 deletions holidays/countries/albania.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def __init__(self, *args, **kwargs):
kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_WORKDAY)
super().__init__(*args, **kwargs)

def _populate(self, year):
super()._populate(year)
def _populate_public_holidays(self):
dts_observed = set()

# New Year's Day.
Expand All @@ -49,11 +48,11 @@ def _populate(self, year):
dts_observed.add(self._add_new_years_day_two(name))

# Summer Day.
if year >= 2004:
if self._year >= 2004:
dts_observed.add(self._add_holiday_mar_14("Summer Day"))

# Nevruz.
if year >= 1996:
if self._year >= 1996:
dts_observed.add(self._add_holiday_mar_22("Nevruz"))

# Easter.
Expand All @@ -64,9 +63,9 @@ def _populate(self, year):
dts_observed.add(self._add_labor_day("May Day"))

# Mother Teresa Day.
if 2004 <= year <= 2017:
if 2004 <= self._year <= 2017:
dts_observed.add(self._add_holiday_oct_19("Mother Teresa Beatification Day"))
elif year >= 2018:
elif self._year >= 2018:
dts_observed.add(self._add_holiday_sep_5("Mother Teresa Canonization Day"))

# Independence Day.
Expand All @@ -76,7 +75,7 @@ def _populate(self, year):
dts_observed.add(self._add_holiday_nov_29("Liberation Day"))

# National Youth Day.
if year >= 2009:
if self._year >= 2009:
dts_observed.add(self._add_holiday_dec_8("National Youth Day"))

# Christmas Day.
Expand Down
14 changes: 6 additions & 8 deletions holidays/countries/algeria.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,23 @@ def __init__(self, *args, **kwargs):
IslamicHolidays.__init__(self)
super().__init__(*args, **kwargs)

def _populate(self, year):
super()._populate(year)

def _populate_public_holidays(self):
# New Year's Day.
self._add_new_years_day(tr("رأس السنة الميلادية"))

# In January 2018, Algeria declared Yennayer a national holiday.
if year >= 2018:
if self._year >= 2018:
# Amazigh New Year / Yennayer.
self._add_holiday_jan_12(tr("رأس السنة الأمازيغية"))

# Labor Day.
self._add_labor_day(tr("عيد العمال"))

if year >= 1962:
if self._year >= 1962:
# Independence Day.
self._add_holiday_jul_5(tr("عيد الإستقلال"))

if year >= 1963:
if self._year >= 1963:
# Revolution Day.
self._add_holiday_nov_1(tr("عيد الثورة"))

Expand All @@ -70,14 +68,14 @@ def _populate(self, year):
self._add_eid_al_fitr_day(tr("عيد الفطر"))
# Eid al-Fitr Holiday.
self._add_eid_al_fitr_day_two(tr("عطلة عيد الفطر"))
if year >= 2024:
if self._year >= 2024:
self._add_eid_al_fitr_day_three(tr("عطلة عيد الفطر"))

# Eid al-Adha - Scarfice Festive.
self._add_eid_al_adha_day(tr("عيد الأضحى"))
# Eid al-Adha Holiday.
self._add_eid_al_adha_day_two(tr("عطلة عيد الأضحى"))
if year >= 2023:
if self._year >= 2023:
self._add_eid_al_adha_day_three(tr("عطلة عيد الأضحى"))


Expand Down
4 changes: 2 additions & 2 deletions holidays/countries/american_samoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class HolidaysAS(US):
country = "AS"
subdivisions = () # Override US subdivisions.

def _populate(self, year: int) -> None:
def _populate_public_holidays(self) -> None:
self.subdiv = "AS"
super()._populate(year)
super()._populate_public_holidays()


class AS(HolidaysAS):
Expand Down
4 changes: 1 addition & 3 deletions holidays/countries/andorra.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def __init__(self, *args, **kwargs) -> None:
InternationalHolidays.__init__(self)
super().__init__(*args, **kwargs)

def _populate(self, year: int) -> None:
super()._populate(year)

def _populate_public_holidays(self) -> None:
# New Year's Day.
self._add_new_years_day("New Year's Day")

Expand Down

0 comments on commit 6c26b43

Please sign in to comment.