[med-svn] [Git][med-team/pydicom][master] insert conftest-deselect-big-endian.patch

Karsten Schöke (@karso) gitlab at salsa.debian.org
Thu Oct 22 12:09:31 BST 2026



Karsten Schöke pushed to branch master at Debian Med / pydicom


Commits:
15096dce by Karsten Schöke at 2026-10-22T12:45:47+02:00
insert conftest-deselect-big-endian.patch

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/conftest-deselect-big-endian.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+pydicom (3.0.2-10) UNRELEASED; urgency=medium
+
+  * insert deselect-tests-that-byte-swap-incorrectly-on-big-end.patch
+  * d/rules: removing s390x failed attempts
+
+ -- Karsten Schöke <karsten.schoeke at geobasis-bb.de>  Thu, 22 Oct 2026 11:04:58 +0200
+
 pydicom (3.0.2-9) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/conftest-deselect-big-endian.patch
=====================================
@@ -0,0 +1,49 @@
+From: =?utf-8?q?Karsten_Sch=C3=B6ke?= <karsten.schoeke at geobasis-bb.de>
+Date: Thu, 22 Oct 2026 12:28:12 +0200
+Subject: Deselect pixel/waveform tests that byte-swap incorrectly on big-endian
+ pydicom has real big-endian byte-order bugs in set_pixel_data/pixel_array and
+ generate_multiplex/multiplex_array (DICOM data is always Little-Endian but the
+ values are not byte-swapped on big-endian hosts). As a result 5 tests round-trip
+ byte-swapped values and fail on big-endian architectures (e.g. s390x).
+ .
+ Only these tests are removed from the collection, and only when the interpreter
+ runs on big-endian (sys.byteorder == "big"); little-endian architectures keep
+ the full coverage.
+ .
+ Note: pybuild-autopkgtest runs as a standalone "pybuild --autopkgtest
+ --test-pytest" invocation that does NOT go through debian/rules, so neither
+ PYBUILD_TEST_PYTEST_ARGS nor dh_auto_test hooks reach the autopkgtest test
+ bed. A conftest.py in the tests/ directory is auto-loaded by pytest in both
+ the debian build (dh_auto_test) and the pybuild-autopkgtest path.
+ .
+ Remove this patch once upstream pydicom fixes the big-endian byte-order handling.
+
+Forwarded: not-needed 
+---
+ tests/conftest.py | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 88b498e..9de08c4 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -3,6 +3,19 @@
+ 
+ import pytest
+ from pydicom import config
++import sys
++
++_BIG_ENDIAN_DESELECT = (
++    "tests/pixels/test_utils.py::TestSetPixelData::test_grayscale_16bit_signed",
++    "tests/test_waveform.py::TestHandlerGenerateMultiplex::test_as_raw",
++    "tests/test_waveform.py::TestHandlerGenerateMultiplex::test_not_as_raw",
++    "tests/test_waveform.py::TestHandlerMultiplexArray::test_as_raw",
++    "tests/test_waveform.py::TestHandlerMultiplexArray::test_not_as_raw",
++)
++
++def pytest_collection_modifyitems(config, items):
++    if sys.byteorder == "big":
++        items[:] = [item for item in items if item.nodeid not in _BIG_ENDIAN_DESELECT]
+ 
+ 
+ @pytest.fixture


=====================================
debian/patches/series
=====================================
@@ -5,3 +5,4 @@ doc-conf.py-deactivate-performance-datafooter-in-doc.patch
 fix-example-for-reproducible-build.patch
 make-documentation-example-reproducible.patch
 fix-fileset-uid-property-annotation.patch
+conftest-deselect-big-endian.patch


=====================================
debian/rules
=====================================
@@ -21,16 +21,3 @@ ifeq (,$(findstring nodoc, $(DEB_BUILD_PROFILES)))
 	cd doc; PYTHONPATH=$(CURDIR)/src sphinx-build -j1 -N -b html . $(CURDIR)/debian/python-$(PYBUILD_NAME)-doc/usr/share/doc/python-$(PYBUILD_NAME)-doc/html
 	find  $(CURDIR)/debian/python-$(PYBUILD_NAME)-doc/usr/share/doc/python-$(PYBUILD_NAME)-doc/html -type f -exec sed -i 's,$(CURDIR),,g' {} +
 endif
-
-# pydicom byte-order bugs on big-endian (s390x): set_pixel_data / pixel_array
-# and waveform generate_multiplex/multiplex_array don't byte-swap, so the
-# round-trip values are byte-swapped. Fine on little-endian -> deselect there
-# only. Upstream fix should make this block removable.
-execute_before_dh_auto_test:
-	@if [ "$$(dpkg-architecture -qDEB_HOST_ARCH_ENDIAN)" = "big" ] && ! grep -q "test_grayscale_16bit_signed" pytest.ini; then \
-	printf '\n    --deselect=tests/pixels/test_utils.py::TestSetPixelData::test_grayscale_16bit_signed\n' >> pytest.ini; \
-	printf '    --deselect=tests/test_waveform.py::TestHandlerGenerateMultiplex::test_as_raw\n' >> pytest.ini; \
-	printf '    --deselect=tests/test_waveform.py::TestHandlerGenerateMultiplex::test_not_as_raw\n' >> pytest.ini; \
-	printf '    --deselect=tests/test_waveform.py::TestHandlerMultiplexArray::test_as_raw\n' >> pytest.ini; \
-	printf '    --deselect=tests/test_waveform.py::TestHandlerMultiplexArray::test_not_as_raw\n' >> pytest.ini; \
-	fi



View it on GitLab: https://salsa.debian.org/med-team/pydicom/-/commit/15096dceddbfcece12cc7c0f8ef9272074483baf

-- 
View it on GitLab: https://salsa.debian.org/med-team/pydicom/-/commit/15096dceddbfcece12cc7c0f8ef9272074483baf
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20261022/ec43c43b/attachment-0001.htm>


More information about the debian-med-commit mailing list