#11 EPEL9 compatibility
Merged 9 months ago by limb. Opened 9 months ago by music.
rpms/ music/python-jsonpickle epel9-compat  into  rawhide

file added
+34
@@ -0,0 +1,34 @@ 

+ From 0911072ed49ca4d15cc1cffa485b22584f088c83 Mon Sep 17 00:00:00 2001

+ From: "Benjamin A. Beasley" <code@musicinmybrain.net>

+ Date: Tue, 6 Dec 2022 10:39:13 -0500

+ Subject: [PATCH] Use stdlib datetime.timezone instead of pytz in tests

+ 

+ This removes an implicit test dependency (satisfied via pandas) on pytz.

+ ---

+  tests/object_test.py | 6 +++---

+  1 file changed, 3 insertions(+), 3 deletions(-)

+ 

+ diff --git a/tests/object_test.py b/tests/object_test.py

+ index 0d43b5a..2aff66a 100644

+ --- a/tests/object_test.py

+ +++ b/tests/object_test.py

+ @@ -9,7 +9,6 @@

+  import threading

+  

+  import pytest

+ -import pytz

+  from helper import SkippableTest

+  

+  import jsonpickle

+ @@ -1104,8 +1103,9 @@ def test_unicode_mixin():

+  

+  def test_datetime_with_tz_copies_refs():

+      """Ensure that we create copies of referenced objects"""

+ -    d0 = datetime.datetime(2020, 5, 5, 5, 5, 5, 5, tzinfo=pytz.UTC)

+ -    d1 = datetime.datetime(2020, 5, 5, 5, 5, 5, 5, tzinfo=pytz.UTC)

+ +    utc = datetime.timezone.utc

+ +    d0 = datetime.datetime(2020, 5, 5, 5, 5, 5, 5, tzinfo=utc)

+ +    d1 = datetime.datetime(2020, 5, 5, 5, 5, 5, 5, tzinfo=utc)

+      obj = [d0, d1]

+      encoded = jsonpickle.encode(obj, make_refs=False)

+      decoded = jsonpickle.decode(encoded)

file modified
+18 -2
@@ -3,7 +3,7 @@ 

  # to use a Python-compatible version number if you need to set an "uncommon"

  # version for this RPM.

  Version:        3.0.0

- Release:        3%{?dist}

+ Release:        4%{?dist}

  Summary:        A module that allows any object to be serialized into JSON

  

  License:        BSD-3-Clause
@@ -15,6 +15,11 @@ 

  Source2:        https://github.com/Theelx.gpg

  

  Patch:          unpin-setuptools.patch

+ # Use stdlib datetime.timezone instead of pytz in tests

+ #

+ # This removes an implicit test dependency (satisfied via pandas) on pytz.

+ # https://github.com/jsonpickle/jsonpickle/pull/421

+ Patch:          %{url}/pull/421.patch

  

  %global _docdir_fmt %{name}

  
@@ -49,6 +54,14 @@ 

      setup.cfg

  sed -r -i 's/[[:blank:]]--cov[^[:blank:]]*//g' pytest.ini

  

+ %if 0%{?el9}

+ # Not yet packaged:

+ # [RFE:EPEL9] EPEL9 branch for python-pandas

+ # https://bugzilla.redhat.com/show_bug.cgi?id=2032550

+ # (python-scikit-learn: no EPEL9 request yet)

+ sed -r -i -e 's/^([[:blank:]]*)(pandas|scikit-learn)/\1# \2/' setup.cfg

+ %endif

+ 

  

  %generate_buildrequires

  %pyproject_buildrequires -x testing,testing.libs
@@ -64,13 +77,16 @@ 

  

  

  %check

- %pytest

+ %pytest %{?el9:--ignore=jsonpickle/ext/pandas.py}

  

  

  %files -n python3-jsonpickle -f %{pyproject_files}

  

  

  %changelog

+ * Tue Dec 06 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 3.0.0-4

+ - EPEL9 compatibility

+ 

  * Tue Dec 06 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 3.0.0-3

  - Switch URL to the GitHub project page

  - Stop using deprecated zero-argument form of pypi_source

Adds conditionals and a patch so that the Rawhide spec file builds for EPEL9 as well. (I submitted the patch upstream, and it makes sense for current releases, not just EPEL9.)

This can be merged back to the epel9 branch to fix RHBZ#2097432: [EPEL9] Please branch and build python-jsonpickle in epel9.

EPEL9 scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=95020212

Pull-Request has been merged by limb

9 months ago
Metadata