Skip to content

Add walltimedelta#1429

Draft
ljluestc wants to merge 4 commits intodateutil:masterfrom
ljluestc:add-walltimedelta
Draft

Add walltimedelta#1429
ljluestc wants to merge 4 commits intodateutil:masterfrom
ljluestc:add-walltimedelta

Conversation

@ljluestc
Copy link
Copy Markdown

Summary of changes

Added the walltimedelta function to the dateutil.tzutils module to calculate wall time differences between two datetime objects, accounting for daylight saving time (DST) transitions, as per issue #1039. The function converts datetimes to UTC using dateutil.tz.resolve_imaginary to handle ambiguous or imaginary times and supports naive datetimes with a provided timezone. Comprehensive tests cover DST transitions, naive datetimes, and error cases. Supporting scripts ensure proper module setup and test execution.

Key changes:

  • Created src/dateutil/tzutils.py with the walltimedelta function.
  • Added tests in tests/test_tzutils.py and tests/test_isolated_tzutils.py.
  • Updated src/dateutil/__init__.py to export tzutils.
  • Added changelog entry in changelog.d/1039.feature.rst.
  • Included scripts: fix_installation.sh, install_for_testing.sh, install_tzutils.py, skip_property_tests.py, update_module.sh.
  • Fixed test issues: ModuleNotFoundError for tzutils, hypothesis, and freezegun; PytestUnknownMarkWarning for no_cover; and test_gettz_returns_local failure.

Closes #1039

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wall time deltas

1 participant