From 731708ff69205ffe21720e694f7c1eeafba9cd6c898628db998325ba9be2bdad Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 11 Nov 2024 20:53:14 +0000 Subject: [PATCH] - update to 2.0.1: * Migrate tests from nose to unittest and pytest * Replace :mod:`pytz` dependency with :attr:`datetime.timezone.utc` and :mod:`zoneinfo` * Reformat codebase with black and isort * Configure GitHub Actions; remove Travis CI configuration file - drop switch-to-pytest.patch (upstream) * Use assert and pytest rather than nose. - Update to version 1.0 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyRFC3339?expand=0&rev=12 --- pyRFC3339-1.1.tar.gz | 3 - pyRFC3339-2.0.1.tar.gz | 3 + python-pyRFC3339.changes | 15 ++++- python-pyRFC3339.spec | 13 ++-- switch-to-pytest.patch | 126 --------------------------------------- 5 files changed, 22 insertions(+), 138 deletions(-) delete mode 100644 pyRFC3339-1.1.tar.gz create mode 100644 pyRFC3339-2.0.1.tar.gz delete mode 100644 switch-to-pytest.patch diff --git a/pyRFC3339-1.1.tar.gz b/pyRFC3339-1.1.tar.gz deleted file mode 100644 index 8438bf3..0000000 --- a/pyRFC3339-1.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2708b8eacfa37b44dcb1f001f1464a9d541a6f3d7d9948603298e8ba1a8af361 -size 11727 diff --git a/pyRFC3339-2.0.1.tar.gz b/pyRFC3339-2.0.1.tar.gz new file mode 100644 index 0000000..24d92af --- /dev/null +++ b/pyRFC3339-2.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b608e002080bf3cad923d1c1c74078954b383ba509adbf05bee1d2915fd5b43a +size 12986 diff --git a/python-pyRFC3339.changes b/python-pyRFC3339.changes index 8122847..b2b3261 100644 --- a/python-pyRFC3339.changes +++ b/python-pyRFC3339.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Mon Nov 11 20:50:51 UTC 2024 - Dirk Müller + +- update to 2.0.1: + * Migrate tests from nose to unittest and pytest + * Replace :mod:`pytz` dependency with + :attr:`datetime.timezone.utc` and :mod:`zoneinfo` + * Reformat codebase with black and isort + * Configure GitHub Actions; remove Travis CI configuration file +- drop switch-to-pytest.patch (upstream) + ------------------------------------------------------------------- Sun Jun 11 14:31:43 UTC 2023 - ecsos @@ -7,7 +18,7 @@ Sun Jun 11 14:31:43 UTC 2023 - ecsos Mon Sep 20 02:09:22 UTC 2021 - Steve Kowalik - Add switch-to-pytest.patch - * Use assert and pytest rather than nose. + * Use assert and pytest rather than nose. ------------------------------------------------------------------- Thu Jun 3 11:27:14 UTC 2021 - pgajdos@suse.com @@ -35,7 +46,7 @@ Thu Dec 17 09:33:21 UTC 2015 - jweberhofer@weberhofer.at ------------------------------------------------------------------- Wed Nov 11 12:27:39 UTC 2015 - t.gruner@katodev.de -- Update to version 1.0 +- Update to version 1.0 ------------------------------------------------------------------- Thu Aug 13 14:12:10 UTC 2015 - ecsos@schirra.net diff --git a/python-pyRFC3339.spec b/python-pyRFC3339.spec index 9ca283c..b3832bc 100644 --- a/python-pyRFC3339.spec +++ b/python-pyRFC3339.spec @@ -1,7 +1,7 @@ # # spec file for package python-pyRFC3339 # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,20 +18,19 @@ %{?sle15_python_module_pythons} Name: python-pyRFC3339 -Version: 1.1 +Version: 2.0.1 Release: 0 Summary: Generate and parse RFC 3339 timestamps License: MIT Group: Development/Languages/Python URL: https://github.com/kurtraschke/pyRFC3339 -Source: https://github.com/kurtraschke/pyRFC3339/archive/refs/tags/v1.1.tar.gz#/pyRFC3339-%{version}.tar.gz -Patch0: switch-to-pytest.patch +Source: https://github.com/kurtraschke/pyRFC3339/archive/refs/tags/v%{version}.tar.gz#/pyRFC3339-%{version}.tar.gz BuildRequires: %{python_module pytest} -BuildRequires: %{python_module pytz} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-pytz +BuildRequires: timezone +Requires: timezone BuildArch: noarch %python_subpackages @@ -50,7 +49,7 @@ pyRFC3339 parses and generates :RFC:`3339`-compliant timestamps using Python `da %python_expand %fdupes %{buildroot}%{$python_sitelib}/pyrfc3339 %check -%pytest pyrfc3339/tests/tests.py +%pytest pyrfc3339/tests/ %files %{python_files} %license LICENSE.txt diff --git a/switch-to-pytest.patch b/switch-to-pytest.patch deleted file mode 100644 index bd37db3..0000000 --- a/switch-to-pytest.patch +++ /dev/null @@ -1,126 +0,0 @@ -Index: pyRFC3339-1.1/pyrfc3339/tests/tests.py -=================================================================== ---- pyRFC3339-1.1.orig/pyrfc3339/tests/tests.py -+++ pyRFC3339-1.1/pyrfc3339/tests/tests.py -@@ -10,7 +10,7 @@ from pyrfc3339 import generate, parse - from pyrfc3339.utils import timezone - import pytz - --from nose.tools import eq_, raises -+from pytest import raises - - - class TestCore(): -@@ -24,8 +24,8 @@ class TestCore(): - Test rounding of timezone values to the nearest second. - - ''' -- eq_(timezone(5429), '+01:30') -- eq_(timezone(5431), '+01:31') -+ assert timezone(5429) == '+01:30' -+ assert timezone(5431) == '+01:31' - - def test_zero_offset(self): - ''' -@@ -34,11 +34,11 @@ class TestCore(): - ''' - timestamp = '2009-01-01T10:02:03+00:00' - dt = parse(timestamp) -- eq_(dt.tzinfo, pytz.utc) -+ assert dt.tzinfo == pytz.utc - - timestamp = '2009-01-01T10:02:03-00:00' - dt = parse(timestamp) -- eq_(dt.tzinfo, pytz.utc) -+ assert dt.tzinfo == pytz.utc - - def test_deepcopy(self): - ''' -@@ -56,7 +56,7 @@ class TestCore(): - ''' - timestamp = '2009-01-01T10:02:03.25Z' - dt = parse(timestamp) -- eq_(dt.microsecond, 250000) -+ assert dt.microsecond == 250000 - - def test_generate_microseconds(self): - ''' -@@ -65,7 +65,7 @@ class TestCore(): - ''' - dt = datetime(2009, 1, 1, 10, 2, 3, 500000, pytz.utc) - timestamp = generate(dt, microseconds=True) -- eq_(timestamp, '2009-01-01T10:02:03.500000Z') -+ assert timestamp == '2009-01-01T10:02:03.500000Z' - - def test_mixed_case(self): - ''' -@@ -76,7 +76,7 @@ class TestCore(): - dt1 = parse('2009-01-01t10:01:02z') - dt2 = datetime(2009, 1, 1, 10, 1, 2, tzinfo=pytz.utc) - -- eq_(dt1, dt2) -+ assert dt1 == dt2 - - def test_parse_naive_utc(self): - ''' -@@ -84,15 +84,15 @@ class TestCore(): - - ''' - dt1 = parse('2009-01-01T10:01:02Z', produce_naive=True) -- eq_(dt1.tzinfo, None) -+ assert dt1.tzinfo is None - -- @raises(ValueError) - def test_parse_naive_local(self): - ''' - Test that parsing a local timestamp to a naive datetime fails. - - ''' -- parse('2009-01-01T10:01:02-04:00', produce_naive=True) -+ with raises(ValueError): -+ parse('2009-01-01T10:01:02-04:00', produce_naive=True) - - def test_generate_utc_parse_utc(self): - ''' -@@ -103,7 +103,7 @@ class TestCore(): - dt1 = dt1.replace(tzinfo=pytz.utc) - - dt2 = parse(generate(dt1, microseconds=True)) -- eq_(dt1, dt2) -+ assert dt1 == dt2 - - def test_generate_local_parse_local(self): - ''' -@@ -113,7 +113,7 @@ class TestCore(): - eastern = pytz.timezone('US/Eastern') - dt1 = eastern.localize(datetime.utcnow()) - dt2 = parse(generate(dt1, utc=False, microseconds=True), utc=False) -- eq_(dt1, dt2) -+ assert dt1 == dt2 - - def test_generate_local_parse_utc(self): - ''' -@@ -123,7 +123,7 @@ class TestCore(): - eastern = pytz.timezone('US/Eastern') - dt1 = eastern.localize(datetime.utcnow()) - dt2 = parse(generate(dt1, utc=False, microseconds=True)) -- eq_(dt1, dt2) -+ assert dt1 == dt2 - - - class TestExhaustiveRoundtrip(): -@@ -150,7 +150,7 @@ class TestExhaustiveRoundtrip(): - dt1 = tzinfo.localize(datetime.utcnow()) - timestamp = generate(dt1, utc=False, microseconds=True) - dt2 = parse(timestamp, utc=False) -- eq_(dt1, dt2) -+ assert dt1 == dt2 - - def test_utc_roundtrip(self): - for tz_name in pytz.all_timezones: -@@ -167,4 +167,4 @@ class TestExhaustiveRoundtrip(): - dt1 = tzinfo.localize(datetime.utcnow()) - timestamp = generate(dt1, utc=False, microseconds=True) - dt2 = parse(timestamp) -- eq_(dt1, dt2) -+ assert dt1 == dt2