Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport zoneinfo logic into dateutil.tz.tzfile #1130

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
99a5a0e
Pin darker to 1.7.2
pganssle Apr 27, 2023
fa5e4d5
Add test for PEP 495 gap logic in tzfile
pganssle May 20, 2021
1db86ea
Remove test of implementation details
pganssle May 20, 2021
8d2fd24
Backport zoneinfo logic into tzfile
pganssle May 20, 2021
72fb0c1
Add support for key property
pganssle Sep 17, 2021
9ee7026
Add backport for a bug in os.path.isfile
pganssle Sep 24, 2021
310e652
Add support for tzdata
pganssle Dec 3, 2022
3c44a41
Remove xfail markers
pganssle Dec 3, 2022
0d4bae5
Skip property test on Python 2.7
pganssle Dec 3, 2022
a56d4f1
Add available_iana_zones function
pganssle Dec 3, 2022
f32c16b
Increase deadline for isoparse test
pganssle Dec 3, 2022
1c62c92
Add support for TZPATH
pganssle Apr 26, 2023
938b878
Update tox.ini
pganssle Apr 26, 2023
11f929f
Backport context-decorator functionality
pganssle Apr 26, 2023
4735abe
Drop updatezinfo
pganssle Apr 27, 2023
4ae316e
Bump docs basepython to 3.10
pganssle Apr 27, 2023
1ed6798
Remove the updatezinfo script
pganssle Apr 27, 2023
8d196d0
Update documentation config
pganssle Apr 27, 2023
0b61382
Explicitly deprecate zoneinfo, remove from __all__
pganssle Apr 27, 2023
116140e
Skip lazy import test on <3.7
pganssle Apr 27, 2023
ac84b17
TEMP: Fast-fail
pganssle Apr 26, 2023
1dcd608
Add test for TZPATH changes
pganssle Nov 13, 2023
5c7accd
Update manifest
pganssle May 20, 2024
f47ed9e
Fix available_iana_timezones when tzdata is missing
pganssle May 20, 2024
422c893
WIP: Start backporting tests
pganssle May 20, 2024
21fb5aa
Code formatting in tzfile
pganssle May 20, 2024
06c136e
Attempt to install tzdata as part of CI
pganssle May 20, 2024
c6f7e9d
Try building in DESTDIR first
pganssle May 20, 2024
b8b1f07
Remove 3.5, 3.6 and 3.7 macos builds
pganssle May 20, 2024
a03202e
Remove codecov
pganssle May 20, 2024
a456664
Skip some tests on rearguard
pganssle May 20, 2024
29d4a77
Fix /etc/localtime
pganssle May 20, 2024
e0392b0
Change tzdata version handling
pganssle May 20, 2024
d1290cc
Skip version checks on some runners
pganssle May 20, 2024
936a7c1
Fixup tzpath
pganssle May 21, 2024
8823a56
Fixes related to sub-minute offsets
pganssle May 21, 2024
8031962
Test fixes related to sub-minute offsets
pganssle May 21, 2024
ce4993f
Tests for various gaps and folds
pganssle May 21, 2024
3be426e
Add tests for setting fold when converting from UTC
pganssle May 21, 2024
d4b431e
Add tests for datetime.time objects
pganssle May 21, 2024
d612120
Add test zone construction function
pganssle May 21, 2024
a8c74f5
Add a test for a zone with 1 transition
pganssle May 21, 2024
8c5b69b
Add a test with one DST -> DST transition
pganssle May 21, 2024
999297e
Add a test for no TZSTR set
pganssle May 21, 2024
b9216eb
Add test for zones with no transitions
pganssle May 21, 2024
90d9047
Add test that empty zones raise
pganssle May 21, 2024
aff6615
Add tests for very large transition values
pganssle May 21, 2024
8a62bc7
Add tests for fixed offset zones with phantom transitions
pganssle May 21, 2024
d76722a
Refactor weirdzone tests
pganssle May 21, 2024
89bf03f
fixup! Add tests for very large transition values
pganssle May 22, 2024
1ffb75d
Add tzstr tests
pganssle May 22, 2024
31beb8b
Add TZStr-specific tests
pganssle May 22, 2024
dfd7b58
Add key to repr
pganssle May 22, 2024
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
63 changes: 42 additions & 21 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: [
"2.7",
Expand All @@ -28,26 +29,45 @@ jobs:
]
os: [ubuntu-latest, windows-latest, macos-latest]
exclude:
- python-version: "3.5"
os: "windows-latest"
- python-version: "2.7"
os: "ubuntu-latest"
- python-version: "2.7"
os: "windows-latest"
- python-version: "2.7"
os: "macos-latest"
- python-version: "3.5"
os: "macos-latest"
- python-version: "3.6"
os: "macos-latest"
- python-version: "3.7"
os: "macos-latest"
- python-version: "3.5"
os: "ubuntu-latest"
- python-version: "3.6"
os: "ubuntu-latest"
include:
- python-version: "2.7"
os: "ubuntu-20.04"
env:
PIP_TRUSTED_HOST: pypi.python.org,pypi.org,files.pythonhosted.org
- python-version: "3.5"
os: "ubuntu-20.04"
env:
PIP_TRUSTED_HOST: pypi.python.org,pypi.org,files.pythonhosted.org
- python-version: "3.6"
os: "ubuntu-20.04"
env:
PIP_TRUSTED_HOST: pypi.python.org,pypi.org,files.pythonhosted.org
- python-version: "3.5"
os: "windows-latest"
env:
PIP_TRUSTED_HOST: pypi.python.org,pypi.org,files.pythonhosted.org
runs-on: ${{ matrix.os }}
env:
TOXENV: py
PIP_TRUSTED_HOST: pypi.python.org
steps:
- uses: actions/checkout@v3
- if: ${{ matrix.python-version == '2.7' }}
Expand All @@ -62,31 +82,32 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: python -m pip install -U tox six
- name: Install zic (Windows)
- name: Install lzip
run: sudo apt-get install lzip
if: startsWith(matrix.os, 'ubuntu')
- name: Install specific tzdata version
run: |
curl https://get.enterprisedb.com/postgresql/postgresql-9.5.21-2-windows-x64-binaries.zip --output $env:GITHUB_WORKSPACE\postgresql9.5.21.zip
unzip -oq $env:GITHUB_WORKSPACE\postgresql9.5.21.zip -d .postgresql
if: runner.os == 'Windows'
- name: Run updatezinfo.py (Windows)
run: |
$env:Path += ";$env:GITHUB_WORKSPACE\.postgresql\pgsql\bin"
ci_tools/retry.bat python updatezinfo.py
if: runner.os == 'Windows'
- name: Run updatezinfo.py (Unix)
run: ./ci_tools/retry.sh python updatezinfo.py
if: runner.os != 'Windows'
TZDATA_VERSION="2024a"
TMP_DIR=$(mktemp -d)
cd $TMP_DIR
curl --fail --location "https://data.iana.org/time-zones/releases/tzdb-${TZDATA_VERSION}.tar.lz" -o tzdb.tar.lz
tar --lzip -xf tzdb.tar.lz
cd tzdb-${TZDATA_VERSION}
sudo rm -rf /usr/share/zoneinfo
sudo make install DESTDIR=./tzdata \
DATAFORM=main

ls tzdata
sudo mv ./tzdata/usr/share/zoneinfo/ /usr/share/zoneinfo

cat /usr/share/zoneinfo/tzdata.zi | head -n 1
if: startsWith(matrix.os, 'ubuntu')
- name: Install dependencies
run: python -m pip install -U tox
- name: Run tox
run: python -m tox
- name: Generate coverage.xml
run: python -m tox -e coverage
- name: Report coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./.tox/coverage.xml
name: ${{ matrix.os }}:${{ matrix.python-version }}
fail_ci_if_error: true

other:
runs-on: "ubuntu-latest"
Expand Down Expand Up @@ -123,7 +144,7 @@ jobs:
with:
options: "--check --diff --color --isort"
src: "."
version: "~=1.7.1"
version: "1.7.2"

build-dist:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ src/dateutil/_version.py

# Sphinx documentation
docs/_build/
docs/docs_venv

# Timezone information
tzdata*.tar.gz
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ install:
pip install -U setuptools
fi
- pip install -U "tox<3.8.0" $PIP_ARGS
- if [[ $TOXENV == "py" ]]; then ./ci_tools/retry.sh python updatezinfo.py; fi

script:
- tox
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include LICENSE NEWS zonefile_metadata.json updatezinfo.py pyproject.toml
include LICENSE NEWS pyproject.toml
recursive-include tests/ *
global-exclude __pycache__
global-exclude *.py[co]
2 changes: 0 additions & 2 deletions RELEASING
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ Release Checklist
-----------------------------------------
[ ] Update classifiers in setup.cfg to include the latest supported Python
versions.
[ ] Update the metadata in zonefile_metadata.json to include the latest tzdata
release from https://www.iana.org/time-zones.
[ ] If necessary, update the tzdata mirror at https://github.com/dateutil/tzdata
[ ] Update NEWS with list of changes:
[ ] Invoke `tox -e news -- --version <NEXT_VERSION>`
Expand Down
8 changes: 2 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ install:
- set TOXENV=py%PYTHON_VERSION%
- if %PLATFORM% == "X64" (set PYTHON_PATH=C:\Python%PYTHON_VERSION%-x64) ELSE (set PYTHON_PATH=C:\Python%PYTHON_VERSION%)

# Add PostgreSQL (zic), Python and scripts directory to current path
- set PATH=%PYTHON_PATH%;c:\Program Files\PostgreSQL\9.3\bin\;%PATH%
# Add Python to the path
- set PATH=%PYTHON_PATH%;%PATH%
- set PYTHON=%PYTHON_PATH%/python.exe
- "%PYTHON% -c \"import sys; print(sys.executable, sys.version)\""

# This frequently fails with network errors, so we'll retry it up to 5 times
# with a 1 minute rate limit.
- "%PYTHON% -m pip install six"
- "ci_tools/retry.bat %PYTHON% updatezinfo.py"
# This environment variable tells the test suite it's OK to mess with the time zone.
- set DATEUTIL_MAY_CHANGE_TZ=1
- C:\Python36\python -m pip install -U tox virtualenv==20.4.7
Expand Down
1 change: 0 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ steps:

- bash: |
if [[ $TOXENV == "py" ]]; then
./ci_tools/retry.sh python updatezinfo.py
python -m tox -- tests --cov-config=tox.ini --cov=dateutil --junitxml=unittests/TEST-$(Agent.JobName).xml
python -m tox -e coverage,codecov || true
else
Expand Down
61 changes: 0 additions & 61 deletions ci_tools/make_zonefile_metadata.py

This file was deleted.

10 changes: 0 additions & 10 deletions ci_tools/run_tz_master_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ PATH=$TMP_DIR/tzdir/usr/sbin:${PATH}
# Stash the old zoneinfo file in the temporary directory
mv $REPO_TARBALL $TMP_TARBALL


# Make the metadata file
ZONEFILE_METADATA_NAME=zonefile_metadata_master.json
${CITOOLS_DIR}/make_zonefile_metadata.py \
$TARBALL_NAME \
$VERSION \
$ZONEFILE_METADATA_NAME

python ${REPO_DIR}/updatezinfo.py $ZONEFILE_METADATA_NAME

# Run the tests
python -m pytest ${REPO_DIR}/tests $EXTRA_TEST_ARGS

Loading
Loading