+
Skip to content
Merged

v0.81 #2930

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6db03e7
Initialize v0.81
arkid15r Sep 2, 2025
20d9bc3
Simplify N802 suppression for `common.py` (#2880)
arkid15r Sep 2, 2025
09d3319
Bump cyclonedx-bom from 7.0.0 to 7.1.0 (#2887)
dependabot[bot] Sep 4, 2025
4e4e052
Bump pygithub from 2.7.0 to 2.8.1 (#2892)
dependabot[bot] Sep 4, 2025
1640585
Bump tox from 4.28.4 to 4.30.1 (#2891)
dependabot[bot] Sep 4, 2025
5d1b0db
Bump coverage from 7.10.5 to 7.10.6 (#2890)
dependabot[bot] Sep 4, 2025
1f7fd40
Bump github/codeql-action from 3.29.11 to 3.30.0 (#2889)
dependabot[bot] Sep 4, 2025
61e66cb
Bump ruff from 0.12.10 to 0.12.11 (#2893)
dependabot[bot] Sep 4, 2025
0e0d533
Bump mkdocstrings-python from 1.18.0 to 1.18.2 (#2894)
dependabot[bot] Sep 4, 2025
649b986
Update pre-commit hooks (#2896)
github-actions[bot] Sep 5, 2025
4ea8497
Update Spain holidays: add Dec 3 holiday in Navarre (#2895)
KJhellico Sep 5, 2025
267e160
Add Saint Helena, Ascension and Tristan da Cunha holidays (#2820)
Abheelash-Mishra Sep 6, 2025
a94bcfa
chore: Update snapshots (#2897)
github-actions[bot] Sep 6, 2025
158141b
Add check holiday updates test workflow
arkid15r Sep 7, 2025
3be8c80
Pin check-holiday-updates version
arkid15r Sep 7, 2025
e01daef
chore: Update reference link
KJhellico Sep 10, 2025
d1e4d1c
Update Philippines holidays: add 2026 holidays (#2912)
KJhellico Sep 10, 2025
cece3e1
Bump tox from 4.30.1 to 4.30.2 (#2921)
dependabot[bot] Sep 10, 2025
837e92d
Bump github/codeql-action from 3.30.0 to 3.30.3 (#2914)
dependabot[bot] Sep 10, 2025
40a6416
Bump pytest from 8.4.1 to 8.4.2 (#2920)
dependabot[bot] Sep 10, 2025
b5f406a
Bump codecov/codecov-action from 5.5.0 to 5.5.1 (#2913)
dependabot[bot] Sep 10, 2025
e62941f
Bump pypa/gh-action-pypi-publish from 1.12.4 to 1.13.0 (#2916)
dependabot[bot] Sep 10, 2025
724413e
Bump actions/labeler from 5.0.0 to 6.0.1 (#2917)
dependabot[bot] Sep 10, 2025
b4d882f
Bump pytest-cov from 6.2.1 to 7.0.0 (#2915)
dependabot[bot] Sep 10, 2025
2118476
Bump ruff from 0.12.11 to 0.13.0 (#2919)
dependabot[bot] Sep 11, 2025
e2f7410
Update pre-commit hooks (#2922)
github-actions[bot] Sep 11, 2025
0128617
Bump actions/setup-python from 5.6.0 to 6.0.0 (#2918)
dependabot[bot] Sep 11, 2025
a6840fc
Update pre-commit hooks (#2925)
github-actions[bot] Sep 13, 2025
342b9a7
Add Sudan holidays (#2854)
anshonweb Sep 13, 2025
9068084
chore: Update snapshots (#2926)
github-actions[bot] Sep 13, 2025
b1728bf
Update countries with Eastern holidays: add estimated holidays labels…
KJhellico Sep 13, 2025
02603f2
Update Chinese Lunisolar calendar: extend Winter Solstice support (#2…
KJhellico Sep 15, 2025
ba0d513
Update release notes generator (#2929)
KJhellico Sep 15, 2025
f3d765e
Finalize v0.81
KJhellico Sep 15, 2025
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
55 changes: 55 additions & 0 deletions .github/workflows/check-holiday-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Check holiday updates

on:
workflow_dispatch:
inputs:
dry_run:
description: 'Run in dry-run mode (no issues created)'
required: false
default: true
type: boolean
paths:
description: 'Multiline list of paths/globs to check (one per line, leave empty for default)'
required: false
default: ''
type: string
threshold_days:
description: 'Age threshold for files in days'
required: false
default: '120'
type: string

jobs:
check-updates:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout holidays repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
fetch-depth: 0 # Get full commit history to accurately determine when each file was last modified
repository: vacanza/holidays
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check holiday updates
id: check-updates
uses: vacanza/aux/.github/actions/check-holiday-updates@46f7899c8ed2178d1f5f019d9c88a4b1db503060
with:
dry_run: ${{ inputs.dry_run || false }}
github_token: ${{ secrets.GITHUB_TOKEN }}
paths: ${{ inputs.paths || 'holidays/countries/*.py' }}
threshold_days: ${{ inputs.threshold_days || '120' }}

- name: Display results
run: |
echo "📊 Check Holiday Updates Results:"
echo " • Outdated files found: ${{ steps.check-updates.outputs.outdated_files_count }}"
echo " • Issues created: ${{ steps.check-updates.outputs.issues_created_count }}"

if [ "${{ steps.check-updates.outputs.outdated_files_count }}" -gt "0" ]; then
echo "⚠️ Some holiday files may need updating!"
else
echo "✅ All holiday files are up to date!"
fi
18 changes: 9 additions & 9 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
check-latest: true
python-version: '3.13'
Expand All @@ -58,12 +58,12 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

- name: Initialize CodeQL
uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3
with:
category: '/language:python'

Expand All @@ -90,7 +90,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
allow-prereleases: true
cache: pip
Expand All @@ -111,7 +111,7 @@ jobs:
make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -124,7 +124,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
cache: pip
cache-dependency-path: |
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
cache: pip
cache-dependency-path: |
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

- name: Set Up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
cache: pip
cache-dependency-path: requirements/docs.txt
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:
path: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e

sign-artifacts:
name: Create SHA1 checksums and Sigstore signatures
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
cache: pip
python-version: '3.13'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prl-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
pull-requests: write
runs-on: ubuntu-24.04
steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b
2 changes: 1 addition & 1 deletion .github/workflows/update-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
cache: pip
cache-dependency-path: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
- --py39-plus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.11
rev: v0.13.0
hooks:
- id: ruff-check
- id: ruff-format
Expand All @@ -47,7 +47,7 @@ repos:
exclude: ^(docs)

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.1
rev: v1.18.1
hooks:
- id: mypy
additional_dependencies:
Expand Down
13 changes: 13 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Version 0.81

Released September 15, 2025

- Add Saint Helena, Ascension and Tristan da Cunha holidays (#2820 by @Abheelash-Mishra, @arkid15r)
- Add Sudan holidays (#2854 by @anshonweb)
- Update Chinese Lunisolar calendar: extend Winter Solstice support (#2927 by @KJhellico)
- Update Philippines holidays: add 2026 holidays (#2912 by @KJhellico)
- Update Spain holidays: add Dec 3 holiday in Navarre (#2895 by @KJhellico)
- Update countries with Eastern holidays: add estimated holidays labels (#2924 by @KJhellico, @arkid15r)
- Update release notes generator (#2929 by @KJhellico)
- Simplify N802 suppression for `common.py` (#2880 by @arkid15r)

# Version 0.80

Released September 1, 2025
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ and detailed information.

## Available Countries

We currently support 240 country codes. The standard way to refer to a country is by using its [ISO
We currently support 242 country codes. The standard way to refer to a country is by using its [ISO
3166-1 alpha-2 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes), the same used
for domain names, and for a subdivision its [ISO 3166-2
code](https://en.wikipedia.org/wiki/ISO_3166-2). Some countries have common or foreign names or
Expand Down Expand Up @@ -1400,6 +1400,13 @@ any) in brackets, available languages and additional holiday categories. All cou
<td></td>
</tr>
<tr>
<td>Saint Helena, Ascension and Tristan da Cunha</td>
<td>SH</td>
<td>Subdivisions: AC (Ascension), HL (Saint Helena), TA (Tristan da Cunha)</td>
<td><strong>en_GB</strong>, en_US</td>
<td>GOVERNMENT</td>
</tr>
<tr>
<td>Saint Kitts and Nevis</td>
<td>KN</td>
<td></td>
Expand Down Expand Up @@ -1575,6 +1582,13 @@ any) in brackets, available languages and additional holiday categories. All cou
<td>BANK, GOVERNMENT, WORKDAY</td>
</tr>
<tr>
<td>Sudan</td>
<td>SD</td>
<td></td>
<td><strong>ar_SD</strong>, en_US</td>
<td></td>
</tr>
<tr>
<td>Suriname</td>
<td>SR</td>
<td></td>
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

| Version | Supported |
|---------| ------------------ |
| 0.80 | :white_check_mark: |
| < 0.80 | :x: |
| 0.81 | :white_check_mark: |
| < 0.81 | :x: |

## Reporting a Vulnerability

Expand Down
40 changes: 39 additions & 1 deletion holidays/calendars/chinese.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from typing import Optional

from holidays.calendars.custom import _CustomCalendar
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, SEP, OCT, NOV
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, SEP, OCT, NOV, DEC

CHINESE_CALENDAR = "CHINESE_CALENDAR"
KOREAN_CALENDAR = "KOREAN_CALENDAR"
Expand Down Expand Up @@ -1307,6 +1307,24 @@ class _ChineseLunisolar:
2053: (FEB, 18),
}

WINTER_SOLSTICE_THRESHOLDS: dict[str, dict[str, dict[int, int]]] = {
# UTC+7.
VIETNAMESE_CALENDAR: {
"dec_21": {0: 1980, 1: 2017, 2: 2050, 3: 2083},
"dec_23": {3: 1943},
},
# UTC+8.
CHINESE_CALENDAR: {
"dec_21": {0: 1988, 1: 2021, 2: 2058, 3: 2091},
"dec_23": {3: 1947},
},
# UTC+9.
KOREAN_CALENDAR: {
"dec_21": {0: 1992, 1: 2029, 2: 2062, 3: 2099},
"dec_23": {3: 1955},
},
}

def __init__(self, calendar: str = CHINESE_CALENDAR) -> None:
self.__verify_calendar(calendar)
self.__calendar = calendar
Expand Down Expand Up @@ -1359,6 +1377,26 @@ def lunar_new_year_date(self, year: int, calendar=None) -> tuple[Optional[date],
def mid_autumn_date(self, year: int, calendar=None) -> tuple[Optional[date], bool]:
return self._get_holiday(MID_AUTUMN, year, calendar)

def winter_solstice_date(self, year: int, calendar=None) -> tuple[Optional[date], bool]:
"""Return Winter Solstice (22nd solar term in Chinese Lunisolar calendar) date.

!!! note "Note"
This approximation is reliable for 1941-2099 years.
"""
calendar = calendar or self.__calendar
self.__verify_calendar(calendar)

thresholds = self.WINTER_SOLSTICE_THRESHOLDS[calendar]
year_mod = year % 4
if year >= thresholds["dec_21"][year_mod]:
day = 21
elif year <= thresholds["dec_23"].get(year_mod, 0):
day = 23
else:
day = 22

return date(year, DEC, day), not (1941 <= year <= 2099)


class _CustomChineseHolidays(_CustomCalendar, _ChineseLunisolar):
pass
6 changes: 6 additions & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@
from holidays.countries.russia import Russia, RU, RUS
from holidays.countries.rwanda import Rwanda, RW, RWA
from holidays.countries.saint_barthelemy import SaintBarthelemy, BL, BLM, HolidaysBL
from holidays.countries.saint_helena_ascension_and_tristan_da_cunha import (
SaintHelenaAscensionAndTristanDaCunha,
SH,
SHN,
)
from holidays.countries.saint_kitts_and_nevis import SaintKittsAndNevis, KN, KNA
from holidays.countries.saint_lucia import SaintLucia, LC, LCA
from holidays.countries.saint_martin import SaintMartin, MF, MAF, HolidaysMF
Expand Down Expand Up @@ -234,6 +239,7 @@
from holidays.countries.south_sudan import SouthSudan, SS, SSD
from holidays.countries.spain import Spain, ES, ESP
from holidays.countries.sri_lanka import SriLanka, LK, LKA
from holidays.countries.sudan import Sudan, SD, SDN
from holidays.countries.suriname import Suriname, SR, SUR
from holidays.countries.svalbard_and_jan_mayen import SvalbardAndJanMayen, SJ, SJM, HolidaysSJ
from holidays.countries.sweden import Sweden, SE, SWE
Expand Down
4 changes: 4 additions & 0 deletions holidays/countries/china.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class China(ObservedHolidayBase, ChineseCalendarHolidays, InternationalHolidays,
"""

country = "CN"
# %s (estimated).
estimated_label = tr("%s(推定)")
# %s (observed, estimated).
observed_estimated_label = tr("%s(观察日,推定)")
# %s (observed).
observed_label = tr("%s(观察日)")
supported_categories = (PUBLIC, HALF_DAY)
Expand Down
6 changes: 5 additions & 1 deletion holidays/countries/hongkong.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ class HongKong(
country = "HK"
default_language = "zh_HK"
default_preferred_discretionary_holidays = (CHRISTMAS,)
# %s (estimated).
estimated_label = tr("%s(推定)")
# %s (observed, estimated).
observed_estimated_label = tr("%s(補假,推定)")
# %s (observed).
observed_label = tr("%s(慶祝)")
observed_label = tr("%s(補假)")
supported_categories = (OPTIONAL, PUBLIC)
supported_languages = ("en_HK", "en_US", "th", "zh_CN", "zh_HK")
weekend = {SUN}
Expand Down
9 changes: 9 additions & 0 deletions holidays/countries/macau.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class Macau(

country = "MO"
default_language = "zh_MO"
# %s (estimated).
estimated_label = tr("%s(推定)")
# Decreto-Lei n.º 4/82/M.
start_year = 1982
subdivisions = (
Expand Down Expand Up @@ -374,6 +376,13 @@ def _populate_government_holidays(self):
# The first working day after %s.
else self.tr("%s後首個工作日")
)
self.observed_estimated_label = (
# Compensatory rest day for %s (estimated).
self.tr("%s的補假(推定)")
if self._year >= 2020
# The first working day after %s (estimated).
else self.tr("%s後首個工作日(推定)")
)
# Prior to 2012, in-lieus are only given for holidays which falls on Sunday.
self._observed_rule = (
SUN_TO_NEXT_WORKDAY if self._year <= 2011 else SAT_SUN_TO_NEXT_WORKDAY
Expand Down
2 changes: 2 additions & 0 deletions holidays/countries/mongolia.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Mongolia(HolidayBase, InternationalHolidays, MongolianCalendarHolidays):

country = "MN"
default_language = "mn"
# %s (estimated).
estimated_label = tr("%s (урьдчилсан)")
start_year = 2004
supported_categories = (PUBLIC, WORKDAY)
supported_languages = ("en_US", "mn")
Expand Down
Loading
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载