Skip to content

Commit

Permalink
Merge pull request #1970 from vacanza/dev
Browse files Browse the repository at this point in the history
v0.56
  • Loading branch information
KJhellico authored Sep 2, 2024
2 parents c1ef720 + d8cfdf4 commit 6626646
Show file tree
Hide file tree
Showing 280 changed files with 23,609 additions and 18,778 deletions.
33 changes: 33 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ci:
- changed-files:
- any-glob-to-any-file:
- .github/**

doc:
- changed-files:
- any-glob-to-any-file:
- docs/**

l10n:
- changed-files:
- any-glob-to-any-file:
- holidays/locale/**

script:
- changed-files:
- any-glob-to-any-file:
- scripts/**

snapshot:
- changed-files:
- any-glob-to-any-file:
- snapshots/**

test:
- changed-files:
- any-glob-to-any-file:
- tests/**

v1:
- head-branch:
- v1
6 changes: 4 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -141,14 +142,14 @@ jobs:
- name: Generate SBOM
if: startsWith(github.event.ref, 'refs/tags/v')
run: |
make sbom > holidays-$VERSION-sbom.json
make sbom > holidays-${{ env.VERSION }}-sbom.json
- name: Upload SBOM
if: startsWith(github.event.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: sbom
path: holidays-$VERSION-sbom.json
path: holidays-${{ env.VERSION }}-sbom.json

test-build:
name: Test build on ${{ matrix.os }}
Expand Down Expand Up @@ -245,6 +246,7 @@ jobs:
name: sbom

- name: Update Github release
if: ${{ always() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/prl-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Pull Request Labeler'

on:
- pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
52 changes: 52 additions & 0 deletions .github/workflows/update-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Update snapshots

on:
push:
branches:
- dev
workflow_dispatch:

jobs:
update-snapshots:
name: Update snapshots
if: github.repository == 'vacanza/python-holidays'
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
cache: pip
cache-dependency-path: |
requirements/build.txt
requirements/dev.txt
check-latest: true
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements/build.txt
python -m pip install -r requirements/dev.txt
make package
python -m pip install dist/*.tar.gz
- name: Generate snapshots
run: |
make snapshot
- uses: peter-evans/[email protected]
with:
base: dev
body: Automatically generated snapshots update.
branch: update-snapshots
commit-message: 'Update snapshots [skip ci]'
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
delete-branch: true
title: 'chore: Update snapshots'
token: ${{ github.token }}
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/astral-sh/ruff-pre-commit
rev: v0.6.1
rev: v0.6.3
hooks:
- id: ruff
- id: ruff-format
Expand Down Expand Up @@ -48,7 +48,7 @@ repos:
exclude: ^(docs)

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

Released September 2, 2024

- Refactor Lao New Year holidays (#1962 by @PPsyrius)
- Add 1991-2022 Russian substituted holidays (#1957 by @PPsyrius)
- Add Dominica holidays (#1956 by @PPsyrius)
- Add Haiti holidays (#1932 by @PPsyrius, @arkid15r)
- Change "St." to "Saint" in holidays names (#1966 by @KJhellico)
- Update Brunei Darussalam islamic holidays for 2024 (#1937 by @PPsyrius)
- Update Cambodian holidays for 2024 (#1936 by @PPsyrius)
- Update Dominican Republic holidays: fix Restoration Day (#1965 by @KJhellico, @arkid15r)
- Update HU: add 2025 substituted holidays (#1954 by @Gizsviu)
- Update Philippines holidays (#1938 by @KJhellico)
- Update SBOM artifact path (#1934 by @arkid15r)
- Update Snapshot for 0.55 changes (#1935 by @PPsyrius)
- Update `numpy` test requirements (#1944 by @PPsyrius, @arkid15r)
- Update pyproject.toml: remove `target-version` from tool.ruff (#1950 by @arkid15r)
- Add Easter Tuesday to Christian holidays group (#1959 by @KJhellico)
- Add New Zealand Subdivision Aliases (`EN`, `MI`, HASC) (#1952 by @PPsyrius)
- Add PR labeler (#1968 by @arkid15r)
- Add Python 3.13 (beta) to CI/CD (#1949 by @KJhellico)
- Add automatic snapshots update workflow (#1939 by @arkid15r)
- Migrate deprecated Bosnia-Herzegovina subdivisions to subdivision aliases (#1947 by @PPsyrius)
- Migrate deprecated Italy subdivisions to subdivision aliases (#1951 by @PPsyrius)
- Migrate deprecated United Kingdom subdivisions to subdivision aliases (#1945 by @PPsyrius, @KJhellico)
- Restore Malaysia's 3-letter code as subdivisions aliases (#1946 by @PPsyrius)
- Standardize snapshot names (#1967 by @arkid15r)

Version 0.55
============

Expand Down
22 changes: 16 additions & 6 deletions 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 150 country codes. The standard way to refer to a country
We currently support 152 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 @@ -277,7 +277,7 @@ All other default values are highlighted with bold:
-
* - Bosnia and Herzegovina
- BA
- Entities and district: BIH, BRC, SRP
- Entities and district: BIH (Federacija Bosne i Hercegovine, FBiH), BRC (Brčko distrikt, BD), SRP (Republika Srpska, RS)
- **bs**, en_US, sr, uk
-
* - Botswana
Expand Down Expand Up @@ -385,6 +385,11 @@ All other default values are highlighted with bold:
-
- ar, en_US, **fr**
-
* - Dominica
- DM
-
-
-
* - Dominican Republic
- DO
-
Expand Down Expand Up @@ -470,6 +475,11 @@ All other default values are highlighted with bold:
-
- en_US, **es**
-
* - Haiti
- HT
-
- en_US, es, **fr_HT**, ht
- OPTIONAL
* - Honduras
- HN
-
Expand Down Expand Up @@ -522,7 +532,7 @@ All other default values are highlighted with bold:
- OPTIONAL, SCHOOL
* - Italy
- IT
- Provinces: AG, AL, AN, AO, AP, AQ, AR, AT, AV, BA, BG, BI, BL, BN, BO, BR, BS, BT, BZ, CA, CB, CE, CH, CL, CN, CO, CR, CS, CT, CZ, EN, FC, FE, FG, FI, FM, FR, GE, GO, GR, IM, IS, KR, LC, LE, LI, LO, LT, LU, MB, MC, ME, MI, MN, MO, MS, MT, NA, NO, NU, OR, PA, PC, PD, PE, PG, PI, PN, PO, PR, PT, PU, PV, PZ, RA, RC, RE, RG, RI, RM, RN, RO, SA, SI, SO, SP, SR, SS, SU, SV, TA, TE, TN, TO, TP, TR, TS, TV, UD, VA, VB, VC, VE, VI, VR, VT, VV. Cities: Andria, Barletta, Cesena, Forli, Pesaro, Trani, Urbino
- Provinces: AG (Agrigento), AL (Alessandria), AN (Ancona), AO (Aosta), AP (Ascoli Piceno), AQ (L'Aquila), AR (Arezzo), AT (Asti), AV (Avellino), BA (Bari), BG (Bergamo), BI (Biella), BL (Belluno), BN (Benevento), BO (Bologna), BR (Brindisi), BS (Brescia), BT (Barletta-Andria-Trani), BZ (Bolzano), CA (Cagliari), CB (Campobasso), CE (Caserta), CH (Chieti), CL (Caltanissetta), CN (Cuneo), CO (Como), CR (Cremona), CS (Cosenza), CT (Catania), CZ (Catanzaro), EN (Enna), FC (Forli-Cesena, Forlì-Cesena), FE (Ferrara), FG (Foggia), FI (Firenze), FM (Fermo), FR (Frosinone), GE (Genova), GO (Gorizia), GR (Grosseto), IM (Imperia), IS (Isernia), KR (Crotone), LC (Lecco), LE (Lecce), LI (Livorno), LO (Lodi), LT (Latina), LU (Lucca), MB (Monza e Brianza), MC (Macerata), ME (Messina), MI (Milano), MN (Mantova), MO (Modena), MS (Massa-Carrara), MT (Matera), NA (Napoli), NO (Novara), NU (Nuoro), OR (Oristano), PA (Palermo), PC (Piacenza), PD (Padova), PE (Pescara), PG (Perugia), PI (Pisa), PN (Pordenone), PO (Prato), PR (Parma), PT (Pistoia), PU (Pesaro e Urbino), PV (Pavia), PZ (Potenza), RA (Ravenna), RC (Reggio Calabria), RE (Reggio Emilia), RG (Ragusa), RI (Rieti), RM (Roma), RN (Rimini), RO (Rovigo), SA (Salerno), SI (Siena), SO (Sondrio), SP (La Spezia), SR (Siracusa), SS (Sassari), SU (Sud Sardegna), SV (Savona), TA (Taranto), TE (Teramo), TN (Trento), TO (Torino), TP (Trapani), TR (Terni), TS (Trieste), TV (Treviso), UD (Udine), VA (Varese), VB (Verbano-Cusio-Ossola), VC (Vercelli), VE (Venezia), VI (Vicenza), VR (Verona), VT (Viterbo), VV (Vibo Valentia). Cities: Andria, Barletta, Cesena, Forli (Forlì), Pesaro, Trani, Urbino
-
-
* - Jamaica
Expand Down Expand Up @@ -607,7 +617,7 @@ All other default values are highlighted with bold:
-
* - Malaysia
- MY
- States and federal territories: 01 (Johor), 02 (Kedah), 03 (Kelantan), 04 (Melaka), 05 (Negeri Sembilan), 06 (Pahang), 07 (Pulau Pinang), 08 (Perak), 09 (Perlis), 10 (Selangor), 11 (Terengganu), 12 (Sabah), 13 (Sarawak), 14 (WP Kuala Lumpur), 15 (WP Labuan), 16 (WP Putrajaya)
- States and federal territories: 01 (Johor, JHR), 02 (Kedah, KDH), 03 (Kelantan, KTN), 04 (Melaka, MLK), 05 (Negeri Sembilan, NSN), 06 (Pahang, PHG), 07 (Pulau Pinang, PNG), 08 (Perak, PRK), 09 (Perlis, PLS), 10 (Selangor, SGR), 11 (Terengganu, TRG), 12 (Sabah, SBH), 13 (Sarawak, SWK), 14 (WP Kuala Lumpur, KUL), 15 (WP Labuan, LBN), 16 (WP Putrajaya, PJY)
- en_US, **ms_MY**
-
* - Maldives
Expand Down Expand Up @@ -672,7 +682,7 @@ All other default values are highlighted with bold:
- OPTIONAL
* - New Zealand
- NZ
- Regions: AUK, BOP, CAN, CIT, GIS, HKB, MBH, MWT, NSN, NTL, OTA, STL, TAS, TKI, WGN, WKO, WTC
- Regions and Special Island Authorities: AUK (Auckland, Tāmaki-Makaurau, AU), BOP (Bay of Plenty, Toi Moana, BP), CAN (Canterbury, Waitaha, CA), CIT (Chatham Islands Territory, Chatham Islands, Wharekauri, CI), GIS (Gisborne, Te Tairāwhiti, GI), HKB (Hawke's Bay, Te Matau-a-Māui, HB), MBH (Marlborough, MA), MWT (Manawatū Whanganui, Manawatū-Whanganui, MW), NSN (Nelson, Whakatū, NE), NTL (Northland, Te Taitokerau, NO), OTA (Otago, Ō Tākou, OT), STL (Southland, Te Taiao Tonga, SO), TAS (Tasman, Te tai o Aorere, TS), TKI (Taranaki, TK), WGN (Greater Wellington, Te Pane Matua Taiao, Wellington, Te Whanganui-a-Tara, WG), WKO (Waikato, WK), WTC (West Coast, Te Tai o Poutini, WC). Subregions: South Canterbury
-
-
* - Nicaragua
Expand Down Expand Up @@ -872,7 +882,7 @@ All other default values are highlighted with bold:
-
* - United Kingdom
- GB
- Subdivisions: ENG, NIR, SCT, WLS
- Subdivisions: ENG (England), NIR (Northern Ireland), SCT (Scotland), WLS (Wales)
-
-
* - United States Minor Outlying Islands
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.55"
__version__ = "0.56"


EntityLoader.load("countries", globals())
Expand Down
2 changes: 2 additions & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from .czechia import Czechia, CZ, CZE
from .denmark import Denmark, DK, DNK
from .djibouti import Djibouti, DJ, DJI
from .dominica import Dominica, DM, DMA
from .dominican_republic import DominicanRepublic, DO, DOM
from .ecuador import Ecuador, EC, ECU
from .egypt import Egypt, EG, EGY
Expand All @@ -70,6 +71,7 @@
from .greenland import Greenland, GL, GRL
from .guam import Guam, GU, GUM, HolidaysGU
from .guatemala import Guatemala, GT, GUA
from .haiti import Haiti, HT, HTI
from .honduras import Honduras, HN, HND
from .hongkong import HongKong, HK, HKG
from .hungary import Hungary, HU, HUN
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/australia.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def _populate_subdiv_tas_public_holidays(self):

# Easter Tuesday.
if self._year <= 2010:
self._add_holiday_2_days_past_easter("Easter Tuesday")
self._add_easter_tuesday("Easter Tuesday")

# ANZAC Day.
if self._year >= 1921:
Expand Down
20 changes: 10 additions & 10 deletions holidays/countries/austria.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _populate_public_holidays(self):
# Christmas Day.
self._add_christmas_day(tr("Christtag"))

# St. Stephen's Day.
# Saint Stephen's Day.
self._add_christmas_day_two(tr("Stefanitag"))

def _populate_bank_holidays(self):
Expand All @@ -121,43 +121,43 @@ def _populate_bank_holidays(self):
self._add_new_years_eve(tr("Silvester"))

def _populate_subdiv_1_bank_holidays(self):
# St. Martin's Day.
# Saint Martin's Day.
self._add_holiday_nov_11(tr("Hl. Martin"))

def _populate_subdiv_2_bank_holidays(self):
# St. Joseph's Day.
# Saint Joseph's Day.
self._add_saint_josephs_day(tr("Hl. Josef"))

# 1920 Carinthian plebiscite.
self._add_holiday_oct_10(tr("Tag der Volksabstimmung"))

def _populate_subdiv_3_bank_holidays(self):
# St. Leopold's Day.
# Saint Leopold's Day.
self._add_holiday_nov_15(tr("Hl. Leopold"))

def _populate_subdiv_4_bank_holidays(self):
if self._year >= 2004:
# St. Florian's Day.
# Saint Florian's Day.
self._add_holiday_may_4(tr("Hl. Florian"))

def _populate_subdiv_5_bank_holidays(self):
# St. Rupert's Day.
# Saint Rupert's Day.
self._add_holiday_sep_24(tr("Hl. Rupert"))

def _populate_subdiv_6_bank_holidays(self):
# St. Joseph's Day.
# Saint Joseph's Day.
self._add_saint_josephs_day(tr("Hl. Josef"))

def _populate_subdiv_7_bank_holidays(self):
# St. Joseph's Day.
# Saint Joseph's Day.
self._add_saint_josephs_day(tr("Hl. Josef"))

def _populate_subdiv_8_bank_holidays(self):
# St. Joseph's Day.
# Saint Joseph's Day.
self._add_saint_josephs_day(tr("Hl. Josef"))

def _populate_subdiv_9_bank_holidays(self):
# St. Leopold's Day.
# Saint Leopold's Day.
self._add_holiday_nov_15(tr("Hl. Leopold"))


Expand Down
20 changes: 8 additions & 12 deletions holidays/countries/bosnia_and_herzegovina.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,14 @@ class BosniaAndHerzegovina(
"BRC", # Brčko distrikt
"SRP", # Republika Srpska
)
_deprecated_subdivisions = (
"BD",
"FBiH",
"RS",
)
subdivisions_aliases = {
"Federacija Bosne i Hercegovine": "BIH",
"FBiH": "BIH",
"Brčko distrikt": "BRC",
"BD": "BRC",
"Republika Srpska": "SRP",
"RS": "SRP",
}

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self, JULIAN_CALENDAR)
Expand All @@ -90,13 +93,6 @@ def _populate_public_holidays(self):
# Eid al-Adha.
self._add_eid_al_adha_day(tr("Kurban Bajram"))

if self.subdiv == "BD":
self._populate_subdiv_brc_public_holidays()
elif self.subdiv == "FBiH":
self._populate_subdiv_bih_public_holidays()
elif self.subdiv == "RS":
self._populate_subdiv_srp_public_holidays()

def _populate_subdiv_holidays(self):
if not self.subdiv:
# New Year's Day.
Expand Down
Loading

0 comments on commit 6626646

Please sign in to comment.