Skip to content

Commit 0234c7d

Browse files
authored
Merge pull request #2930 from vacanza/dev
v0.81
2 parents 7d0b946 + f3d765e commit 0234c7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+4458
-307
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Check holiday updates
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dry_run:
7+
description: 'Run in dry-run mode (no issues created)'
8+
required: false
9+
default: true
10+
type: boolean
11+
paths:
12+
description: 'Multiline list of paths/globs to check (one per line, leave empty for default)'
13+
required: false
14+
default: ''
15+
type: string
16+
threshold_days:
17+
description: 'Age threshold for files in days'
18+
required: false
19+
default: '120'
20+
type: string
21+
22+
jobs:
23+
check-updates:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
issues: write
28+
steps:
29+
- name: Checkout holidays repository
30+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
31+
with:
32+
fetch-depth: 0 # Get full commit history to accurately determine when each file was last modified
33+
repository: vacanza/holidays
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Check holiday updates
37+
id: check-updates
38+
uses: vacanza/aux/.github/actions/check-holiday-updates@46f7899c8ed2178d1f5f019d9c88a4b1db503060
39+
with:
40+
dry_run: ${{ inputs.dry_run || false }}
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
paths: ${{ inputs.paths || 'holidays/countries/*.py' }}
43+
threshold_days: ${{ inputs.threshold_days || '120' }}
44+
45+
- name: Display results
46+
run: |
47+
echo "📊 Check Holiday Updates Results:"
48+
echo " • Outdated files found: ${{ steps.check-updates.outputs.outdated_files_count }}"
49+
echo " • Issues created: ${{ steps.check-updates.outputs.issues_created_count }}"
50+
51+
if [ "${{ steps.check-updates.outputs.outdated_files_count }}" -gt "0" ]; then
52+
echo "⚠️ Some holiday files may need updating!"
53+
else
54+
echo "✅ All holiday files are up to date!"
55+
fi

.github/workflows/ci-cd.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
3939

4040
- name: Set up Python
41-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
41+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
4242
with:
4343
check-latest: true
4444
python-version: '3.13'
@@ -58,12 +58,12 @@ jobs:
5858
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
5959

6060
- name: Initialize CodeQL
61-
uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498
61+
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3
6262
with:
6363
languages: python
6464

6565
- name: Perform CodeQL Analysis
66-
uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498
66+
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3
6767
with:
6868
category: '/language:python'
6969

@@ -90,7 +90,7 @@ jobs:
9090
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
9191

9292
- name: Set up Python ${{ matrix.python-version }}
93-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
93+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
9494
with:
9595
allow-prereleases: true
9696
cache: pip
@@ -111,7 +111,7 @@ jobs:
111111
make test
112112
113113
- name: Upload coverage to Codecov
114-
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00
114+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
115115
with:
116116
token: ${{ secrets.CODECOV_TOKEN }}
117117

@@ -124,7 +124,7 @@ jobs:
124124
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
125125

126126
- name: Set up Python
127-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
127+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
128128
with:
129129
cache: pip
130130
cache-dependency-path: |
@@ -179,7 +179,7 @@ jobs:
179179
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
180180

181181
- name: Set up Python
182-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
182+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
183183
with:
184184
cache: pip
185185
cache-dependency-path: |
@@ -214,7 +214,7 @@ jobs:
214214
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
215215

216216
- name: Set Up Python
217-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
217+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
218218
with:
219219
cache: pip
220220
cache-dependency-path: requirements/docs.txt
@@ -251,7 +251,7 @@ jobs:
251251
path: dist
252252

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

256256
sign-artifacts:
257257
name: Create SHA1 checksums and Sigstore signatures

.github/workflows/pre-commit-autoupdate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
2121

22-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
22+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
2323
with:
2424
cache: pip
2525
python-version: '3.13'

.github/workflows/prl-labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
pull-requests: write
1111
runs-on: ubuntu-24.04
1212
steps:
13-
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9
13+
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b

.github/workflows/update-snapshots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
2020

2121
- name: Set up Python
22-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
22+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
2323
with:
2424
cache: pip
2525
cache-dependency-path: |

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
- --py39-plus
2626

2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: v0.12.11
28+
rev: v0.13.0
2929
hooks:
3030
- id: ruff-check
3131
- id: ruff-format
@@ -47,7 +47,7 @@ repos:
4747
exclude: ^(docs)
4848

4949
- repo: https://github.com/pre-commit/mirrors-mypy
50-
rev: v1.17.1
50+
rev: v1.18.1
5151
hooks:
5252
- id: mypy
5353
additional_dependencies:

CHANGES.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Version 0.81
2+
3+
Released September 15, 2025
4+
5+
- Add Saint Helena, Ascension and Tristan da Cunha holidays (#2820 by @Abheelash-Mishra, @arkid15r)
6+
- Add Sudan holidays (#2854 by @anshonweb)
7+
- Update Chinese Lunisolar calendar: extend Winter Solstice support (#2927 by @KJhellico)
8+
- Update Philippines holidays: add 2026 holidays (#2912 by @KJhellico)
9+
- Update Spain holidays: add Dec 3 holiday in Navarre (#2895 by @KJhellico)
10+
- Update countries with Eastern holidays: add estimated holidays labels (#2924 by @KJhellico, @arkid15r)
11+
- Update release notes generator (#2929 by @KJhellico)
12+
- Simplify N802 suppression for `common.py` (#2880 by @arkid15r)
13+
114
# Version 0.80
215

316
Released September 1, 2025

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ and detailed information.
105105

106106
## Available Countries
107107

108-
We currently support 240 country codes. The standard way to refer to a country is by using its [ISO
108+
We currently support 242 country codes. The standard way to refer to a country is by using its [ISO
109109
3166-1 alpha-2 code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes), the same used
110110
for domain names, and for a subdivision its [ISO 3166-2
111111
code](https://en.wikipedia.org/wiki/ISO_3166-2). Some countries have common or foreign names or
@@ -1400,6 +1400,13 @@ any) in brackets, available languages and additional holiday categories. All cou
14001400
<td></td>
14011401
</tr>
14021402
<tr>
1403+
<td>Saint Helena, Ascension and Tristan da Cunha</td>
1404+
<td>SH</td>
1405+
<td>Subdivisions: AC (Ascension), HL (Saint Helena), TA (Tristan da Cunha)</td>
1406+
<td><strong>en_GB</strong>, en_US</td>
1407+
<td>GOVERNMENT</td>
1408+
</tr>
1409+
<tr>
14031410
<td>Saint Kitts and Nevis</td>
14041411
<td>KN</td>
14051412
<td></td>
@@ -1575,6 +1582,13 @@ any) in brackets, available languages and additional holiday categories. All cou
15751582
<td>BANK, GOVERNMENT, WORKDAY</td>
15761583
</tr>
15771584
<tr>
1585+
<td>Sudan</td>
1586+
<td>SD</td>
1587+
<td></td>
1588+
<td><strong>ar_SD</strong>, en_US</td>
1589+
<td></td>
1590+
</tr>
1591+
<tr>
15781592
<td>Suriname</td>
15791593
<td>SR</td>
15801594
<td></td>

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
| Version | Supported |
66
|---------| ------------------ |
7-
| 0.80 | :white_check_mark: |
8-
| < 0.80 | :x: |
7+
| 0.81 | :white_check_mark: |
8+
| < 0.81 | :x: |
99

1010
## Reporting a Vulnerability
1111

holidays/calendars/chinese.py

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from typing import Optional
1515

1616
from holidays.calendars.custom import _CustomCalendar
17-
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, SEP, OCT, NOV
17+
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, SEP, OCT, NOV, DEC
1818

1919
CHINESE_CALENDAR = "CHINESE_CALENDAR"
2020
KOREAN_CALENDAR = "KOREAN_CALENDAR"
@@ -1307,6 +1307,24 @@ class _ChineseLunisolar:
13071307
2053: (FEB, 18),
13081308
}
13091309

1310+
WINTER_SOLSTICE_THRESHOLDS: dict[str, dict[str, dict[int, int]]] = {
1311+
# UTC+7.
1312+
VIETNAMESE_CALENDAR: {
1313+
"dec_21": {0: 1980, 1: 2017, 2: 2050, 3: 2083},
1314+
"dec_23": {3: 1943},
1315+
},
1316+
# UTC+8.
1317+
CHINESE_CALENDAR: {
1318+
"dec_21": {0: 1988, 1: 2021, 2: 2058, 3: 2091},
1319+
"dec_23": {3: 1947},
1320+
},
1321+
# UTC+9.
1322+
KOREAN_CALENDAR: {
1323+
"dec_21": {0: 1992, 1: 2029, 2: 2062, 3: 2099},
1324+
"dec_23": {3: 1955},
1325+
},
1326+
}
1327+
13101328
def __init__(self, calendar: str = CHINESE_CALENDAR) -> None:
13111329
self.__verify_calendar(calendar)
13121330
self.__calendar = calendar
@@ -1359,6 +1377,26 @@ def lunar_new_year_date(self, year: int, calendar=None) -> tuple[Optional[date],
13591377
def mid_autumn_date(self, year: int, calendar=None) -> tuple[Optional[date], bool]:
13601378
return self._get_holiday(MID_AUTUMN, year, calendar)
13611379

1380+
def winter_solstice_date(self, year: int, calendar=None) -> tuple[Optional[date], bool]:
1381+
"""Return Winter Solstice (22nd solar term in Chinese Lunisolar calendar) date.
1382+
1383+
!!! note "Note"
1384+
This approximation is reliable for 1941-2099 years.
1385+
"""
1386+
calendar = calendar or self.__calendar
1387+
self.__verify_calendar(calendar)
1388+
1389+
thresholds = self.WINTER_SOLSTICE_THRESHOLDS[calendar]
1390+
year_mod = year % 4
1391+
if year >= thresholds["dec_21"][year_mod]:
1392+
day = 21
1393+
elif year <= thresholds["dec_23"].get(year_mod, 0):
1394+
day = 23
1395+
else:
1396+
day = 22
1397+
1398+
return date(year, DEC, day), not (1941 <= year <= 2099)
1399+
13621400

13631401
class _CustomChineseHolidays(_CustomCalendar, _ChineseLunisolar):
13641402
pass

0 commit comments

Comments
 (0)