Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-tempora for openSUSE:Factory checked in at 2022-12-06 14:22:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-tempora (Old) and /work/SRC/openSUSE:Factory/.python-tempora.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-tempora" Tue Dec 6 14:22:45 2022 rev:14 rq:1040391 version:5.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-tempora/python-tempora.changes 2022-09-20 19:23:12.350409022 +0200 +++ /work/SRC/openSUSE:Factory/.python-tempora.new.1835/python-tempora.changes 2022-12-06 14:22:47.605381749 +0100 @@ -1,0 +2,6 @@ +Mon Dec 5 13:41:37 UTC 2022 - Yogalakshmi Arunachalam <[email protected]> + +- Update to version 5.1.0 + * Introduced infer_datetime and added some type hints. + +------------------------------------------------------------------- Old: ---- tempora-5.0.2.tar.gz New: ---- tempora-5.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-tempora.spec ++++++ --- /var/tmp/diff_new_pack.8B4veb/_old 2022-12-06 14:22:48.081384360 +0100 +++ /var/tmp/diff_new_pack.8B4veb/_new 2022-12-06 14:22:48.085384382 +0100 @@ -24,7 +24,7 @@ %bcond_with libalternatives %endif Name: python-tempora -Version: 5.0.2 +Version: 5.1.0 Release: 0 Summary: Objects and routines pertaining to date and time (tempora) License: MIT ++++++ tempora-5.0.2.tar.gz -> tempora-5.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/.github/workflows/main.yml new/tempora-5.1.0/.github/workflows/main.yml --- old/tempora-5.0.2/.github/workflows/main.yml 2022-07-14 16:11:22.000000000 +0200 +++ new/tempora-5.1.0/.github/workflows/main.yml 2022-11-19 16:33:44.000000000 +0100 @@ -2,27 +2,67 @@ on: [push, pull_request] +env: + # Environment variables to support color support (jaraco/skeleton#66): + # Request colored output from CLI tools supporting it. Different tools + # interpret the value differently. For some, just being set is sufficient. + # For others, it must be a non-zero integer. For yet others, being set + # to a non-empty value is sufficient. + FORCE_COLOR: -106 + # MyPy's color enforcement (must be a non-zero number) + MYPY_FORCE_COLOR: -42 + # Recognized by the `py` package, dependency of `pytest` (must be "1") + PY_COLORS: 1 + # Make tox-wrapped tools see color requests + TOX_TESTENV_PASSENV: >- + FORCE_COLOR + MYPY_FORCE_COLOR + NO_COLOR + PY_COLORS + PYTEST_THEME + PYTEST_THEME_MODE + + # Suppress noisy pip warnings + PIP_DISABLE_PIP_VERSION_CHECK: 'true' + PIP_NO_PYTHON_VERSION_WARNING: 'true' + PIP_NO_WARN_SCRIPT_LOCATION: 'true' + + # Disable the spinner, noise in GHA; TODO(webknjaz): Fix this upstream + # Must be "1". + TOX_PARALLEL_NO_SPINNER: 1 + + jobs: test: strategy: matrix: python: - # Build on pre-releases until stable, then stable releases. - # actions/setup-python#213 - - ~3.7.0-0 - - ~3.10.0-0 - - ~3.11.0-0 + - "3.7" + - "3.11" + - "3.12" + # Workaround for actions/setup-python#508 + dev: + - -dev platform: - ubuntu-latest - macos-latest - windows-latest + include: + - python: "3.8" + platform: ubuntu-latest + - python: "3.9" + platform: ubuntu-latest + - python: "3.10" + platform: ubuntu-latest + - python: pypy3.9 + platform: ubuntu-latest runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python }} + python-version: ${{ matrix.python }}${{ matrix.dev }} - name: Install tox run: | python -m pip install tox @@ -52,9 +92,9 @@ steps: - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: 3.11-dev - name: Install tox run: | python -m pip install tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/.readthedocs.yaml new/tempora-5.1.0/.readthedocs.yaml --- old/tempora-5.0.2/.readthedocs.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/tempora-5.1.0/.readthedocs.yaml 2022-11-19 16:33:44.000000000 +0100 @@ -0,0 +1,13 @@ +version: 2 +python: + install: + - path: . + extra_requirements: + - docs + +# workaround for readthedocs/readthedocs.org#9623 +build: + # workaround for readthedocs/readthedocs.org#9635 + os: ubuntu-22.04 + tools: + python: "3" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/.readthedocs.yml new/tempora-5.1.0/.readthedocs.yml --- old/tempora-5.0.2/.readthedocs.yml 2022-07-14 16:11:22.000000000 +0200 +++ new/tempora-5.1.0/.readthedocs.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -version: 2 -python: - install: - - path: . - extra_requirements: - - docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/CHANGES.rst new/tempora-5.1.0/CHANGES.rst --- old/tempora-5.0.2/CHANGES.rst 2022-07-14 16:11:22.000000000 +0200 +++ new/tempora-5.1.0/CHANGES.rst 2022-11-19 16:33:44.000000000 +0100 @@ -1,3 +1,8 @@ +v5.1.0 +====== + +Introduced ``infer_datetime`` and added some type hints. + v5.0.2 ====== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/PKG-INFO new/tempora-5.1.0/PKG-INFO --- old/tempora-5.0.2/PKG-INFO 2022-07-14 16:11:46.839387000 +0200 +++ new/tempora-5.1.0/PKG-INFO 2022-11-19 16:34:05.922559300 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: tempora -Version: 5.0.2 +Version: 5.1.0 Summary: Objects and routines pertaining to date and time (tempora) Home-page: https://github.com/jaraco/tempora Author: Jason R. Coombs @@ -16,12 +16,9 @@ License-File: LICENSE .. image:: https://img.shields.io/pypi/v/tempora.svg - :target: `PyPI link`_ + :target: https://pypi.org/project/tempora .. image:: https://img.shields.io/pypi/pyversions/tempora.svg - :target: `PyPI link`_ - -.. _PyPI link: https://pypi.org/project/tempora .. image:: https://github.com/jaraco/tempora/workflows/tests/badge.svg :target: https://github.com/jaraco/tempora/actions?query=workflow%3A%22tests%22 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/README.rst new/tempora-5.1.0/README.rst --- old/tempora-5.0.2/README.rst 2022-07-14 16:11:22.000000000 +0200 +++ new/tempora-5.1.0/README.rst 2022-11-19 16:33:44.000000000 +0100 @@ -1,10 +1,7 @@ .. image:: https://img.shields.io/pypi/v/tempora.svg - :target: `PyPI link`_ + :target: https://pypi.org/project/tempora .. image:: https://img.shields.io/pypi/pyversions/tempora.svg - :target: `PyPI link`_ - -.. _PyPI link: https://pypi.org/project/tempora .. image:: https://github.com/jaraco/tempora/workflows/tests/badge.svg :target: https://github.com/jaraco/tempora/actions?query=workflow%3A%22tests%22 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/docs/conf.py new/tempora-5.1.0/docs/conf.py --- old/tempora-5.0.2/docs/conf.py 2022-07-14 16:11:22.000000000 +0200 +++ new/tempora-5.1.0/docs/conf.py 2022-11-19 16:33:44.000000000 +0100 @@ -1,10 +1,16 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -extensions = ['sphinx.ext.autodoc', 'jaraco.packaging.sphinx', 'rst.linker'] +extensions = [ + 'sphinx.ext.autodoc', + 'jaraco.packaging.sphinx', +] master_doc = "index" +html_theme = "furo" +# Link dates and other references in the changelog +extensions += ['rst.linker'] link_files = { '../CHANGES.rst': dict( using=dict(GH='https://github.com'), @@ -25,7 +31,7 @@ ) } -# Be strict about any broken references: +# Be strict about any broken references nitpicky = True # Include Python intersphinx mapping to prevent failures @@ -35,4 +41,7 @@ 'python': ('https://docs.python.org/3', None), } +# Preserve authored syntax for defaults +autodoc_preserve_defaults = True + extensions += ['jaraco.tidelift'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/mypy.ini new/tempora-5.1.0/mypy.ini --- old/tempora-5.0.2/mypy.ini 2022-07-14 16:11:22.000000000 +0200 +++ new/tempora-5.1.0/mypy.ini 2022-11-19 16:33:44.000000000 +0100 @@ -1,2 +1,5 @@ [mypy] ignore_missing_imports = True +# required to support namespace packages +# https://github.com/python/mypy/issues/14057 +explicit_package_bases = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/setup.cfg new/tempora-5.1.0/setup.cfg --- old/tempora-5.0.2/setup.cfg 2022-07-14 16:11:46.843387100 +0200 +++ new/tempora-5.1.0/setup.cfg 2022-11-19 16:34:05.922559300 +0100 @@ -31,7 +31,9 @@ testing = pytest >= 6 pytest-checkdocs >= 2.4 - pytest-flake8 + pytest-flake8; \ + python_version < "3.12" + flake8 < 5 pytest-black >= 0.3.7; \ python_implementation != "PyPy" pytest-cov @@ -45,9 +47,10 @@ types-freezegun types-pytz docs = - sphinx + sphinx >= 3.5 jaraco.packaging >= 9 rst.linker >= 1.9 + furo jaraco.tidelift >= 1.4 [options.entry_points] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/tempora/__init__.py new/tempora-5.1.0/tempora/__init__.py --- old/tempora-5.0.2/tempora/__init__.py 2022-07-14 16:11:22.000000000 +0200 +++ new/tempora-5.1.0/tempora/__init__.py 2022-11-19 16:33:44.000000000 +0100 @@ -6,6 +6,10 @@ import numbers import functools import contextlib +from numbers import Number +from typing import Union, Tuple, Iterable +from typing import cast + from jaraco.functools import once @@ -33,7 +37,7 @@ @once -def _needs_year_help(): +def _needs_year_help() -> bool: """ Some versions of Python render %Y with only three characters :( https://bugs.python.org/issue39103 @@ -41,14 +45,19 @@ return len(datetime.date(900, 1, 1).strftime('%Y')) != 4 -def ensure_datetime(ob): +AnyDatetime = Union[datetime.datetime, datetime.date, datetime.time] +StructDatetime = Union[Tuple[int, ...], time.struct_time] + + +def ensure_datetime(ob: AnyDatetime) -> datetime.datetime: """ Given a datetime or date or time object from the ``datetime`` module, always return a datetime using default values. """ if isinstance(ob, datetime.datetime): return ob - date = time = ob + date = cast(datetime.date, ob) + time = cast(datetime.time, ob) if isinstance(ob, datetime.date): time = datetime.time() if isinstance(ob, datetime.time): @@ -56,7 +65,13 @@ return datetime.datetime.combine(date, time) -def strftime(fmt, t): +def infer_datetime(ob: Union[AnyDatetime, StructDatetime]) -> datetime.datetime: + if isinstance(ob, (time.struct_time, tuple)): + ob = datetime.datetime(*ob[:6]) # type: ignore + return ensure_datetime(ob) + + +def strftime(fmt: str, t: Union[AnyDatetime, tuple, time.struct_time]) -> str: """ Portable strftime. @@ -115,15 +130,11 @@ >>> strftime('%Y', datetime.time()) '1900' """ - if isinstance(t, (time.struct_time, tuple)): - t = datetime.datetime(*t[:6]) - t = ensure_datetime(t) + t = infer_datetime(t) subs = ( ('%s', '%03d' % (t.microsecond // 1000)), ('%µ', '%03d' % (t.microsecond % 1000)), - ) - if _needs_year_help(): # pragma: nocover - subs += (('%Y', '%04d' % t.year),) + ) + (('%Y', '%04d' % t.year),) * _needs_year_help() def doSub(s, sub): return s.replace(*sub) @@ -324,10 +335,10 @@ """ rate = input("Enter the rate (3/hour, 50/month)> ") for period, value in _prorated_values(rate): - print("per {period}: {value}".format(**locals())) + print(f"per {period}: {value}") -def _prorated_values(rate): +def _prorated_values(rate: str) -> Iterable[Tuple[str, Number]]: """ Given a rate (a string in units per unit time), and return that same rate for various time periods. @@ -341,7 +352,8 @@ year: 175316.333 """ - res = re.match(r'(?P<value>[\d.]+)/(?P<period>\w+)$', rate).groupdict() + match = re.match(r'(?P<value>[\d.]+)/(?P<period>\w+)$', rate) + res = cast(re.Match, match).groupdict() value = float(res['value']) value_per_second = value / get_period_seconds(res['period']) for period in ('minute', 'hour', 'day', 'month', 'year'): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/tempora/schedule.py new/tempora-5.1.0/tempora/schedule.py --- old/tempora-5.0.2/tempora/schedule.py 2022-07-14 16:11:22.000000000 +0200 +++ new/tempora-5.1.0/tempora/schedule.py 2022-11-19 16:33:44.000000000 +0100 @@ -130,7 +130,7 @@ raise ValueError( "A PeriodicCommand must have a positive, " "non-zero delay." ) - super(PeriodicCommand, self).__setattr__(key, value) + super().__setattr__(key, value) class PeriodicCommandFixedDelay(PeriodicCommand): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/tempora/timing.py new/tempora-5.1.0/tempora/timing.py --- old/tempora-5.0.2/tempora/timing.py 2022-07-14 16:11:22.000000000 +0200 +++ new/tempora-5.1.0/tempora/timing.py 2022-11-19 16:33:44.000000000 +0100 @@ -115,7 +115,7 @@ def __init__(self, target=float('Inf')): self.target = self._accept(target) - super(Timer, self).__init__() + super().__init__() @staticmethod def _accept(target): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/tempora.egg-info/PKG-INFO new/tempora-5.1.0/tempora.egg-info/PKG-INFO --- old/tempora-5.0.2/tempora.egg-info/PKG-INFO 2022-07-14 16:11:46.000000000 +0200 +++ new/tempora-5.1.0/tempora.egg-info/PKG-INFO 2022-11-19 16:34:05.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: tempora -Version: 5.0.2 +Version: 5.1.0 Summary: Objects and routines pertaining to date and time (tempora) Home-page: https://github.com/jaraco/tempora Author: Jason R. Coombs @@ -16,12 +16,9 @@ License-File: LICENSE .. image:: https://img.shields.io/pypi/v/tempora.svg - :target: `PyPI link`_ + :target: https://pypi.org/project/tempora .. image:: https://img.shields.io/pypi/pyversions/tempora.svg - :target: `PyPI link`_ - -.. _PyPI link: https://pypi.org/project/tempora .. image:: https://github.com/jaraco/tempora/workflows/tests/badge.svg :target: https://github.com/jaraco/tempora/actions?query=workflow%3A%22tests%22 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/tempora.egg-info/SOURCES.txt new/tempora-5.1.0/tempora.egg-info/SOURCES.txt --- old/tempora-5.0.2/tempora.egg-info/SOURCES.txt 2022-07-14 16:11:46.000000000 +0200 +++ new/tempora-5.1.0/tempora.egg-info/SOURCES.txt 2022-11-19 16:34:05.000000000 +0100 @@ -2,7 +2,7 @@ .editorconfig .flake8 .pre-commit-config.yaml -.readthedocs.yml +.readthedocs.yaml CHANGES.rst LICENSE README.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tempora-5.0.2/tempora.egg-info/requires.txt new/tempora-5.1.0/tempora.egg-info/requires.txt --- old/tempora-5.0.2/tempora.egg-info/requires.txt 2022-07-14 16:11:46.000000000 +0200 +++ new/tempora-5.1.0/tempora.egg-info/requires.txt 2022-11-19 16:34:05.000000000 +0100 @@ -2,15 +2,16 @@ jaraco.functools>=1.20 [docs] -sphinx +sphinx>=3.5 jaraco.packaging>=9 rst.linker>=1.9 +furo jaraco.tidelift>=1.4 [testing] pytest>=6 pytest-checkdocs>=2.4 -pytest-flake8 +flake8<5 pytest-cov pytest-enabler>=1.3 backports.unittest_mock @@ -22,3 +23,6 @@ [testing:platform_python_implementation != "PyPy"] pytest-black>=0.3.7 pytest-mypy>=0.9.1 + +[testing:python_version < "3.12"] +pytest-flake8
