Skip to content

Commit

Permalink
Merge pull request #1642 from vacanza/beta
Browse files Browse the repository at this point in the history
v0.41
  • Loading branch information
arkid15r committed Jan 15, 2024
2 parents 6c26b43 + 5cdeb5b commit decf58b
Show file tree
Hide file tree
Showing 634 changed files with 93,449 additions and 92,059 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
language_version: python3

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
Expand Down
26 changes: 26 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
Version 0.41
============

Released January 15, 2024

- Introduce observed_estimated_label (#1633 by @arkid15r)
- Refactor Thai calendar (#1628 by @KJhellico)
- Update Portugal holidays: add uk localization (#1616 by @KJhellico)
- Fix dev env setup issues (#1627 by @peter-ni-noob)
- Update Argentina holidays (#1641 by @KJhellico)
- Update China holidays: add observed and substituted holidays in 2001-2024 (#1613 by @KJhellico)
- Update Cyprus holidays (#1632 by @KJhellico)
- Update Malaysia holidays (#1625 by @shahonseven, @arkid15r)
- Update Paraguay holidays (#1634 by @KJhellico)
- Update Thailand holidays (#1626 by @PPsyrius)
- Update US holidays: add CO Cesar Chavez Day (#1629 by @nwithan8)
- Update Uzbekistan holidays, add l10n support (#1622 by @KJhellico)
- Update common tests (#1637 by @arkid15r)
- Update estimated label uk l10n (#1635 by @arkid15r)
- Document the release process (#1611 by @arkid15r)
- Implement en_US localization for all localized countries (#1614 by @KJhellico)
- Move RELEASE.rst to upper level (#1623 by @arkid15r)
- Refresh snapshots, reformat th/cn.po (#1631 by @arkid15r)
- Simplify estimated label text (#1615 by @KJhellico)
- Unify observed labels format (#1636 by @arkid15r)

Version 0.40
============

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ setup:
pre-commit install --hook-type pre-commit
pre-commit install --hook-type pre-push
make l10n
make package

snapshot:
scripts/l10n/generate_mo_files.py
Expand Down
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ All other default values are highlighted with bold:
* - Canada
- CA
- Provinces and territories: AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YT
- ar, **en**, fr, th
- ar, **en_CA**, en_US, fr, th
- GOVERNMENT, OPTIONAL
* - Chad
- TD
Expand Down Expand Up @@ -361,8 +361,8 @@ All other default values are highlighted with bold:
* - Cyprus
- CY
-
- **el**, en_US
-
- **el**, en_CY, en_US, uk
- BANK, OPTIONAL
* - Czechia
- CZ
-
Expand Down Expand Up @@ -586,7 +586,7 @@ All other default values are highlighted with bold:
* - Malta
- MT
-
- en_MT, **mt**
- en_US, **mt**
-
* - Marshall Islands (the)
- MH
Expand Down Expand Up @@ -682,7 +682,7 @@ All other default values are highlighted with bold:
- PY
-
- en_US, **es**, uk
-
- GOVERNMENT
* - Peru
- PE
-
Expand All @@ -701,7 +701,7 @@ All other default values are highlighted with bold:
* - Portugal
- PT
- Districts: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 30
- en_US, **pt_PT**
- en_US, **pt_PT**, uk
- OPTIONAL
* - Puerto Rico
- PR
Expand Down Expand Up @@ -846,7 +846,7 @@ All other default values are highlighted with bold:
* - Uzbekistan
- UZ
-
-
- en_US, uk, **uz**
-
* - Vanuatu
- VU
Expand Down
69 changes: 69 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
How to release a new version of Python Holidays
===============================================

- Finalize the current development version

- switch to ``beta`` branch and pull the most recent changes
from https://github.com/vacanza/python-holidays remote ``beta`` branch.
- generate release notes by running the following script
``scripts/generate_release_notes.py -t <version>``, where <version> is the
value of tag/version you're going to release, e.g. 0.39
- insert the script's output into the top of ``CHANGES`` file
(see previous release notes for consistent formatting)
- commit the updated ``CHANGES`` file to ``beta`` branch with the following
commit message 'Finalize v<version>', e.g. 'Finalize v0.39'
- push changes to https://github.com/vacanza/python-holidays ``beta`` branch
- make sure the push related CI/CD job(s) have been completed successfully

- Merge the finalized changes into ``master`` branch:

- create a new PR for the recent changes from ``beta`` to ``master`` branch
using 'v<version>' as a PR title and the previously generated release notes
as a PR description
- get the PR reviewed by at least one of the code owners
- merge the PR into ``master`` branch with 'Create a merge commit' action
(**do not use 'Squash and merge'**)
- make sure the PR related CI/CD job(s) have been completed successfully
- make sure readthedocs.org documentation build jobs at
https://readthedocs.org/projects/python-holidays/builds/
have been completed successfully

- Create a new release:

- open https://github.com/vacanza/python-holidays/releases page and click
on the 'Draft a new release' button
- click on 'Choose a tag', enter 'v<version>' into the input field
(you should see something like 'Create a new tag: v0.39' on publish'
- select **master** - instead of default ``beta`` in 'Target' dropdown
- put 'v<version>' into 'Release title' field, e.g. 'v0.39'
- click on 'Generate release notes' button to collect new contributors and
full changelog link information (we normally keep it at the bottom with
a bit of re-formatting)
- replace auto-generated release notes with the previously generated release
notes (keep the new contributors and full changelog link)
- check/uncheck the 'Set as the latest release' checkbox depending on the
release status
- save the draft (do not publish it yet)
- preview the release on https://github.com/vacanza/python-holidays/releases
- after making sure everything looks right click 'Edit' and then
'Publish release'

- Verify the new release:

- make sure the release related CI/CD job(s) have been completed successfully
- check https://pypi.org/project/holidays/ package page -- it should have
the current version and the released date updated

- Finish the process with the following post-release actions:

- send "Python Holidays 'v<version>' has been released!" (or similar) message
to Vacanza Team Slack #release channel
- pull the recent changes from ``master`` branch into ``beta``
- bump the Python Holidays version at ``holidays/__init__.py`` file
- create a commit with 'Initialize v<version>' message, e.g.
'Initialize v0.40' and push it to ``beta`` branch (this may require
running ``make package`` to pass the tests locally)
- make sure ``beta`` branch **is not behind** the master branch (there
will be a message on top of the
https://github.com/vacanza/python-holidays/tree/beta page in case it is)
- make sure the push related CI/CD job(s) have been completed successfully
2 changes: 1 addition & 1 deletion docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ will include January 2nd, 2012 as a holiday:
>>> date(2012, 1, 2) in us_holidays
True
>>> us_holidays.get(date(2012 ,1, 2))
"New Year's Day (Observed)"
"New Year's Day (observed)"
The values of :py:attr:`observed` and :py:attr:`expand` can be changed on the
fly and the holiday list will be adjusted accordingly:
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.40"
__version__ = "0.41"


EntityLoader.load("countries", globals())
Expand Down
21 changes: 8 additions & 13 deletions holidays/calendars/thai.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,14 @@ def _get_start_date(self, year: int) -> Optional[date]:
if year < _ThaiLunisolar.START_YEAR or year > _ThaiLunisolar.END_YEAR:
return None

iter_start_date = _ThaiLunisolar.START_DATE
iter_start_year = _ThaiLunisolar.START_YEAR

while iter_start_year < year:
if iter_start_year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN:
delta_days = +384
elif iter_start_year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN:
delta_days = +355
else:
delta_days = +354
iter_start_date += td(days=delta_days)
iter_start_year += 1
return iter_start_date
delta_days = 354 * (year - _ThaiLunisolar.START_YEAR)
for iter_year in range(_ThaiLunisolar.START_YEAR, year):
if iter_year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN:
delta_days += 30
elif iter_year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN:
delta_days += 1

return _ThaiLunisolar.START_DATE + td(days=delta_days)

def makha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
"""
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/albania.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Albania(
"""

country = "AL"
observed_label = "%s (Observed)"
observed_label = "%s (observed)"

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/algeria.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Algeria(HolidayBase, InternationalHolidays, IslamicHolidays):
country = "DZ"
default_language = "ar"
# Estimated label.
estimated_label = tr("(تقدير*) *%s")
estimated_label = tr("(تقدير) %s")
supported_languages = ("ar", "en_US", "fr")

def __init__(self, *args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions holidays/countries/angola.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class Angola(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
country = "AO"
default_language = "pt_AO"
supported_languages = ("en_US", "pt_AO", "uk")
# %s (Observed).
observed_label = tr("%s (Ponte)")
# %s (observed).
observed_label = tr("%s (ponte)")

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand Down
11 changes: 8 additions & 3 deletions holidays/countries/argentina.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Argentina(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, S
http://servicios.lanacion.com.ar/feriados
https://www.clarin.com/feriados/
- [Specific Calendar Year]
https://www.lanacion.com.ar/feriados/2024/
https://www.argentina.gob.ar/interior/feriados-nacionales-2024
https://www.argentina.gob.ar/interior/feriados-nacionales-2023
https://www.argentina.gob.ar/interior/feriados-nacionales-2022
https://www.argentina.gob.ar/interior/feriados-nacionales-2021
Expand All @@ -70,8 +70,8 @@ class Argentina(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, S
country = "AR"
default_language = "es"
supported_languages = ("en_US", "es", "uk")
# %s (Observed).
observed_label = tr("%s (Observado)")
# %s (observed).
observed_label = tr("%s (observado)")

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand Down Expand Up @@ -339,4 +339,9 @@ class ArgentinaStaticHolidays:
(JUN, 19, arg_bridge_public_holiday),
(OCT, 13, arg_bridge_public_holiday),
),
2024: (
(APR, 1, arg_bridge_public_holiday),
(JUN, 21, arg_bridge_public_holiday),
(OCT, 11, arg_bridge_public_holiday),
),
}
2 changes: 1 addition & 1 deletion holidays/countries/australia.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Australia(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, S
"""

country = "AU"
observed_label = "%s (Observed)"
observed_label = "%s (observed)"
subdivisions = ("ACT", "NSW", "NT", "QLD", "SA", "TAS", "VIC", "WA")

@property
Expand Down
8 changes: 5 additions & 3 deletions holidays/countries/azerbaijan.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ class Azerbaijan(ObservedHolidayBase, InternationalHolidays, IslamicHolidays, St

country = "AZ"
default_language = "az"
# Estimated label.
estimated_label = tr("%s* (*təxmini)")
# %s (Observed).
# %s (estimated).
estimated_label = tr("%s (təxmini)")
# %s (observed).
observed_label = tr("%s (müşahidə olunur)")
# %s (observed, estimated).
observed_estimated_label = tr("%s (müşahidə olunur, təxmini)")
supported_categories = (PUBLIC, WORKDAY)
supported_languages = ("az", "en_US", "uk")

Expand Down
18 changes: 9 additions & 9 deletions holidays/countries/bahamas.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Bahamas(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
"""

country = "BS"
observed_label = "%s (Observed)"
observed_label = "%s (observed)"

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand All @@ -53,9 +53,9 @@ def _populate_public_holidays(self):

# New Year's Day.
# Pre-2012 Observance:
# - If TUE, New Year's Day (Observed) prev MON.
# - If WED or THU, New Year's Day (Observed) next FRI.
# 2012 and beyond Observance: If SUN, New Year's Day (Observed) next MON (not for SAT).
# - If TUE, New Year's Day (observed) prev MON.
# - If WED or THU, New Year's Day (observed) next FRI.
# 2012 and beyond Observance: If SUN, New Year's Day (observed) next MON (not for SAT).
self._add_observed(
self._add_new_years_day("New Year's Day"),
rule=SUN_TO_NEXT_MON
Expand Down Expand Up @@ -93,8 +93,8 @@ def _populate_public_holidays(self):
# Known as "Discovery Day" prior to 2013, with its date fixed as Oct 12 annually.
# Got its name changed on Oct 11, 2013 under Majority Rule (Public Holiday) Act 2013.
# Pre-2013 Observance:
# - If TUE, Discovery Day (Observed) prev MON.
# - If WED or THU, Discovery Day (Observed) next FRI.
# - If TUE, Discovery Day (observed) prev MON.
# - If WED or THU, Discovery Day (observed) next FRI.
if self._year >= 2013:
self._add_holiday_2nd_mon_of_oct("National Heroes Day")
else:
Expand All @@ -105,9 +105,9 @@ def _populate_public_holidays(self):

# Christmas Holidays Exception Rules.
# Observance Exception:
# FRI-SAT -> Boxing Day (Observed) next MON.
# SAT-SUN -> Boxing Day (Observed) next MON.
# SUN-MON -> Christmas Day (Observed) next TUE.
# FRI-SAT -> Boxing Day (observed) next MON.
# SAT-SUN -> Boxing Day (observed) next MON.
# SUN-MON -> Christmas Day (observed) next TUE.

# Christmas Day.
self._add_observed(self._add_christmas_day("Christmas Day"), rule=SUN_TO_NEXT_TUE)
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/bahrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Bahrain(HolidayBase, InternationalHolidays, IslamicHolidays):
country = "BH"
default_language = "ar"
# Estimated label.
estimated_label = tr("(تقدير*) *%s")
estimated_label = tr("(تقدير) %s")
supported_languages = ("ar", "en_US")
weekend = {FRI, SAT}

Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/barbados.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Barbados(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, St
"""

country = "BB"
observed_label = "%s (Observed)"
observed_label = "%s (observed)"

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/belize.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Belize(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
"""

country = "BZ"
observed_label = "%s (Observed)"
observed_label = "%s (observed)"

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand Down
4 changes: 2 additions & 2 deletions holidays/countries/bolivia.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class Bolivia(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
country = "BO"
default_language = "es"
supported_languages = ("en_US", "es", "uk")
# %s (Observed).
observed_label = tr("%s (Observado)")
# %s (observed).
observed_label = tr("%s (observado)")
subdivisions = (
"B", # El Beni
"C", # Cochabamba
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/bosnia_and_herzegovina.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class BosniaAndHerzegovina(
country = "BA"
default_language = "bs"
supported_languages = ("bs", "en_US", "sr", "uk")
# %s (Observed).
# %s (observed).
observed_label = tr("%s (preneseno)")
subdivisions = (
"BIH", # Federacija Bosne i Hercegovine
Expand Down

0 comments on commit decf58b

Please sign in to comment.