From 40358ac82b948ea8377d5ca32b576def31b39a84 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Date: Fri, 19 Jul 2019 16:21:56 +0100 Subject: Avoid unclosed file warning --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e39446f..9634625 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,8 @@ from setuptools import setup def read(*rnames): - return open(os.path.join(os.path.dirname(__file__), *rnames)).read() + with open(os.path.join(os.path.dirname(__file__), *rnames)) as read_file: + return read_file.read() setup(name='isodate', -- cgit v1.2.1 From 91bf24dd1610d5f6ac5d4867457f0703046017d2 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Date: Fri, 19 Jul 2019 16:22:22 +0100 Subject: Raise warnings produced by isodate as errors during tests --- src/isodate/tests/__init__.py | 3 +++ tox.ini | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/isodate/tests/__init__.py b/src/isodate/tests/__init__.py index b1d46bd..7208cbd 100644 --- a/src/isodate/tests/__init__.py +++ b/src/isodate/tests/__init__.py @@ -29,6 +29,7 @@ Collect all test suites into one TestSuite instance. ''' import unittest +import warnings from isodate.tests import (test_date, test_time, test_datetime, test_duration, test_strf, test_pickle) @@ -37,6 +38,8 @@ def test_suite(): ''' Return a new TestSuite instance consisting of all available TestSuites. ''' + warnings.filterwarnings("error", module=r"isodate(\..)*") + return unittest.TestSuite([ test_date.test_suite(), test_time.test_suite(), diff --git a/tox.ini b/tox.ini index 16616ab..29d7b0a 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,8 @@ envlist = py27,py34,py35,py36,pypy,pypy3,flake,cover [testenv] deps = +setenv = + PYTHONWARNINGS = default commands = {envpython} setup.py test -- cgit v1.2.1 From b4e3d2a3efeb4805dd3058242178c1d480beeb9f Mon Sep 17 00:00:00 2001 From: Jose Eduardo Date: Fri, 19 Jul 2019 16:23:18 +0100 Subject: Add support for py37 and py38 --- .travis.yml | 4 ++++ setup.py | 2 ++ tox.ini | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ab80767..bf09968 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,10 @@ matrix: env: TOXENV=py35 - python: 3.6 env: TOXENV=py36 + - python: 3.7 + env: TOXENV=py37 + - python: 3.8 + env: TOXENV=py38 - python: 3.5 env: TOXENV=flake - python: 3.5 diff --git a/setup.py b/setup.py index 9634625..af388ac 100644 --- a/setup.py +++ b/setup.py @@ -68,6 +68,8 @@ setup(name='isodate', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Internet', ('Topic :: Software Development :' diff --git a/tox.ini b/tox.ini index 29d7b0a..8295fe0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36,pypy,pypy3,flake,cover +envlist = py27,py34,py35,py36,py37,py38,pypy,pypy3,flake,cover [testenv] deps = -- cgit v1.2.1 From fc0fb3278da5f463ca5b2f0a3acafbbf2869bd7a Mon Sep 17 00:00:00 2001 From: Jose Eduardo Date: Fri, 19 Jul 2019 16:29:43 +0100 Subject: Fix Python 3.8 DeprecationWarning Ref: https://docs.python.org/3.8/whatsnew/3.8.html > Many builtin and extension functions that take integer arguments will > now emit a deprecation warning for Decimals, Fractions and any other > objects that can be converted to integers only with a loss (e.g. that > have the `__int__()` method but do not have the `__index__()` method). > In future version they will be errors. (Contributed by Serhiy > Storchaka in bpo-36048.) --- src/isodate/duration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/isodate/duration.py b/src/isodate/duration.py index 6d1848c..d923cee 100644 --- a/src/isodate/duration.py +++ b/src/isodate/duration.py @@ -180,7 +180,7 @@ class Duration(object): newday = maxdays else: newday = other.day - newdt = other.replace(year=newyear, month=newmonth, day=newday) + newdt = other.replace(year=int(newyear), month=int(newmonth), day=newday) # does a timedelta + date/datetime return self.tdelta + newdt except AttributeError: @@ -264,7 +264,7 @@ class Duration(object): newday = maxdays else: newday = other.day - newdt = other.replace(year=newyear, month=newmonth, day=newday) + newdt = other.replace(year=int(newyear), month=int(newmonth), day=newday) return newdt - self.tdelta except AttributeError: # other probably was not compatible with data/datetime -- cgit v1.2.1 From d52a1923e980f9456dfae57b8abc1802111e531b Mon Sep 17 00:00:00 2001 From: Jose Eduardo Date: Fri, 19 Jul 2019 16:36:45 +0100 Subject: Use Xenial on Travis to test on Python3.7 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index bf09968..afb6fe7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +dist: xenial language: python matrix: include: -- cgit v1.2.1 From 1fe1c73652e4eec5b531d755079ba556b83cc147 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Date: Fri, 19 Jul 2019 16:38:08 +0100 Subject: PEP8: 79 chars --- src/isodate/duration.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/isodate/duration.py b/src/isodate/duration.py index d923cee..96127ab 100644 --- a/src/isodate/duration.py +++ b/src/isodate/duration.py @@ -180,7 +180,8 @@ class Duration(object): newday = maxdays else: newday = other.day - newdt = other.replace(year=int(newyear), month=int(newmonth), day=newday) + newdt = other.replace( + year=int(newyear), month=int(newmonth), day=newday) # does a timedelta + date/datetime return self.tdelta + newdt except AttributeError: @@ -264,7 +265,8 @@ class Duration(object): newday = maxdays else: newday = other.day - newdt = other.replace(year=int(newyear), month=int(newmonth), day=newday) + newdt = other.replace( + year=int(newyear), month=int(newmonth), day=newday) return newdt - self.tdelta except AttributeError: # other probably was not compatible with data/datetime -- cgit v1.2.1 From 269134b873751b0fe68e5442f04e0ef36656568c Mon Sep 17 00:00:00 2001 From: Jose Eduardo Date: Fri, 19 Jul 2019 16:40:34 +0100 Subject: Use Python 3.8 beta on Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index afb6fe7..57673ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: env: TOXENV=py36 - python: 3.7 env: TOXENV=py37 - - python: 3.8 + - python: 3.8-dev env: TOXENV=py38 - python: 3.5 env: TOXENV=flake -- cgit v1.2.1 From 04a2c1c4839109517fc8453ed815726f6ba88c9f Mon Sep 17 00:00:00 2001 From: Jose Eduardo Date: Mon, 20 Jan 2020 11:30:58 +0000 Subject: Use non-beta Python 3.8 on Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 57673ec..afb6fe7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: env: TOXENV=py36 - python: 3.7 env: TOXENV=py37 - - python: 3.8-dev + - python: 3.8 env: TOXENV=py38 - python: 3.5 env: TOXENV=flake -- cgit v1.2.1