Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
json-tricks
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian Python Team
packages
json-tricks
Commits
b263e14d
Commit
b263e14d
authored
1 month ago
by
Colin Watson
Browse files
Options
Downloads
Patches
Plain Diff
Fix test failures on big-endian systems
Closes: #1104240
parent
727284a6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
debian/changelog
+7
-0
7 additions, 0 deletions
debian/changelog
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
debian/patches/tests-endian.patch
+48
-0
48 additions, 0 deletions
debian/patches/tests-endian.patch
with
56 additions
and
0 deletions
debian/changelog
+
7
−
0
View file @
b263e14d
json-tricks (3.17.3-2) UNRELEASED; urgency=medium
[ Chris Hofstaedtler ]
* Fix test failures on big-endian systems (closes: #1104240).
-- Colin Watson <cjwatson@debian.org> Mon, 28 Apr 2025 00:11:13 +0100
json-tricks (3.17.3-1) unstable; urgency=medium
* Team upload.
...
...
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
b263e14d
fix-pytest-warnings.patch
tests-endian.patch
This diff is collapsed.
Click to expand it.
debian/patches/tests-endian.patch
0 → 100644
+
48
−
0
View file @
b263e14d
From: Chris Hofstaedtler <zeha@debian.org>
Date: Mon, 28 Apr 2025 00:08:51 +0100
Subject: Fix test failures on big-endian systems
Test data assumes tests are running on little-endian systems, or at least
that the native endianness is little. Obviously this breaks on big-endian
systems like s390x. Make the assumption explicit by adding "endian": "little"
to the to-decoded test-data.
Fixes FTBFS and CI test failures on s390x.
Bug: https://github.com/mverleg/pyjson_tricks/issues/88
Bug-Debian: https://bugs.debian.org/1104240
Last-Update: 2025-04-28
---
tests/test_np.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/test_np.py b/tests/test_np.py
index b7857ea..7b459e2 100644
--- a/tests/test_np.py
+++ b/tests/test_np.py
@@ -310,7 +310,7 @@
def test_encode_compact_no_inline_compression():
def test_decode_compact_mixed_compactness():
json = '[{"__ndarray__": "b64:AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAA' \
- 'UQAAAAAAAABhAAAAAAAAAHEAAAAAAAAAgQA==", "dtype": "float64", "shape": [2, 4], "Corder": ' \
+ 'UQAAAAAAAABhAAAAAAAAAHEAAAAAAAAAgQA==", "dtype": "float64", "shape": [2, 4], "endian": "little", "Corder": ' \
'true}, {"__ndarray__": [3.141592653589793, 2.718281828459045], "dtype": "float64", "shape": [2]}]'
data = loads(json)
assert_equal(data[0], array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]]), array([pi, exp(1)]))
@@ -343,14 +343,14 @@
def test_decode_without_endianness():
def test_decode_compact_inline_compression():
- json = '[{"__ndarray__": "b64.gz:H4sIAAAAAAAC/2NgAIEP9gwQ4AChOKC0AJQWgdISUFoGSitAaSUorQKl1aC0BpTWgtI6UFoPShs4AABmfqWAgAAAAA==", "dtype": "float64", "shape": [4, 4], "Corder": true}]'
+ json = '[{"__ndarray__": "b64.gz:H4sIAAAAAAAC/2NgAIEP9gwQ4AChOKC0AJQWgdISUFoGSitAaSUorQKl1aC0BpTWgtI6UFoPShs4AABmfqWAgAAAAA==", "dtype": "float64", "shape": [4, 4], "Corder": true, "endian": "little"}]'
data = loads(json)
assert_equal(data[0], array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0], [9.0, 10.0, 11.0, 12.0], [13.0, 14.0, 15.0, 16.0]]))
def test_decode_compact_no_inline_compression():
json = '[{"__ndarray__": "b64:AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEA=", ' \
- '"dtype": "float64", "shape": [2, 2], "Corder": true}]'
+ '"dtype": "float64", "shape": [2, 2], "Corder": true, "endian": "little"}]'
data = loads(json)
assert_equal(data[0], array([[1.0, 2.0], [3.0, 4.0]]))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment