[arch-commits] Commit in python-jsonpickle/trunk (2 files)

Frederik Schwan freswa at archlinux.org
Sun Oct 11 15:20:25 UTC 2020


    Date: Sunday, October 11, 2020 @ 15:20:24
  Author: freswa
Revision: 723490

fix dependency for python 3.8

Added:
  python-jsonpickle/trunk/fix-importlib_metadata-dependency.patch
Modified:
  python-jsonpickle/trunk/PKGBUILD

-----------------------------------------+
 PKGBUILD                                |    9 ++++--
 fix-importlib_metadata-dependency.patch |   41 ++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-10-11 14:49:34 UTC (rev 723489)
+++ PKGBUILD	2020-10-11 15:20:24 UTC (rev 723490)
@@ -2,7 +2,7 @@
 
 pkgname=python-jsonpickle
 pkgver=1.4.1
-pkgrel=1
+pkgrel=2
 arch=('any')
 pkgdesc="Python library for serializing any arbitrary object graph into JSON"
 url="https://jsonpickle.github.io/"
@@ -11,8 +11,10 @@
 checkdepends=('python-pytest-black' 'python-pytest-cov' 'python-numpy' 'python-feedparser'
               'python-coverage' 'python-simplejson' 'python-pymongo' 'python-ujson' 'python-pandas')
 license=('BSD')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/jsonpickle/jsonpickle/archive/v$pkgver.tar.gz")
-sha512sums=('aaaf579d6fafc28646f2566e9d8cfaf1d735e12a443c3dc107051f4229fc630d6539ff6b9a610518d02dc4d9704f4100310f81c38cf0ac53561ade874141143d')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/jsonpickle/jsonpickle/archive/v$pkgver.tar.gz"
+        fix-importlib_metadata-dependency.patch)
+sha512sums=('aaaf579d6fafc28646f2566e9d8cfaf1d735e12a443c3dc107051f4229fc630d6539ff6b9a610518d02dc4d9704f4100310f81c38cf0ac53561ade874141143d'
+            'ce5ab39821b02e4b6aa9b4380ad1681154b48e08af52f98fac93733e1cb07d4838d3b224569b6f74fe33df0f5dde7fd40af7f870b329308522861ed729209831')
 
 export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
 
@@ -19,6 +21,7 @@
 prepare() {
   cd jsonpickle-$pkgver
   sed -i 's/--flake8//' pytest.ini
+  patch -Np1 < ../fix-importlib_metadata-dependency.patch
 }
 
 build() {

Added: fix-importlib_metadata-dependency.patch
===================================================================
--- fix-importlib_metadata-dependency.patch	                        (rev 0)
+++ fix-importlib_metadata-dependency.patch	2020-10-11 15:20:24 UTC (rev 723490)
@@ -0,0 +1,41 @@
+From 8debff4511089dad850930c702106a436275f118 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro at hroncok.cz>
+Date: Wed, 22 Apr 2020 20:38:28 +0200
+Subject: [PATCH] Use importlib.metadata from the standard library on Python
+ 3.8+
+
+Fixes https://github.com/jsonpickle/jsonpickle/issues/303
+---
+ jsonpickle/version.py | 7 ++++++-
+ setup.cfg             | 2 +-
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/jsonpickle/version.py b/jsonpickle/version.py
+index 01c83c4..92b44b2 100644
+--- a/jsonpickle/version.py
++++ b/jsonpickle/version.py
+@@ -1,5 +1,10 @@
++import sys
++
+ try:
+-    import importlib_metadata as metadata
++    if sys.version_info < (3, 8):
++        import importlib_metadata as metadata
++    else:
++        from importlib import metadata
+ except (ImportError, OSError):
+     metadata = None
+ 
+diff --git a/setup.cfg b/setup.cfg
+index 9f0eab2..46707ec 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -36,7 +36,7 @@ packages = find:
+ include_package_data = true
+ python_requires = >=2.7
+ install_requires =
+-	importlib_metadata
++	importlib_metadata; python_version<"3.8"
+ setup_requires = setuptools_scm[toml] >= 3.4.1
+ 
+ [options.extras_require]


More information about the arch-commits mailing list