Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-typepy for openSUSE:Factory checked in at 2026-06-28 21:10:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-typepy (Old) and /work/SRC/openSUSE:Factory/.python-typepy.new.11887 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-typepy" Sun Jun 28 21:10:45 2026 rev:12 rq:1362159 version:2.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-typepy/python-typepy.changes 2025-06-04 20:29:01.586158854 +0200 +++ /work/SRC/openSUSE:Factory/.python-typepy.new.11887/python-typepy.changes 2026-06-28 21:12:18.009756772 +0200 @@ -1,0 +2,12 @@ +Sun Jun 28 11:18:50 UTC 2026 - Dirk Müller <[email protected]> + +- update to 2.0.0: + * Replace pytz with ZoneInfo + misc datetime fixes +- update to 1.3.5: + * Bump the actions-dependencies group across 1 directory with 6 + updates + * Fixed an invalid input handle for DateTimeConverter + * Add support for Python 3.14 + * Fix logic issues in type checking and conversion functions + +------------------------------------------------------------------- Old: ---- typepy-1.3.4.tar.gz New: ---- typepy-2.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-typepy.spec ++++++ --- /var/tmp/diff_new_pack.ga2cYj/_old 2026-06-28 21:12:18.581776114 +0200 +++ /var/tmp/diff_new_pack.ga2cYj/_new 2026-06-28 21:12:18.585776249 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-typepy # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-typepy -Version: 1.3.4 +Version: 2.0.0 Release: 0 Summary: Python library for run time variable type checker License: MIT @@ -31,15 +31,17 @@ BuildRequires: python-rpm-macros # SECTION test requirements BuildRequires: %{python_module mbstrdecoder >= 1.0.0} +BuildRequires: %{python_module packaging} BuildRequires: %{python_module pytest} BuildRequires: %{python_module python-dateutil >= 2.8.0} -BuildRequires: %{python_module pytz >= 2018.9} BuildRequires: %{python_module tcolorpy} +BuildRequires: %{python_module tzdata} # /SECTION BuildRequires: fdupes Requires: python-mbstrdecoder >= 1.0.0 +Requires: python-tzdata +Suggests: python-packaging Suggests: python-python-dateutil >= 2.8.0 -Suggests: python-pytz >= 2018.9 Suggests: python-path.py Suggests: python-tcolorpy BuildArch: noarch ++++++ typepy-1.3.4.tar.gz -> typepy-2.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/.github/workflows/lint_and_test.yml new/typepy-2.0.0/.github/workflows/lint_and_test.yml --- old/typepy-1.3.4/.github/workflows/lint_and_test.yml 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/.github/workflows/lint_and_test.yml 2026-05-09 08:40:47.000000000 +0200 @@ -2,6 +2,9 @@ on: [push, pull_request] +permissions: + contents: read + jobs: build-package: runs-on: ubuntu-latest @@ -11,12 +14,12 @@ timeout-minutes: 20 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 fetch-tags: true - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.13" cache: pip @@ -29,7 +32,7 @@ - run: make build - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: dist path: ./dist/* @@ -42,12 +45,12 @@ timeout-minutes: 20 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 fetch-tags: true - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.13" cache: pip @@ -70,7 +73,7 @@ image: ghcr.io/thombashi/python-ci:3.11 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - run: make check @@ -83,15 +86,15 @@ fail-fast: false matrix: python-version: - ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.10"] + ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.10"] os: [ubuntu-latest, macos-latest, windows-latest] timeout-minutes: 20 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: pip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/.github/workflows/on_push_default_branch.yml new/typepy-2.0.0/.github/workflows/on_push_default_branch.yml --- old/typepy-1.3.4/.github/workflows/on_push_default_branch.yml 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/.github/workflows/on_push_default_branch.yml 2026-05-09 08:40:47.000000000 +0200 @@ -20,12 +20,12 @@ timeout-minutes: 20 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 fetch-tags: true - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.13" cache: pip @@ -38,7 +38,7 @@ - run: make build - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: dist path: ./dist/* @@ -57,7 +57,7 @@ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v8 with: name: dist path: ./dist @@ -79,19 +79,19 @@ id-token: write steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v8 with: name: dist path: ./dist - name: Sign the dists with Sigstore - uses: sigstore/[email protected] + uses: sigstore/[email protected] with: inputs: >- ./dist/*.tar.gz ./dist/*.whl - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: sigstore path: ./dist/* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/.github/workflows/publish.yml new/typepy-2.0.0/.github/workflows/publish.yml --- old/typepy-1.3.4/.github/workflows/publish.yml 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/.github/workflows/publish.yml 2026-05-09 08:40:47.000000000 +0200 @@ -14,12 +14,12 @@ timeout-minutes: 20 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 fetch-tags: true - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.13" cache: pip @@ -32,7 +32,7 @@ - run: make build - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: dist path: ./dist/* @@ -48,7 +48,7 @@ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v8 with: name: dist path: ./dist @@ -65,20 +65,20 @@ contents: write steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v8 with: name: dist path: ./dist - name: Sign the dists with Sigstore - uses: sigstore/[email protected] + uses: sigstore/[email protected] with: inputs: >- ./dist/*.tar.gz ./dist/*.whl - name: Generate a GitHub release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: generate_release_notes: true files: dist/* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/PKG-INFO new/typepy-2.0.0/PKG-INFO --- old/typepy-1.3.4/PKG-INFO 2024-12-29 10:17:49.084678400 +0100 +++ new/typepy-2.0.0/PKG-INFO 2026-05-09 08:41:14.098104200 +0200 @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.4 Name: typepy -Version: 1.3.4 +Version: 2.0.0 Summary: typepy is a Python library for variable type checker/validator/converter at a run time. Home-page: https://github.com/thombashi/typepy Author: Tsuyoshi Hombashi @@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy @@ -33,14 +34,28 @@ Requires-Dist: mbstrdecoder<2,>=1.0.0 Provides-Extra: datetime Requires-Dist: python-dateutil<3.0.0,>=2.8.0; extra == "datetime" -Requires-Dist: pytz>=2018.9; extra == "datetime" Requires-Dist: packaging; extra == "datetime" +Requires-Dist: tzdata; sys_platform == "win32" and extra == "datetime" Provides-Extra: test Requires-Dist: pytest>=6.0.1; extra == "test" Requires-Dist: tcolorpy; extra == "test" Requires-Dist: python-dateutil<3.0.0,>=2.8.0; extra == "test" -Requires-Dist: pytz>=2018.9; extra == "test" Requires-Dist: packaging; extra == "test" +Requires-Dist: tzdata; sys_platform == "win32" and extra == "test" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: keywords +Dynamic: license +Dynamic: license-file +Dynamic: project-url +Dynamic: provides-extra +Dynamic: requires-dist +Dynamic: requires-python +Dynamic: summary .. contents:: **typepy** :backlinks: top @@ -145,7 +160,6 @@ These packages can be installed via ``pip install typepy[datetime]``: - `python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ -- `pytz <https://pypi.org/project/pytz/>`__ Usage ======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/README.rst new/typepy-2.0.0/README.rst --- old/typepy-1.3.4/README.rst 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/README.rst 2026-05-09 08:40:47.000000000 +0200 @@ -101,7 +101,6 @@ These packages can be installed via ``pip install typepy[datetime]``: - `python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ -- `pytz <https://pypi.org/project/pytz/>`__ Usage ======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/docs/pages/introduction/installation.rst new/typepy-2.0.0/docs/pages/introduction/installation.rst --- old/typepy-1.3.4/docs/pages/introduction/installation.rst 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/docs/pages/introduction/installation.rst 2026-05-09 08:40:47.000000000 +0200 @@ -38,4 +38,3 @@ These packages can be installed via ``pip install typepy[datetime]``: - `python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ -- `pytz <https://pypi.org/project/pytz/>`__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/pyproject.toml new/typepy-2.0.0/pyproject.toml --- old/typepy-1.3.4/pyproject.toml 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/pyproject.toml 2026-05-09 08:40:47.000000000 +0200 @@ -26,7 +26,7 @@ | docs/conf.py ''' line-length = 100 -target-version = ['py39', 'py310', 'py311', 'py312'] +target-version = ['py39', 'py310', 'py311', 'py312', 'py313', 'py314'] [tool.isort] include_trailing_comma = true @@ -35,7 +35,6 @@ 'logbook', 'pytablewriter', 'pytest', - 'pytz', 'sphinx_rtd_theme', 'tcolorpy', ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/setup.py new/typepy-2.0.0/setup.py --- old/typepy-1.3.4/setup.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/setup.py 2026-05-09 08:40:47.000000000 +0200 @@ -42,8 +42,8 @@ DATETIME_REQUIRES = [ "python-dateutil>=2.8.0,<3.0.0", - "pytz>=2018.9", "packaging", + 'tzdata; sys_platform == "win32"', ] setuptools.setup( @@ -85,6 +85,7 @@ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/test/test_type.py new/typepy-2.0.0/test/test_type.py --- old/typepy-1.3.4/test/test_type.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/test/test_type.py 2026-05-09 08:40:47.000000000 +0200 @@ -8,7 +8,7 @@ from ipaddress import IPv4Address, IPv6Address import pytest -from pytz import timezone, utc +from zoneinfo import ZoneInfo import typepy from typepy import StrictLevel @@ -47,27 +47,27 @@ @pytest.mark.parametrize( ["value", "timezone", "expected"], [ - [datetime(2017, 1, 29, 10, 27, 3), utc, datetime(2017, 1, 29, 10, 27, 3)], + [datetime(2017, 1, 29, 10, 27, 3), ZoneInfo("UTC"), datetime(2017, 1, 29, 10, 27, 3)], [ datetime(2017, 1, 29, 10, 27, 3), - timezone("Asia/Tokyo"), + ZoneInfo("Asia/Tokyo"), datetime(2017, 1, 29, 10, 27, 3), ], - ["2017-01-29 19:27:03", utc, datetime(2017, 1, 29, 19, 27, 3)], - ["2017-01-29 19:27:03", timezone("Asia/Tokyo"), datetime(2017, 1, 29, 19, 27, 3)], - [1485685623, utc, datetime(2017, 1, 29, 10, 27, 3)], - [1485685623, timezone("Asia/Tokyo"), datetime(2017, 1, 29, 19, 27, 3)], + ["2017-01-29 19:27:03", ZoneInfo("UTC"), datetime(2017, 1, 29, 19, 27, 3)], + ["2017-01-29 19:27:03", ZoneInfo("Asia/Tokyo"), datetime(2017, 1, 29, 19, 27, 3)], + [1485685623, ZoneInfo("UTC"), datetime(2017, 1, 29, 10, 27, 3)], + [1485685623, ZoneInfo("Asia/Tokyo"), datetime(2017, 1, 29, 19, 27, 3)], ], ) def test_normal_datetime_timezone(self, value, timezone, expected): result = typepy.DateTime(value, strict_level=StrictLevel.MIN, timezone=timezone).convert() - assert result == timezone.localize(expected) + assert result == expected.replace(tzinfo=timezone) def test_normal_datetime_tz_aware(self): - utc_dt = datetime(2017, 1, 29, 10, 27, 3, tzinfo=utc) + utc_dt = datetime(2017, 1, 29, 10, 27, 3, tzinfo=ZoneInfo("UTC")) got = typepy.DateTime( - utc_dt, strict_level=StrictLevel.MIN, timezone=timezone("Asia/Tokyo") + utc_dt, strict_level=StrictLevel.MIN, timezone=ZoneInfo("Asia/Tokyo") ).convert() assert got.tzinfo.tzname(got) == "JST" @@ -76,9 +76,21 @@ strict_level=StrictLevel.MIN, ).convert() assert jst_dt.tzinfo.utcoffset(jst_dt) == timedelta(seconds=32400) - got = typepy.DateTime(jst_dt, strict_level=StrictLevel.MIN, timezone=utc).convert() + got = typepy.DateTime( + jst_dt, strict_level=StrictLevel.MIN, timezone=ZoneInfo("UTC") + ).convert() assert got.tzinfo.utcoffset(got) == timedelta(0) + def test_normal_datetime_dst_ambiguous_default_fold(self): + # 2024-11-03 01:30 in US/Eastern is ambiguous (fall-back). + # Per PEP 495, fold defaults to 0 — the earlier occurrence (EDT, UTC-4). + ambiguous = datetime(2024, 11, 3, 1, 30) + got = typepy.DateTime( + ambiguous, strict_level=StrictLevel.MIN, timezone=ZoneInfo("US/Eastern") + ).convert() + assert got.tzinfo.utcoffset(got) == timedelta(hours=-4) + assert got.tzinfo.tzname(got) == "EDT" + @pytest.mark.parametrize( ["value", "expected"], [ @@ -91,6 +103,27 @@ assert result == expected + @pytest.mark.parametrize( + ["value"], + [ + [{"1"}], + [{"1", "2"}], + [["1"]], + [["1", "2"]], + [{"a": 1}], + [(1, 2)], + [None], + ], + ) + def test_abnormal_non_string(self, value): + from typepy.error import TypeConversionError + + with pytest.raises(TypeConversionError): + typepy.DateTime({"1"}, strict_level=StrictLevel.MIN).convert() + + assert typepy.DateTime(value, strict_level=StrictLevel.MIN).is_type() is False + assert typepy.DateTime(value, strict_level=StrictLevel.MIN).try_convert() is None + class Test_IpAddress: @pytest.mark.parametrize( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/tox.ini new/typepy-2.0.0/tox.ini --- old/typepy-1.3.4/tox.ini 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/tox.ini 2026-05-09 08:40:47.000000000 +0200 @@ -1,6 +1,6 @@ [tox] envlist = - py{39,310,311,312,313} + py{39,310,311,312,313,314} pypy3 build cov @@ -75,7 +75,6 @@ mypy>=1 ruff>=0.8 types-python-dateutil - types-pytz commands = codespell typepy docs/pages test -q2 --check-filenames mypy typepy setup.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy/__version__.py new/typepy-2.0.0/typepy/__version__.py --- old/typepy-1.3.4/typepy/__version__.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/typepy/__version__.py 2026-05-09 08:40:47.000000000 +0200 @@ -1,6 +1,6 @@ __author__ = "Tsuyoshi Hombashi" __copyright__ = f"Copyright 2017-2024, {__author__}" __license__ = "MIT License" -__version__ = "1.3.4" +__version__ = "2.0.0" __maintainer__ = __author__ __email__ = "[email protected]" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy/checker/_common.py new/typepy-2.0.0/typepy/checker/_common.py --- old/typepy-1.3.4/typepy/checker/_common.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/typepy/checker/_common.py 2026-05-09 08:40:47.000000000 +0200 @@ -7,7 +7,7 @@ def isstring(value): - return isinstance(value, (str,) + (str, bytes)) + return isinstance(value, (str, bytes)) def isinf(value): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy/checker/_dictionary.py new/typepy-2.0.0/typepy/checker/_dictionary.py --- old/typepy-1.3.4/typepy/checker/_dictionary.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/typepy/checker/_dictionary.py 2026-05-09 08:40:47.000000000 +0200 @@ -10,7 +10,7 @@ return isinstance(self._value, dict) def is_valid_after_convert(self, converted_value): - return isinstance(converted_value, dict) and converted_value + return isinstance(converted_value, dict) and bool(converted_value) class DictionaryTypeCheckerStrictLevel1(DictionaryTypeCheckerStrictLevel0): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy/checker/_integer.py new/typepy-2.0.0/typepy/checker/_integer.py --- old/typepy-1.3.4/typepy/checker/_integer.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/typepy/checker/_integer.py 2026-05-09 08:40:47.000000000 +0200 @@ -55,7 +55,7 @@ class IntegerTypeCheckerStrictLevel2(IntegerTypeCheckerStrictLevel1): def is_exclude_instance(self): - return isinstance(self._value, (str,) + (bool, float, Decimal)) + return isinstance(self._value, (str, bool, float, Decimal)) _factory = CheckerFactory( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy/checker/_list.py new/typepy-2.0.0/typepy/checker/_list.py --- old/typepy-1.3.4/typepy/checker/_list.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/typepy/checker/_list.py 2026-05-09 08:40:47.000000000 +0200 @@ -11,7 +11,7 @@ return isinstance(self._value, list) def is_valid_after_convert(self, converted_value): - return isinstance(converted_value, list) and converted_value + return isinstance(converted_value, list) and bool(converted_value) def is_exclude_instance(self): return isstring(self._value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy/converter/_bool.py new/typepy-2.0.0/typepy/converter/_bool.py --- old/typepy-1.3.4/typepy/converter/_bool.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/typepy/converter/_bool.py 2026-05-09 08:40:47.000000000 +0200 @@ -36,9 +36,9 @@ except AttributeError: raise ValueError(f"invalid value '{str(value)}'") - if lower_text in ["true"]: + if lower_text == "true": return True - elif lower_text in ["false"]: + elif lower_text == "false": return False raise ValueError(f"invalid value '{str(value)}'") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy/converter/_bytes.py new/typepy-2.0.0/typepy/converter/_bytes.py --- old/typepy-1.3.4/typepy/converter/_bytes.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/typepy/converter/_bytes.py 2026-05-09 08:40:47.000000000 +0200 @@ -8,4 +8,4 @@ class BytesConverter(AbstractValueConverter): def force_convert(self): - raise TypeConversionError("not inmplemented") + raise TypeConversionError("not implemented") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy/converter/_datetime.py new/typepy-2.0.0/typepy/converter/_datetime.py --- old/typepy-1.3.4/typepy/converter/_datetime.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/typepy/converter/_datetime.py 2026-05-09 08:40:47.000000000 +0200 @@ -11,8 +11,6 @@ class DateTimeConverter(AbstractValueConverter): - __DAYS_TO_SECONDS_COEF = 60**2 * 24 - __MICROSECONDS_TO_SECONDS_COEF = 1000**2 __COMMON_DST_TIMEZONE_TABLE = { -36000: "America/Adak", # -1000 -32400: "US/Alaska", # -0900 @@ -56,7 +54,7 @@ if self.__timezone: if self.__datetime.tzinfo is None: - self.__datetime = self.__timezone.localize(self.__datetime) + self.__datetime = self.__datetime.replace(tzinfo=self.__timezone) else: self.__datetime = datetime.fromtimestamp( self.__datetime.timestamp(), tz=self.__timezone @@ -68,35 +66,24 @@ from ..type._integer import Integer from ..type._realnumber import RealNumber - conv_error = TypeConversionError( - "timestamp is out of the range of values supported by the platform" - ) - timestamp = Integer(self._value, strict_level=1).try_convert() - if timestamp: - try: - self.__datetime = datetime.fromtimestamp(timestamp, self.__timezone) - except (ValueError, OSError, OverflowError): - raise conv_error - - return self.__datetime - - timestamp = RealNumber(self._value, strict_level=1).try_convert() - if timestamp: - try: - self.__datetime = datetime.fromtimestamp(int(timestamp), self.__timezone).replace( - microsecond=int((timestamp - int(timestamp)) * 1000000) - ) - except (ValueError, OSError, OverflowError): - raise conv_error + if timestamp is None: + timestamp = RealNumber(self._value, strict_level=1).try_convert() + if timestamp is None: + return None - return self.__datetime + try: + self.__datetime = datetime.fromtimestamp(float(timestamp), self.__timezone) + except (ValueError, OSError, OverflowError): + raise TypeConversionError( + "timestamp is out of the range of values supported by the platform" + ) - return None + return self.__datetime def __from_datetime_string(self): import dateutil.parser - import pytz + from zoneinfo import ZoneInfo self.__validate_datetime_string() @@ -113,28 +100,21 @@ raise TypeConversionError(f"failed to parse as a datetime: type={type(self._value)}") if self.__timezone: - pytz_timezone = self.__timezone + tz = self.__timezone else: try: dst_timezone_name = self.__get_dst_timezone_name(self.__get_timedelta_sec()) except (AttributeError, KeyError): return self.__datetime - pytz_timezone = pytz.timezone(dst_timezone_name) + tz = ZoneInfo(dst_timezone_name) - self.__datetime = self.__datetime.replace(tzinfo=None) - self.__datetime = pytz_timezone.localize(self.__datetime) + self.__datetime = self.__datetime.replace(tzinfo=tz) return self.__datetime def __get_timedelta_sec(self): - dt = self.__datetime.utcoffset() - - return int( - dt.days * self.__DAYS_TO_SECONDS_COEF - + float(dt.seconds) - + dt.microseconds / self.__MICROSECONDS_TO_SECONDS_COEF - ) + return int(self.__datetime.utcoffset().total_seconds()) def __get_dst_timezone_name(self, offset): return self.__COMMON_DST_TIMEZONE_TABLE[offset] @@ -148,13 +128,12 @@ from packaging.version import InvalidVersion, Version - try: - try: - Version(self._value) - raise TypeConversionError( - f"invalid datetime string: version string found {self._value}" - ) - except InvalidVersion: - pass - except TypeError: + if not isinstance(self._value, str): raise TypeConversionError(f"invalid datetime string: type={type(self._value)}") + + try: + Version(self._value) + except InvalidVersion: + return + + raise TypeConversionError(f"invalid datetime string: version string found {self._value}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy/converter/_ipaddress.py new/typepy-2.0.0/typepy/converter/_ipaddress.py --- old/typepy-1.3.4/typepy/converter/_ipaddress.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/typepy/converter/_ipaddress.py 2026-05-09 08:40:47.000000000 +0200 @@ -25,6 +25,4 @@ except ValueError: pass - raise TypeConversionError( - f"failed to force_convert to dictionary: type={type(self._value)}" - ) + raise TypeConversionError(f"failed to force_convert to ipaddress: type={type(self._value)}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy/converter/_string.py new/typepy-2.0.0/typepy/converter/_string.py --- old/typepy-1.3.4/typepy/converter/_string.py 2024-12-29 10:17:13.000000000 +0100 +++ new/typepy-2.0.0/typepy/converter/_string.py 2026-05-09 08:40:47.000000000 +0200 @@ -16,5 +16,4 @@ class NullStringConverter(StringConverter): - def force_convert(self): - return super().force_convert() + pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy.egg-info/PKG-INFO new/typepy-2.0.0/typepy.egg-info/PKG-INFO --- old/typepy-1.3.4/typepy.egg-info/PKG-INFO 2024-12-29 10:17:49.000000000 +0100 +++ new/typepy-2.0.0/typepy.egg-info/PKG-INFO 2026-05-09 08:41:14.000000000 +0200 @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.4 Name: typepy -Version: 1.3.4 +Version: 2.0.0 Summary: typepy is a Python library for variable type checker/validator/converter at a run time. Home-page: https://github.com/thombashi/typepy Author: Tsuyoshi Hombashi @@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy @@ -33,14 +34,28 @@ Requires-Dist: mbstrdecoder<2,>=1.0.0 Provides-Extra: datetime Requires-Dist: python-dateutil<3.0.0,>=2.8.0; extra == "datetime" -Requires-Dist: pytz>=2018.9; extra == "datetime" Requires-Dist: packaging; extra == "datetime" +Requires-Dist: tzdata; sys_platform == "win32" and extra == "datetime" Provides-Extra: test Requires-Dist: pytest>=6.0.1; extra == "test" Requires-Dist: tcolorpy; extra == "test" Requires-Dist: python-dateutil<3.0.0,>=2.8.0; extra == "test" -Requires-Dist: pytz>=2018.9; extra == "test" Requires-Dist: packaging; extra == "test" +Requires-Dist: tzdata; sys_platform == "win32" and extra == "test" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: keywords +Dynamic: license +Dynamic: license-file +Dynamic: project-url +Dynamic: provides-extra +Dynamic: requires-dist +Dynamic: requires-python +Dynamic: summary .. contents:: **typepy** :backlinks: top @@ -145,7 +160,6 @@ These packages can be installed via ``pip install typepy[datetime]``: - `python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ -- `pytz <https://pypi.org/project/pytz/>`__ Usage ======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typepy-1.3.4/typepy.egg-info/requires.txt new/typepy-2.0.0/typepy.egg-info/requires.txt --- old/typepy-1.3.4/typepy.egg-info/requires.txt 2024-12-29 10:17:49.000000000 +0100 +++ new/typepy-2.0.0/typepy.egg-info/requires.txt 2026-05-09 08:41:14.000000000 +0200 @@ -2,12 +2,16 @@ [datetime] python-dateutil<3.0.0,>=2.8.0 -pytz>=2018.9 packaging +[datetime:sys_platform == "win32"] +tzdata + [test] pytest>=6.0.1 tcolorpy python-dateutil<3.0.0,>=2.8.0 -pytz>=2018.9 packaging + +[test:sys_platform == "win32"] +tzdata
