Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-convertdate for openSUSE:Factory checked in at 2023-05-09 13:05:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-convertdate (Old) and /work/SRC/openSUSE:Factory/.python-convertdate.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-convertdate" Tue May 9 13:05:53 2023 rev:8 rq:1084847 version:2.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-convertdate/python-convertdate.changes 2023-04-22 22:02:37.161990896 +0200 +++ /work/SRC/openSUSE:Factory/.python-convertdate.new.1533/python-convertdate.changes 2023-05-09 13:05:55.432516027 +0200 @@ -1,0 +2,8 @@ +Thu May 4 18:59:03 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 2.4.0: + * Drop official support for Python version 3.5 and 3.6, which + have reached end-of-life. + * Remove pytz dependency (#49) + +------------------------------------------------------------------- Old: ---- v2.3.2.tar.gz New: ---- v2.4.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-convertdate.spec ++++++ --- /var/tmp/diff_new_pack.s79nfn/_old 2023-05-09 13:05:56.076519860 +0200 +++ /var/tmp/diff_new_pack.s79nfn/_new 2023-05-09 13:05:56.084519908 +0200 @@ -19,23 +19,25 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?sle15_python_module_pythons} Name: python-convertdate -Version: 2.3.2 +Version: 2.4.0 Release: 0 Summary: Module for date conversions from and to Gregorian calendar License: MIT URL: https://github.com/fitnr/convertdate Source: https://github.com/fitnr/convertdate/archive/v%{version}.tar.gz -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-PyMeeus >= 0.3.6 -Requires: python-pytz >= 2014.10 BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module PyMeeus >= 0.3.6} +BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module pytz >= 2014.10} # /SECTION +Requires(post): update-alternatives +Requires(postun):update-alternatives %python_subpackages %description @@ -49,20 +51,29 @@ %build export LC_ALL="en_US.UTF8" -%python_build +%pyproject_wheel %install export LC_ALL="en_US.UTF8" -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%python_clone -a %{buildroot}%{_bindir}/censusgeocode %check export LC_ALL="en_US.UTF8" -%pytest +%pytest %{?jobs:-n %jobs} + +%post +%python_install_alternative censusgeocode + +%postun +%python_uninstall_alternative censusgeocode %files %{python_files} %doc README.md %license LICENSE -%{python_sitelib}/* +%python_alternative %{_bindir}/censusgeocode +%{python_sitelib}/convertdate +%{python_sitelib}/convertdate-%{version}.dist-info %changelog ++++++ v2.3.2.tar.gz -> v2.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/.github/workflows/publish.yml new/convertdate-2.4.0/.github/workflows/publish.yml --- old/convertdate-2.3.2/.github/workflows/publish.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/convertdate-2.4.0/.github/workflows/publish.yml 2022-01-22 19:21:55.000000000 +0100 @@ -0,0 +1,37 @@ +# This file is part of convertdate. +# http://github.com/fitnr/convertdate + +# Licensed under the MIT license: +# http://opensource.org/licenses/MIT +# Copyright (c) 2021, fitnr <fitnr@fakeisthenewreal> +name: Publish + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + cache: 'pip' + cache-dependency-path: setup.cfg + + - name: Install build requirements + run: | + python -m pip install -U pip + pip install build + + - run: make build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/.github/workflows/python.yml new/convertdate-2.4.0/.github/workflows/python.yml --- old/convertdate-2.3.2/.github/workflows/python.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/convertdate-2.4.0/.github/workflows/python.yml 2022-01-22 19:21:55.000000000 +0100 @@ -0,0 +1,50 @@ +# This file is part of convertdate. +# http://github.com/fitnr/convertdate + +# Licensed under the MIT license: +# http://opensource.org/licenses/MIT +# Copyright (c) 2021, fitnr <fitnr@fakeisthenewreal> +name: convertdate + +on: + push: + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7, 3.8, 3.9, "3.10.0"] + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: setup.cfg + - name: Install + run: | + python -m pip install --upgrade pip wheel + pip install ".[tests]" + - name: Test + run: make cov + + pylint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: 3.9 + cache: 'pip' + cache-dependency-path: setup.cfg + - name: Install + run: | + python -m pip install --upgrade pip pylint + pip install . + - name: Pylint + run: make pylint diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/.gitignore new/convertdate-2.4.0/.gitignore --- old/convertdate-2.3.2/.gitignore 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/.gitignore 2022-01-22 19:21:55.000000000 +0100 @@ -14,3 +14,4 @@ py35 __pycache__ *.sublime-project +.coverage diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/.readthedocs.yml new/convertdate-2.4.0/.readthedocs.yml --- old/convertdate-2.3.2/.readthedocs.yml 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/.readthedocs.yml 2022-01-22 19:21:55.000000000 +0100 @@ -2,7 +2,7 @@ version: 2 python: - version: 3.8 + version: 3.9 install: - method: pip path: . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/.travis.yml new/convertdate-2.4.0/.travis.yml --- old/convertdate-2.3.2/.travis.yml 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,33 +0,0 @@ -# This file is part of convertdate. -# http://github.com/fitnr/convertdate -# Licensed under the MIT license: -# http://opensource.org/licenses/MIT -# Copyright (c) 2016-2020, fitnr <fitnr@fakeisthenewreal> -os: linux -arch: - - amd64 - - ppc64le - -language: python - -python: - - "3.5" - - "3.6" - - "3.7" - - "3.8" - - "3.9" - - pypy3 - -matrix: - exclude: - - arch: ppc64le - python: pypy3 - -# Use container-based infrastructure -sudo: false - -install: - - pip install tox-travis - -script: - - tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/HISTORY.rst new/convertdate-2.4.0/HISTORY.rst --- old/convertdate-2.3.2/HISTORY.rst 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/HISTORY.rst 2022-01-22 19:21:55.000000000 +0100 @@ -1,5 +1,10 @@ History -------- +======= + +2.4.0 +----- +* Drop official support for Python version 3.5 and 3.6, which have reached end-of-life. +* Remove pytz dependency (#49) 2.3.2 ----- @@ -17,9 +22,11 @@ ----- * Fix bug in Bahai calculations during Ayyám-i-Há (#32). Thanks @chiuczek * Regularize variable names: - - coptic: rename `MONTH_NAMES` to `MONTHS`, rename `DAY_NAMES` to `WEEKDAYS` - - french_republican: add `MONTHS` - - mayan: rename `HAAB_MONTHS` to `HAAB`, rename `TZOLKIN_NAMES` to `TZOLKIN` + + - coptic: rename `MONTH_NAMES` to `MONTHS`, rename `DAY_NAMES` to `WEEKDAYS` + - french_republican: add `MONTHS` + - mayan: rename `HAAB_MONTHS` to `HAAB`, rename `TZOLKIN_NAMES` to `TZOLKIN` + * Add some Jewish and Islamic holidays to `holidays`: `shemini_azeret`, `lag_baomer`, `tu_beshvat`, `tisha_bav`, `ramadan`, `ashura`, `eid_alfitr`, `eid_aladha` * Add docs. See https://convertdate.readthedocs.io/ * Fix December 31st bug in `ordinal` (#34) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/LICENSE new/convertdate-2.4.0/LICENSE --- old/convertdate-2.3.2/LICENSE 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/LICENSE 2022-01-22 19:21:55.000000000 +0100 @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2016 Neil Freeman +Copyright (c) 2014-2022 Neil Freeman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/Makefile new/convertdate-2.4.0/Makefile --- old/convertdate-2.3.2/Makefile 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/Makefile 2022-01-22 19:21:55.000000000 +0100 @@ -12,7 +12,10 @@ python -m coverage html test: - tox + python -m unittest + +pylint: + pylint convertdate/ tests cov: python -m coverage run --branch --source=convertdate -m unittest @@ -24,7 +27,6 @@ deploy: rm -rf dist build - python setup.py sdist - python setup.py bdist_wheel + python -m build twine upload dist/* git push; git push --tags diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/README.md new/convertdate-2.4.0/README.md --- old/convertdate-2.3.2/README.md 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/README.md 2022-01-22 19:21:55.000000000 +0100 @@ -3,7 +3,7 @@ The convertdate package was originally developed as "[Python Date Utils](http://sourceforge.net/projects/pythondateutil/)" by Phil -Schwartz. It had been significantly updated and expanded. +Schwartz. It has been significantly updated and expanded. [Consult the complete docs for detailed usage info](https://convertdate.readthedocs.io/). @@ -37,8 +37,8 @@ Or download the package and run `python setup.py install`. -Using ------ +Examples +-------- >>> from convertdate import french_republican >>> from convertdate import hebrew diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/docs/conf.py new/convertdate-2.4.0/docs/conf.py --- old/convertdate-2.3.2/docs/conf.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/docs/conf.py 2022-01-22 19:21:55.000000000 +0100 @@ -33,7 +33,8 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc' + 'sphinx.ext.autodoc', + 'myst_parser' ] # Add any paths that contain templates here, relative to this directory. @@ -55,3 +56,4 @@ html_theme_options = { 'display_version': True, } + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/docs/history.rst new/convertdate-2.4.0/docs/history.rst --- old/convertdate-2.3.2/docs/history.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/convertdate-2.4.0/docs/history.rst 2022-01-22 19:21:55.000000000 +0100 @@ -0,0 +1 @@ +.. include:: ../HISTORY.rst \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/docs/index.rst new/convertdate-2.4.0/docs/index.rst --- old/convertdate-2.3.2/docs/index.rst 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/docs/index.rst 2022-01-22 19:21:55.000000000 +0100 @@ -1,24 +1,17 @@ -.. convertdate documentation master file, created by - sphinx-quickstart on Sun Sep 27 16:55:31 2020. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - Documentation for convertdate ============================= +.. toctree:: + :maxdepth: 1 + + readme + history + .. automodule:: convertdate .. toctree:: - :caption: Modules - :maxdepth: 3 + :caption: API reference + :maxdepth: 2 :glob: modules/* - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/docs/readme.rst new/convertdate-2.4.0/docs/readme.rst --- old/convertdate-2.3.2/docs/readme.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/convertdate-2.4.0/docs/readme.rst 2022-01-22 19:21:55.000000000 +0100 @@ -0,0 +1,5 @@ +General Info +============ + +.. include:: ../README.md + :parser: myst_parser.sphinx_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/pyproject.toml new/convertdate-2.4.0/pyproject.toml --- old/convertdate-2.3.2/pyproject.toml 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/pyproject.toml 2022-01-22 19:21:55.000000000 +0100 @@ -2,16 +2,19 @@ # http://github.com/fitnr/convertdate # Licensed under the MIT license: # http://opensource.org/licenses/MIT -# Copyright (c) 2020, fitnr <fitnr@fakeisthenewreal> +# Copyright (c) 2020-2, fitnr <fitnr@fakeisthenewreal> +[build-system] +requires = ["setuptools>=60.5.0", "wheel"] +build-backend = 'setuptools.build_meta' [tool.black] line-length = 120 -target-version = ["py38"] +target-version = ["py39"] include = 'py$' skip-string-normalization = true [tool.pylint.master] -fail-under = "9.5" +fail-under = "8.77" [tool.pylint.messages_control] disable = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/setup.cfg new/convertdate-2.4.0/setup.cfg --- old/convertdate-2.3.2/setup.cfg 1970-01-01 01:00:00.000000000 +0100 +++ new/convertdate-2.4.0/setup.cfg 2022-01-22 19:21:55.000000000 +0100 @@ -0,0 +1,52 @@ +# This file is part of convertdate. +# http://github.com/fitnr/convertdate +# Licensed under the MIT license: +# http://opensource.org/licenses/MIT +# Copyright (c) 2022, fitnr <fitnr@fakeisthenewreal> +[metadata] +name = convertdate +version = attr: convertdate.__version__ +description = Converts between Gregorian dates and other calendar systems +author = Neil Freeman +author_email = cont...@fakeisthenewreal.org +url = https://github.com/fitnr/convertdate +long_description = file: README.md +long_description_content_type = text/markdown +license = MIT +license_files = LICENSE +keywords: calendar, date, time +classifiers = + License :: OSI Approved :: MIT License + Natural Language :: English + Programming Language :: Python + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Topic :: Religion + Topic :: Scientific/Engineering :: Astronomy + Operating System :: OS Independent + +[options] +zip_safe = True +python_requires = >= 3.7, <4 +package_dir = + =src +packages = find: +install_requires = + pymeeus>=0.3.13, <=1 + +[options.packages.find] +where = src + +[options.extras_require] +tests = + coverage +docs = + sphinx + sphinx_rtd_theme + myst_parser + +[options.entry_points] +console_scripts = + censusgeocode = censusgeocode.__main__:main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/setup.py new/convertdate-2.4.0/setup.py --- old/convertdate-2.3.2/setup.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/setup.py 2022-01-22 19:21:55.000000000 +0100 @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of convertdate. @@ -6,61 +5,7 @@ # Licensed under the MIT license: # http://opensource.org/licenses/MIT -# Copyright (c) 2016, fitnr <fitnr@fakeisthenewreal> +# Copyright (c) 2016-21, fitnr <fitnr@fakeisthenewreal> from setuptools import setup - -try: - readme = open('README.md').read() -except IOError: - readme = '' - -with open('src/convertdate/__init__.py') as i: - version = next(r for r in i.readlines() if '__version__' in r).split('=')[1].strip('"\' \n') - -tests_require = [ - "coverage", -] - -setup( - name="convertdate", - version=version, - description=("Converts between Gregorian dates and other calendar systems." - "Calendars included: Baha'i, French Republican, Hebrew, " - "Indian Civil, Islamic, ISO, Julian, Mayan and Persian."), - long_description=readme, - long_description_content_type='text/markdown', - author="Neil Freeman", - license='MIT', - author_email="cont...@fakeisthenewreal.org", - url="https://github.com/fitnr/convertdate", - packages=['convertdate', 'convertdate.data'], - package_dir={'convertdate': 'src/convertdate'}, - zip_safe=True, - classifiers=[ - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Topic :: Religion', - 'Topic :: Scientific/Engineering :: Astronomy', - 'Operating System :: OS Independent', - 'License :: OSI Approved :: MIT License' - ], - python_requires=">=3.5", - install_requires=[ - 'pytz>=2014.10', - 'pymeeus>=0.3.13, <=1' - ], - tests_require=tests_require, - extras_require={ - 'test': tests_require, - 'docs': [ - 'sphinx', - 'sphinx_rtd_theme' - ] - } -) +setup() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/__init__.py new/convertdate-2.4.0/src/convertdate/__init__.py --- old/convertdate-2.3.2/src/convertdate/__init__.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/__init__.py 2022-01-22 19:21:55.000000000 +0100 @@ -3,13 +3,13 @@ # http://github.com/fitnr/convertdate # Licensed under the MIT license: # http://opensource.org/licenses/MIT -# Copyright (c) 2016, 2020, 2021 fitnr <fitnr@fakeisthenewreal> +# Copyright (c) 2016, 2020, 2021, 2022 fitnr <fitnr@fakeisthenewreal> """ The Convertdate library contains methods and functions for converting dates between different calendar systems. It was originally developed as as `Python Date Util <(http://sourceforge.net/projects/pythondateutil/>`__ -by Phil Schwartz. It had been significantly updated and expanded. +by Phil Schwartz. It has been significantly updated and expanded. Most of the original code is ported from `Fourmilab's calendar converter <http://www.fourmilab.ch/documents/calendar/>`__, @@ -38,7 +38,7 @@ from . import ordinal from . import utils -__version__ = '2.3.2' +__version__ = '2.4.0' __all__ = [ 'holidays', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/armenian.py new/convertdate-2.4.0/src/convertdate/armenian.py --- old/convertdate-2.3.2/src/convertdate/armenian.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/armenian.py 2022-01-22 19:21:55.000000000 +0100 @@ -136,18 +136,22 @@ def to_julian(year, month, day, method=None): + """Convert an Armenian date to a Julian date""" return julian.from_jd(to_jd(year, month, day, method)) def from_julian(year, month, day, method=None): + """Convert a Julian date to an Armenian date""" return from_jd(julian.to_jd(year, month, day), method) def to_gregorian(year, month, day, method=None): + """Convert an Armenian date to a Gregorian date""" return gregorian.from_jd(to_jd(year, month, day, method)) def from_gregorian(year, month, day, method=None): + """Convert a Gregorian date to an Armenian date""" return from_jd(gregorian.to_jd(year, month, day), method) @@ -162,6 +166,8 @@ def monthcalendar(year, month, method=None): + """Returns a matrix representing a monthâs calendar. + Each row represents a week; days outside of the month are represented by zeros.""" start_weekday = jwday(to_jd(year, month, 1, method)) monthlen = month_length(year, month, method) return monthcalendarhelper(start_weekday, monthlen) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/coptic.py new/convertdate-2.4.0/src/convertdate/coptic.py --- old/convertdate-2.3.2/src/convertdate/coptic.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/coptic.py 2022-01-22 19:21:55.000000000 +0100 @@ -13,8 +13,10 @@ It consists of twelve months of 30 days, followed by a "little month" of five days (six in leap years). """ +from math import floor + from . import gregorian -from .utils import floor, jwday, monthcalendarhelper +from .utils import jwday, monthcalendarhelper EPOCH = 1825029.5 MONTHS = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/gregorian.py new/convertdate-2.4.0/src/convertdate/gregorian.py --- old/convertdate-2.3.2/src/convertdate/gregorian.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/gregorian.py 2022-01-22 19:21:55.000000000 +0100 @@ -16,8 +16,9 @@ """ from calendar import isleap, monthrange from datetime import date +from math import floor -from .utils import floor, jwday, monthcalendarhelper +from .utils import jwday, monthcalendarhelper EPOCH = 1721425.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/holidays.py new/convertdate-2.4.0/src/convertdate/holidays.py --- old/convertdate-2.3.2/src/convertdate/holidays.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/holidays.py 2022-01-22 19:21:55.000000000 +0100 @@ -14,8 +14,9 @@ import calendar import time from math import trunc -from .utils import jwday, nth_day_of_month + from . import gregorian, hebrew, islamic, julian +from .utils import jwday, nth_day_of_month # weekdays MON = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/islamic.py new/convertdate-2.4.0/src/convertdate/islamic.py --- old/convertdate-2.3.2/src/convertdate/islamic.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/islamic.py 2022-01-22 19:21:55.000000000 +0100 @@ -5,8 +5,10 @@ # http://opensource.org/licenses/MIT # Copyright (c) 2016, fitnr <fitnr@fakeisthenewreal> """Convert dates between the Hijri calendar and the Gregorian and Julian calendars.""" +from math import ceil, floor + from . import gregorian -from .utils import ceil, floor, jwday, monthcalendarhelper +from .utils import jwday, monthcalendarhelper EPOCH = 1948439.5 WEEKDAYS = ("al-'ahad", "al-'ithnayn", "ath-thalatha'", "al-'arb`a'", "al-khamis", "al-jum`a", "as-sabt") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/iso.py new/convertdate-2.4.0/src/convertdate/iso.py --- old/convertdate-2.3.2/src/convertdate/iso.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/iso.py 2022-01-22 19:21:55.000000000 +0100 @@ -4,11 +4,11 @@ # Licensed under the MIT license: # http://opensource.org/licenses/MIT # Copyright (c) 2016, fitnr <fitnr@fakeisthenewreal> +"""Conversions for the `ISO calendar system <https://en.wikipedia.org/wiki/ISO_week_date>`__.""" from calendar import isleap from datetime import date -from math import trunc -from . import gregorian, ordinal +from . import gregorian from .utils import jwday, n_weeks MON = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/julian.py new/convertdate-2.4.0/src/convertdate/julian.py --- old/convertdate-2.3.2/src/convertdate/julian.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/julian.py 2022-01-22 19:21:55.000000000 +0100 @@ -19,9 +19,12 @@ mathematical comparisons across epochs. To present a date in the standard convention, use the :meth:`julian.format` function. """ +from datetime import date +from math import floor + from .gregorian import from_jd as gregorian_from_jd from .gregorian import to_jd as gregorian_to_jd -from .utils import floor, jwday, monthcalendarhelper +from .utils import jwday, monthcalendarhelper J0000 = 1721424.5 # Julian date of Gregorian epoch: 0000-01-01 J1970 = 2440587.5 # Julian date at Unix epoch: 1970-01-01 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/julianday.py new/convertdate-2.4.0/src/convertdate/julianday.py --- old/convertdate-2.3.2/src/convertdate/julianday.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/julianday.py 2022-01-22 19:21:55.000000000 +0100 @@ -8,9 +8,7 @@ The `Julian day <https://en.wikipedia.org/wiki/Julian_day>`__ is a continuous count of days since the beginning of the Julian era on January 1, 4713 BC. """ -from datetime import datetime - -from pytz import utc +from datetime import datetime, timezone from . import gregorian, julian @@ -36,7 +34,16 @@ # down to ms, which are 1/1000 of a second ms = int(1000 * round(msfrac, 6)) - return datetime(year, month, day, int(hours), int(mins), int(secs), int(ms), tzinfo=utc) + return datetime( + year, + month, + day, + int(hours), + int(mins), + int(secs), + int(ms), + tzinfo=timezone.utc + ) def from_datetime(dt): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/mayan.py new/convertdate-2.4.0/src/convertdate/mayan.py --- old/convertdate-2.3.2/src/convertdate/mayan.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/mayan.py 2022-01-22 19:21:55.000000000 +0100 @@ -4,6 +4,16 @@ # Licensed under the MIT license: # http://opensource.org/licenses/MIT # Copyright (c) 2016, fitnr <fitnr@fakeisthenewreal> +""" +The Mayan calendar was developed in Mesoamerica. It includes two interlocking +cycles: the 260-day _Tzolkin_ cycle and the 365-day _Haab'_ cycle. In the _Tzolkin_ cycle, +each day is numbered 1-13 and has one of 20 day names. The _Haab'_ cycle comprises 18 months +of 20 days, along with five additional days (_Wayebʼ_). + +The calendrical system also includes the +`Long Count <https://en.wikipedia.org/wiki/Mesoamerican_Long_Count_calendar>`__, +a modified base-20 counting scheme. Dates in the long count are usually written in the form *7.18.14.8.12*. +""" import itertools from math import trunc @@ -305,8 +315,7 @@ """Not the actual length of the month, but accounts for the 5 unlucky/nameless days""" if month == "Wayeb'": return 5 - else: - return 20 + return 20 def haab_monthcalendar(baktun=None, katun=None, tun=None, uinal=None, kin=None, jdc=None): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/persian.py new/convertdate-2.4.0/src/convertdate/persian.py --- old/convertdate-2.3.2/src/convertdate/persian.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/persian.py 2022-01-22 19:21:55.000000000 +0100 @@ -9,13 +9,13 @@ It consists of twelve months of 30 or 31 days. The new year always falls on the March equinox. """ -from math import floor, trunc +from math import ceil, floor -from pymeeus.Sun import Sun from pymeeus.Epoch import Epoch +from pymeeus.Sun import Sun from . import gregorian -from .utils import ceil, jwday, monthcalendarhelper, TROPICALYEAR +from .utils import TROPICALYEAR, jwday, monthcalendarhelper EPOCH = 1948320.5 WEEKDAYS = ("Doshanbeh", "Seshhanbeh", "Chaharshanbeh", "Panjshanbeh", "Jomeh", "Shanbeh", "Yekshanbeh") @@ -67,7 +67,7 @@ next_equinox = last_equinox - 1 - while not (last_equinox <= jd and jd < next_equinox): + while not last_equinox <= jd < next_equinox: last_equinox = next_equinox guessyear = guessyear + 1 next_equinox = equinox_jd(guessyear) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/positivist.py new/convertdate-2.4.0/src/convertdate/positivist.py --- old/convertdate-2.3.2/src/convertdate/positivist.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/positivist.py 2022-01-22 19:21:55.000000000 +0100 @@ -11,10 +11,10 @@ # http://opensource.org/licenses/MIT # Copyright (c) 2016, fitnr <fitnr@fakeisthenewreal> from calendar import isleap +from math import floor from . import gregorian from .data import positivist as data -from .utils import floor # Positivist calendar has 13 28-day months and one festival day diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/src/convertdate/utils.py new/convertdate-2.4.0/src/convertdate/utils.py --- old/convertdate-2.3.2/src/convertdate/utils.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/src/convertdate/utils.py 2022-01-22 19:21:55.000000000 +0100 @@ -4,20 +4,13 @@ # Licensed under the MIT license: # http://opensource.org/licenses/MIT # Copyright (c) 2016, fitnr <fitnr@fakeisthenewreal> +"""Helper utilities useful in several converters.""" import calendar import math TROPICALYEAR = 365.24219878 # Mean solar tropical year -def ceil(x): - return int(math.ceil(x)) - - -def floor(x): - return int(math.floor(x)) - - def amod(a, b): '''Modulus function which returns numerator if modulus is zero''' modded = int(a % b) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/tests/test_general.py new/convertdate-2.4.0/tests/test_general.py --- old/convertdate-2.3.2/tests/test_general.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/tests/test_general.py 2022-01-22 19:21:55.000000000 +0100 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- import time -from datetime import datetime - -import pytz +from datetime import datetime, timezone from convertdate import coptic, dublin, gregorian, hebrew, islamic, iso, julian, julianday, ordinal, persian, utils @@ -22,11 +20,6 @@ self.jdcs = range(2159677, 2488395, 2000) - def test_utils(self): - self.assertEqual(utils.amod(100, 4), 4) - self.assertEqual(utils.ceil(1.2), 2) - self.assertEqual(utils.jwday(self.jd), self.tm[6]) - def test_julian_legal_date(self): try: julian.to_jd(1900, 2, 29) @@ -115,16 +108,16 @@ def test_julian_day(self): self.assertEqual(julianday.from_gregorian(*self.c_greg), self.c) - self.assertEqual(julianday.to_datetime(self.c), datetime(1492, 10, 21, tzinfo=pytz.utc)) - self.assertEqual(julianday.to_datetime(self.x), datetime(2016, 2, 29, tzinfo=pytz.utc)) + self.assertEqual(julianday.to_datetime(self.c), datetime(1492, 10, 21, tzinfo=timezone.utc)) + self.assertEqual(julianday.to_datetime(self.x), datetime(2016, 2, 29, tzinfo=timezone.utc)) - self.assertEqual(julianday.to_datetime(self.c + 0.25), datetime(1492, 10, 21, 6, tzinfo=pytz.utc)) - self.assertEqual(julianday.to_datetime(self.x + 0.525), datetime(2016, 2, 29, 12, 36, tzinfo=pytz.utc)) + self.assertEqual(julianday.to_datetime(self.c + 0.25), datetime(1492, 10, 21, 6, tzinfo=timezone.utc)) + self.assertEqual(julianday.to_datetime(self.x + 0.525), datetime(2016, 2, 29, 12, 36, tzinfo=timezone.utc)) - dt = datetime(2014, 11, 8, 3, 37, tzinfo=pytz.utc) + dt = datetime(2014, 11, 8, 3, 37, tzinfo=timezone.utc) self.assertEqual(julianday.from_datetime(dt), 2456969.65069) - self.assertEqual(julianday.to_datetime(self.x + 0.525), datetime(2016, 2, 29, 12, 36, tzinfo=pytz.utc)) + self.assertEqual(julianday.to_datetime(self.x + 0.525), datetime(2016, 2, 29, 12, 36, tzinfo=timezone.utc)) def test_month_length_julian(self): self.assertEqual(julian.month_length(1582, 10), 31) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/tests/test_julian.py new/convertdate-2.4.0/tests/test_julian.py --- old/convertdate-2.3.2/tests/test_julian.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/tests/test_julian.py 2022-01-22 19:21:55.000000000 +0100 @@ -1,5 +1,4 @@ from convertdate import julian -import pytz from . import CalTestCase diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/tests/test_utils.py new/convertdate-2.4.0/tests/test_utils.py --- old/convertdate-2.3.2/tests/test_utils.py 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/tests/test_utils.py 2022-01-22 19:21:55.000000000 +0100 @@ -5,13 +5,11 @@ class TestConvertdate(unittest.TestCase): - def testCeil(self): - self.assertEqual(utils.ceil(1.2), math.ceil(1.2)) - self.assertEqual(utils.ceil(-1.2), math.ceil(-1.2)) - - def testTruncFloor(self): - self.assertEqual(math.trunc(1.2), math.floor(1.2)) - self.assertNotEqual(math.trunc(-1.2), math.floor(-1.2)) + def test_amod(self): + self.assertEqual(utils.amod(10, 5), 5) + self.assertEqual(utils.amod(12, 3), 3) + self.assertEqual(utils.amod(12, 4), 4) + self.assertEqual(utils.amod(100, 4), 4) def test_jwday(self): self.assertEqual(utils.jwday(2459252.5), 6) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/convertdate-2.3.2/tox.ini new/convertdate-2.4.0/tox.ini --- old/convertdate-2.3.2/tox.ini 2021-02-28 00:18:32.000000000 +0100 +++ new/convertdate-2.4.0/tox.ini 1970-01-01 01:00:00.000000000 +0100 @@ -1,16 +0,0 @@ -# This file is part of convertdate. -# http://github.com/fitnr/convertdate - -# Licensed under the MIT license: -# http://opensource.org/licenses/MIT -# Copyright (c) 2016, fitnr <fitnr@fakeisthenewreal> - -[tox] -envlist = pypy, py36, py37, py38, py39, pylint - -[testenv] -commands = python -m unittest - -[testenv:pylint] -deps = pylint -commands = pylint convertdate/ tests/