15
0

Accepting request 1141566 from home:bnavigator:branches:devel:languages:python

- Update to 2.4.4
  ## Changes
  * Removed support for Python 3.6 (EOL since December 2021)
  ## Enhancements
  * Added attribute alphabetic (#1634)
  * Added attribute json_key (#1648)
  * Added value validation for numerical VRs, add type validation
    for all validated VRs (#1414)
  * CLI commands now accept pydicom charset test files and CLI help
    shows Python Version (#1674)
  * Added support for Python 3.11 (#1658)
  * Added ISfloat to allow non-strict reading of existing files
    with float IS values (#1661)
  * Improved speed of creating and accessing highly nested
    structures (#1728, #1734)
  * Switched to a pyproject.toml build process (#1792)
  * Updated DICOM and UID dicts to DICOM 2023b (#1803)
  ## Fixes
  * Fixed length validation of DS values with maximum length
    without a leading zero (#1632)
  * Increased download speed with progress bar for test data
    (#1611)
  * Fixed crash due to invalid private creator (#1638)
  * Fixed extremely long BytesLengthException error messages
    (#1683)
  * In codify, ensure unique variable names for DICOM keywords
    repeated in sequences, and handle unicode characters correctly
    (#1670)
  * Fixed handling of some invalid values in to_json_dict() if
    suppress_invalid_tags is set to True (#1693)

OBS-URL: https://build.opensuse.org/request/show/1141566
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydicom?expand=0&rev=28
This commit is contained in:
2024-01-26 09:37:48 +00:00
committed by Git OBS Bridge
parent fa90e1b0cd
commit 1abc033a13
5 changed files with 109 additions and 21 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:655db29c21cb333a4f9dfffdeaa80995b1d3b89e98b66a16f5cc886e5b338028
size 2164956

3
pydicom-2.4.4-gh.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:42c06ed74331174111dd42c89db774a13fc472abe18015f22c5aba80cddb7843
size 2203904

View File

@@ -0,0 +1,23 @@
From 11f7bd260137a18496bdfd00ddb742ef0cf2d2fd Mon Sep 17 00:00:00 2001
From: scaramallion <scaramallion@users.noreply.github.com>
Date: Mon, 16 Oct 2023 10:35:46 +1100
Subject: [PATCH 1/4] Fix Pillow raising AttributeError due to Image.mode being
read-only
Index: pydicom-2.4.4/pydicom/pixel_data_handlers/pillow_handler.py
===================================================================
--- pydicom-2.4.4.orig/pydicom/pixel_data_handlers/pillow_handler.py
+++ pydicom-2.4.4/pydicom/pixel_data_handlers/pillow_handler.py
@@ -129,7 +129,11 @@ def _decompress_single_frame(
image.tile[0][2],
(color_mode, ''),
)]
- image.mode = color_mode
+ # Pillow 10.1+ made Image.mode read-only
+ if hasattr(image, "_mode"):
+ image._mode = color_mode
+ else:
+ image.mode = color_mode
image.rawmode = color_mode
return image

View File

@@ -1,3 +1,55 @@
-------------------------------------------------------------------
Thu Jan 25 17:55:25 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Update to 2.4.4
## Changes
* Removed support for Python 3.6 (EOL since December 2021)
## Enhancements
* Added attribute alphabetic (#1634)
* Added attribute json_key (#1648)
* Added value validation for numerical VRs, add type validation
for all validated VRs (#1414)
* CLI commands now accept pydicom charset test files and CLI help
shows Python Version (#1674)
* Added support for Python 3.11 (#1658)
* Added ISfloat to allow non-strict reading of existing files
with float IS values (#1661)
* Improved speed of creating and accessing highly nested
structures (#1728, #1734)
* Switched to a pyproject.toml build process (#1792)
* Updated DICOM and UID dicts to DICOM 2023b (#1803)
## Fixes
* Fixed length validation of DS values with maximum length
without a leading zero (#1632)
* Increased download speed with progress bar for test data
(#1611)
* Fixed crash due to invalid private creator (#1638)
* Fixed extremely long BytesLengthException error messages
(#1683)
* In codify, ensure unique variable names for DICOM keywords
repeated in sequences, and handle unicode characters correctly
(#1670)
* Fixed handling of some invalid values in to_json_dict() if
suppress_invalid_tags is set to True (#1693)
* Fixed reading of data with 8 bits allocated, encoded in Big
Endian transfer syntax using VR OW (#1680)
* Fixed crash if reading regular dataset that has the SOP Class
of a DICOMDIR (#1702)
* Fixed wrong waveform data calculation when as_raw=False and
baseline!=0 (#1667)
* Fixed reading LUTData to expected size (#1747)
* Fixed handling of AT VRs when codifying data elements (#1738)
## Pydicom Internals
* In test suites, renamed setup and teardown methods,
deprecated starting in pytest 7.2
* Use own fork of CharPyLS to handle builds with Python 3.11
(#1788)
- Go back do %{?sle15_python_module_pythons}. python- prefixed
packages for Python 3.6 should be handled by separate maintenance
request to python3-pydicom on SLE side
- Add pydicom-pr1908-fixpillow.patch
* gh#pydicom/pydicom#1908 fixes gh#pydicom/pydicom#1907
-------------------------------------------------------------------
Tue Jan 16 09:57:21 UTC 2024 - Axel Braun <axel.braun@gmx.de>

View File

@@ -16,26 +16,31 @@
#
%{?sle15allpythons}
%{?sle15_python_module_pythons}
Name: python-pydicom
Version: 2.3.1
Version: 2.4.4
Release: 0
Summary: Pure python package for DICOM medical file reading and writing
License: MIT
URL: https://github.com/darcymason/pydicom
Source: https://files.pythonhosted.org/packages/source/p/pydicom/pydicom-%{version}.tar.gz
Source: https://github.com/pydicom/pydicom/archive/refs/tags/v%{version}.tar.gz#/pydicom-%{version}-gh.tar.gz
# PATCH-FIX-UPSTREAM pydicom-pr1908-fixpillow.patch gh#pydicom/pydicom#1908 fixes gh#pydicom/pydicom#1907
Patch0: pydicom-pr1908-fixpillow.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module flit-core >= 3.2}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module pydicom-data}
BuildRequires: %{python_module Pillow}
BuildRequires: %{python_module pydicom-data}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests}
%if 0%{?suse_version} > 1550
# GDCM is not multiflavor in Tumbleweed
BuildRequires: python3-gdcm
%endif
# /SECTION
BuildArch: noarch
Requires(post): update-alternatives
@@ -52,7 +57,7 @@ medical images and related information such as reports
and radiotherapy objects.
%prep
%setup -q -n pydicom-%{version}
%autosetup -p1 -n pydicom-%{version}
%build
%pyproject_wheel
@@ -60,25 +65,33 @@ and radiotherapy objects.
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/pydicom
%python_expand rm -r %{buildroot}%{$python_sitelib}/pydicom/{benchmarks,tests,data/test_files}
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export LANG=en_US.UTF-8
%{python_expand # see https://github.com/pydicom/pydicom/issues/1697
mkdir build/locallib
cp -r %{$python_sitelib}/data_store %{$python_sitelib}/pydicom_data*.dist-info build/locallib/
}
export PYTHONPATH=$PWD/build/locallib
# these assume that a cache is updatable from online downloads
skips="test_fetch_data_files"
# see https://github.com/pydicom/pydicom-data/issues/9
skips="$skips or OBXXXX1A or (test_can_access_unsupported_dataset and (TestPillowHandler_JPEG or TestPillowHandler_JPEG2K))"
skips="$skips or test_get_testdata_file_external_hash_mismatch"
skips="$skips or test_get_testdata_files_local_external_and_cache"
skips="$skips or test_get_testdata_files_hash_match"
skips="$skips or test_get_testdata_files_hash_mismatch"
skips="$skips or test_get_testdata_files_external_ignore_hash"
# Failures only on ppc64
skips="$skips or test_invalid_arr_dtype_raises or TestHandlerGenerateMultiplex or TestHandlerMultiplexArray"
# Failures only on i586
skips="$skips or test_write_file_id or test_file_id or test_encapsulate_bot_large_raises or (TestPillowHandler_JPEG2K and test_array)"
if [ "$RPM_ARCH" = "ppc64le" -o "$RPM_ARCH" = "aarch64" ]; then
skips="$skips or TestPillowHandler_JPEG2K"
fi
if [ $(getconf LONG_BIT) -eq 32 ]; then
# Failures on i586
skips="$skips or test_write_file_id or test_file_id or test_encapsulate_bot_large_raises or (TestPillowHandler_JPEG2K and test_array)"
fi
# see https://github.com/pydicom/pydicom/issues/1697
ignores="--ignore pydicom/tests/test_dataset.py --ignore pydicom/tests/test_data_manager.py"
%pytest -rs pydicom/tests $ignores -k "not ($skips)"
%pytest -rsfR $ignores -k "not ($skips)"
%post
%python_install_alternative pydicom