mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-09-23 11:21:11 +00:00
python3-jsonpath-rw: drop the six dependency
Patch jsonpath-rw to use int, str and range instead of six.integer_types, six.string_types and six.moves.xrange, and drop the runtime dependency. Built for intel-corei7-64. AI-Generated: Uses Claude Code (Claude Opus 5) Signed-off-by: Markus Volk <f_l_k@t-online.de> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
+58
@@ -0,0 +1,58 @@
|
||||
From a12efc7d5ede4fb2404ea1e4edeba03c9225ab4e Mon Sep 17 00:00:00 2001
|
||||
From: Markus Volk <f_l_k@t-online.de>
|
||||
Date: Mon, 21 Sep 2026 13:22:53 +0200
|
||||
Subject: [PATCH] drop the six dependency
|
||||
|
||||
six is a Python 2 compatibility shim and jsonpath-rw does not need it on
|
||||
Python 3: six.integer_types and six.string_types are int and str, and
|
||||
six.moves.xrange is range.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
AI-Generated: Uses Claude Code (Claude Opus 5)
|
||||
---
|
||||
jsonpath_rw/jsonpath.py | 6 ++----
|
||||
setup.py | 2 +-
|
||||
2 files changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/jsonpath_rw/jsonpath.py b/jsonpath_rw/jsonpath.py
|
||||
index 3c491d0..4703fae 100644
|
||||
--- a/jsonpath_rw/jsonpath.py
|
||||
+++ b/jsonpath_rw/jsonpath.py
|
||||
@@ -1,7 +1,5 @@
|
||||
from __future__ import unicode_literals, print_function, absolute_import, division, generators, nested_scopes
|
||||
import logging
|
||||
-import six
|
||||
-from six.moves import xrange
|
||||
from itertools import *
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -485,13 +483,13 @@ class Slice(JSONPath):
|
||||
|
||||
# Here's the hack. If it is a dictionary or some kind of constant,
|
||||
# put it in a single-element list
|
||||
- if (isinstance(datum.value, dict) or isinstance(datum.value, six.integer_types) or isinstance(datum.value, six.string_types)):
|
||||
+ if (isinstance(datum.value, dict) or isinstance(datum.value, int) or isinstance(datum.value, str)):
|
||||
return self.find(DatumInContext([datum.value], path=datum.path, context=datum.context))
|
||||
|
||||
# Some iterators do not support slicing but we can still
|
||||
# at least work for '*'
|
||||
if self.start == None and self.end == None and self.step == None:
|
||||
- return [DatumInContext(datum.value[i], path=Index(i), context=datum) for i in xrange(0, len(datum.value))]
|
||||
+ return [DatumInContext(datum.value[i], path=Index(i), context=datum) for i in range(0, len(datum.value))]
|
||||
else:
|
||||
return [DatumInContext(datum.value[i], path=Index(i), context=datum) for i in range(0, len(datum.value))[self.start:self.end:self.step]]
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 8108124..4b2dfb9 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -18,7 +18,7 @@ setuptools.setup(
|
||||
'console_scripts': ['jsonpath.py = jsonpath_rw.bin.jsonpath:entry_point'],
|
||||
},
|
||||
test_suite = 'tests',
|
||||
- install_requires = [ 'ply', 'decorator', 'six' ],
|
||||
+ install_requires = [ 'ply', 'decorator' ],
|
||||
classifiers = [
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Intended Audience :: Developers',
|
||||
@@ -4,6 +4,7 @@ SECTION = "devel/python"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://README.rst;beginline=198;endline=215;md5=2866908485c18dc999b6c8dc608563ec"
|
||||
|
||||
SRC_URI += "file://0001-drop-the-six-dependency.patch"
|
||||
SRC_URI[sha256sum] = "05c471281c45ae113f6103d1268ec7a4831a2e96aa80de45edc89b11fac4fbec"
|
||||
|
||||
inherit pypi setuptools3
|
||||
@@ -12,5 +13,4 @@ RDEPENDS:${PN} += " \
|
||||
python3-decorator \
|
||||
python3-logging \
|
||||
python3-ply \
|
||||
python3-six \
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user