Skip to content

Commit ab12239

Browse files
Merge branch 'master' into no-more-master
2 parents edb2c1f + 68d4d51 commit ab12239

22 files changed

Lines changed: 195 additions & 87 deletions

.github/dependabot.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ updates:
77
groups:
88
actions:
99
patterns:
10-
- "*"
10+
- "*"
11+
cooldown:
12+
# https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
13+
# Cooldowns protect against supply chain attacks by avoiding the
14+
# highest-risk window immediately after new releases.
15+
default-days: 14

.github/workflows/auto-tag.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,33 @@ jobs:
1414
contents: write
1515
steps:
1616
- name: Check out repository
17-
uses: actions/checkout@v6
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
persist-credentials: true # Needed to push the tag
1820

1921
- name: Get current version
2022
id: version
2123
run: |
2224
VERSION=$(cat VERSION)
23-
echo "version=$VERSION" >> $GITHUB_OUTPUT
25+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
2426
2527
- name: Check if tag already exists
2628
id: checktag
29+
env:
30+
VERSION: ${{ steps.version.outputs.version }}
2731
run: |
28-
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
29-
echo "skip=true" >> $GITHUB_OUTPUT
32+
if git rev-parse "${VERSION}" >/dev/null 2>&1; then
33+
echo "skip=true" >> "$GITHUB_OUTPUT"
3034
else
31-
echo "skip=false" >> $GITHUB_OUTPUT
35+
echo "skip=false" >> "$GITHUB_OUTPUT"
3236
fi
3337
3438
- name: Push tag
3539
if: steps.checktag.outputs.skip == 'false'
40+
env:
41+
VERSION: ${{ steps.version.outputs.version }}
3642
run: |
3743
git config user.name "github-actions[bot]"
3844
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39-
git tag "${{ steps.version.outputs.version }}"
40-
git push origin "${{ steps.version.outputs.version }}"
45+
git tag "${VERSION}"
46+
git push origin "${VERSION}"

.github/workflows/check-for-updates.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ on:
55
- cron: '0 9 * * *' # Runs daily at 9AM UTC
66
workflow_dispatch:
77

8+
permissions: {}
9+
810
jobs:
911
check-pr-exists:
1012
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: read
1115
outputs:
1216
pr_exists: ${{ steps.check_pr_exists.outputs.pr_exists }}
1317
steps:
@@ -16,15 +20,15 @@ jobs:
1620
env:
1721
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1822
run: |
19-
PR_EXISTS=$(gh pr --repo $GITHUB_REPOSITORY \
23+
PR_EXISTS=$(gh pr --repo "$GITHUB_REPOSITORY" \
2024
list --search "Update tzdata to version" \
2125
--json number --jq '.[] | .number')
2226
if [ -n "$PR_EXISTS" ]; then
2327
echo "A PR updating the tzdata version already exists: https://github.com/python/tzdata/pulls/${PR_EXISTS}"
24-
echo "pr_exists=true" >> $GITHUB_OUTPUT
28+
echo "pr_exists=true" >> "$GITHUB_OUTPUT"
2529
exit 0
2630
else
27-
echo "pr_exists=false" >> $GITHUB_OUTPUT
31+
echo "pr_exists=false" >> "$GITHUB_OUTPUT"
2832
fi
2933
3034
check-for-updates:
@@ -36,12 +40,13 @@ jobs:
3640
if: needs.check-pr-exists.outputs.pr_exists == 'false' # Run only if no PR exists
3741
steps:
3842
- name: Check out repository (shallow)
39-
uses: actions/checkout@v6
43+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4044
with:
4145
fetch-depth: 1 # Shallow clone to save time
46+
persist-credentials: true # Needed to push the update
4247

4348
- name: Set up Python 3.12
44-
uses: actions/setup-python@v6
49+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4550
with:
4651
python-version: '3.12'
4752

@@ -62,7 +67,7 @@ jobs:
6267
# Check for changes
6368
if git diff --quiet; then
6469
echo "No changes detected."
65-
echo "CHANGES_DETECTED=false" >> $GITHUB_ENV
70+
echo "CHANGES_DETECTED=false" >> "$GITHUB_ENV"
6671
exit 0
6772
fi
6873
@@ -75,19 +80,19 @@ jobs:
7580
exit 1
7681
fi
7782
78-
if [ $(echo "$news_files" | wc -l) -ne 1 ]; then
83+
if [ "$(echo "$news_files" | wc -l)" -ne 1 ]; then
7984
echo "More than one new file added in news.d, failing the job."
8085
exit 1
8186
fi
82-
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
87+
echo "CHANGES_DETECTED=true" >> "$GITHUB_ENV"
8388
8489
# Extract TZDATA_VERSION from filename
8590
TZDATA_VERSION=$(basename "$news_files" .md)
8691
8792
# Extract TZDATA_NEWS from file content
8893
TZDATA_NEWS=$(cat "$news_files")
8994
90-
echo "TZDATA_VERSION=$TZDATA_VERSION" >> $GITHUB_ENV
95+
echo "TZDATA_VERSION=$TZDATA_VERSION" >> "$GITHUB_ENV"
9196
{
9297
echo "TZDATA_NEWS<<EOF"
9398
echo "$TZDATA_NEWS"
@@ -111,5 +116,5 @@ jobs:
111116
gh pr create --title "Update tzdata to version $TZDATA_VERSION" \
112117
--body "$TZDATA_NEWS" \
113118
--base main \
114-
--head $(git rev-parse --abbrev-ref HEAD) \
119+
--head "$(git rev-parse --abbrev-ref HEAD)" \
115120
--label "automatic-updates"

.github/workflows/publish.yml

Lines changed: 80 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,92 @@
99
name: Upload package
1010

1111
on:
12-
release:
13-
types: [created]
1412
push:
15-
tags:
16-
- '*'
13+
pull_request:
14+
release:
15+
types:
16+
- published
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
22+
env:
23+
FORCE_COLOR: 1
1724

1825
jobs:
19-
deploy:
26+
build-package:
27+
name: Build & verify package
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
with:
33+
persist-credentials: false
34+
35+
- uses: hynek/build-and-inspect-python-package@fe0a0fb1925ca263d076ca4f2c13e93a6e92a33e # v2.17.0
36+
37+
test-package:
38+
name: Test package
39+
if: |
40+
github.event.repository.fork == false
41+
&& (
42+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
43+
|| github.event.action == 'published'
44+
)
45+
needs: build-package
46+
uses: ./.github/workflows/tests.yml
47+
48+
# Publish to TestPyPI for every tag.
49+
release-test-pypi:
50+
name: Publish to TestPyPI
51+
if: |
52+
github.event.repository.fork == false
53+
&& github.event_name == 'push'
54+
&& startsWith(github.ref, 'refs/tags/')
55+
runs-on: ubuntu-latest
56+
needs: test-package
57+
58+
permissions:
59+
id-token: write
60+
61+
steps:
62+
- name: Download packages built by build-and-inspect-python-package
63+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
64+
with:
65+
name: Packages
66+
path: dist
67+
68+
- name: Publish to Test PyPI
69+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
70+
with:
71+
repository-url: https://test.pypi.org/legacy/
72+
73+
release-pypi:
74+
name: Publish to PyPI
75+
# Only run for published releases.
76+
if: |
77+
github.event.repository.fork == false
78+
&& github.event.action == 'published'
2079
runs-on: ubuntu-latest
80+
needs: test-package
81+
2182
environment:
2283
name: release
23-
url: https://pypi.org/p/tzdata
84+
url: >-
85+
https://pypi.org/project/tzdata/${{
86+
github.event.release.tag_name
87+
}}
88+
2489
permissions:
2590
id-token: write
91+
2692
steps:
27-
- uses: actions/checkout@v6
28-
- name: Set up Python
29-
uses: actions/setup-python@v6
30-
with:
31-
python-version: '3.x'
32-
- name: Install dependencies
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install -U tox
36-
- name: Create tox environments
37-
run: |
38-
tox -p -e py,build --notest
39-
- name: Run tests
40-
run: |
41-
tox -e py
42-
- name: Build package
43-
run: |
44-
tox -e build
45-
- name: Publish package (TestPyPI)
46-
if: github.event_name == 'push'
47-
uses: pypa/gh-action-pypi-publish@release/v1
48-
with:
49-
repository-url: https://test.pypi.org/legacy/
50-
verbose: true
51-
- name: Publish package
52-
if: github.event_name == 'release'
53-
uses: pypa/gh-action-pypi-publish@release/v1
54-
with:
55-
verbose: true
93+
- name: Download packages built by build-and-inspect-python-package
94+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
95+
with:
96+
name: Packages
97+
path: dist
98+
99+
- name: Publish to PyPI
100+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0

.github/workflows/tests.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ on:
55
branches:
66
- main
77
pull_request:
8+
workflow_call:
89
workflow_dispatch:
910

11+
permissions: {}
12+
1013
jobs:
1114
tests:
1215

@@ -25,12 +28,14 @@ jobs:
2528
env:
2629
TOXENV: py
2730
container:
28-
image: ${{ matrix.use-container && format('python:{0}', matrix.python-version) || '' }}
31+
image: ${{ matrix.use-container && format('python:{0}', matrix.python-version) || '' }} # zizmor: ignore[unpinned-images]
2932
steps:
30-
- uses: actions/checkout@v6
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
with:
35+
persist-credentials: false
3136
- if: ${{ !matrix.use-container }}
3237
name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} (non-containers)
33-
uses: actions/setup-python@v6
38+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3439
with:
3540
python-version: ${{ matrix.python-version }}
3641
allow-prereleases: true
@@ -46,14 +51,16 @@ jobs:
4651
runs-on: "ubuntu-latest"
4752
strategy:
4853
matrix:
49-
toxenv: ["build", "precommit", "typing", "docs"]
54+
toxenv: ["precommit", "typing", "docs"]
5055
env:
5156
TOXENV: ${{ matrix.toxenv }}
5257

5358
steps:
54-
- uses: actions/checkout@v6
59+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
60+
with:
61+
persist-credentials: false
5562
- name: ${{ matrix.toxenv }}
56-
uses: actions/setup-python@v6
63+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5764
with:
5865
python-version: "3.x"
5966
- name: Install tox

.pre-commit-config.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 25.9.0
3+
rev: 26.3.1
44
hooks:
55
- id: black
66
language_version: "python3.12"
77

88
- repo: https://github.com/pycqa/isort
9-
rev: 7.0.0
9+
rev: 8.0.1
1010
hooks:
1111
- id: isort
1212
additional_dependencies: [ toml ]
@@ -18,7 +18,28 @@ repos:
1818
- id: trailing-whitespace
1919
- id: debug-statements
2020

21+
- repo: https://github.com/python-jsonschema/check-jsonschema
22+
rev: 0.37.1
23+
hooks:
24+
- id: check-dependabot
25+
- id: check-github-workflows
26+
27+
- repo: https://github.com/rhysd/actionlint
28+
rev: v1.7.12
29+
hooks:
30+
- id: actionlint
31+
32+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
33+
rev: v1.24.1
34+
hooks:
35+
- id: zizmor
36+
2137
- repo: https://github.com/asottile/setup-cfg-fmt
22-
rev: v3.1.0
38+
rev: v3.2.0
2339
hooks:
2440
- id: setup-cfg-fmt
41+
42+
- repo: meta
43+
hooks:
44+
- id: check-hooks-apply
45+
- id: check-useless-excludes

NEWS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# Version 2026.2
2+
Upstream version 2026b released 2026-04-23T06:06:43+00:00
3+
4+
## Briefly:
5+
6+
British Columbia moved to permanent -07 on 2026-03-09. Some more overflow bugs
7+
have been fixed in zic.
8+
9+
## Changes to future timestamps
10+
11+
British Columbia’s 2026-03-08 spring forward was its last foreseeable clock
12+
change, as it moved to permanent -07 thereafter. (Thanks to Arthur David Olson.)
13+
Although the change to permanent -07 legally took place on 2026-03-09,
14+
temporarily model the change to occur on 2026-11-01 at 02:00 instead. This
15+
works around a limitation in CLDR v48.2 (2026-03-17). This temporary hack is
16+
planned to be removed after CLDR is fixed.
17+
18+
---
19+
120
# Version 2026.1
221
Upstream version 2026a released 2026-03-02T06:59:49+00:00
322

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tzdata: Python package providing IANA time zone data
44
This is a Python package containing ``zic``-compiled binaries for the IANA time
55
zone database. It is intended to be a fallback for systems that do not have
66
system time zone data installed (or don't have it installed in a standard
7-
location), as a part of `PEP 615 <https://www.python.org/dev/peps/pep-0615/>`_
7+
location), as a part of `PEP 615 <https://www.python.org/dev/peps/pep-0615/>`_.
88

99
This repository generates a ``pip``-installable package, published on PyPI as
1010
`tzdata <https://pypi.org/project/tzdata>`_.

0 commit comments

Comments
 (0)