2016-10-13 21:55:11 +02:00
|
|
|
#
|
|
|
|
# spec file for package python-pydicom
|
|
|
|
#
|
2022-09-24 12:21:18 +02:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2016-10-13 21:55:11 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-11-01 15:04:11 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-10-13 21:55:11 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2017-09-11 17:09:39 +02:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
%define oldpython python
|
2016-10-13 21:55:11 +02:00
|
|
|
Name: python-pydicom
|
2022-09-24 12:21:18 +02:00
|
|
|
Version: 2.3.0
|
2016-10-13 21:55:11 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Pure python package for DICOM medical file reading and writing
|
|
|
|
License: MIT
|
2018-08-29 14:15:08 +02:00
|
|
|
URL: https://github.com/darcymason/pydicom
|
2019-03-08 09:09:48 +01:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pydicom/pydicom-%{version}.tar.gz
|
2017-09-11 17:09:39 +02:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2022-09-24 12:21:18 +02:00
|
|
|
# SECTION test requirements
|
|
|
|
BuildRequires: %{python_module numpy}
|
|
|
|
BuildRequires: %{python_module Pillow}
|
2022-10-10 10:51:09 +02:00
|
|
|
BuildRequires: %{python_module pydicom-data}
|
2022-09-24 12:21:18 +02:00
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
BuildRequires: %{python_module requests}
|
|
|
|
BuildRequires: python3-gdcm
|
|
|
|
# /SECTION
|
2018-08-29 14:15:08 +02:00
|
|
|
BuildArch: noarch
|
2017-09-11 17:09:39 +02:00
|
|
|
%ifpython2
|
|
|
|
Obsoletes: %{oldpython}-dicom < %{version}
|
|
|
|
Provides: %{oldpython}-dicom = %{version}
|
|
|
|
%endif
|
2022-09-24 12:21:18 +02:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2017-09-11 17:09:39 +02:00
|
|
|
%python_subpackages
|
|
|
|
|
2016-10-13 21:55:11 +02:00
|
|
|
%description
|
2017-09-11 17:42:51 +02:00
|
|
|
pydicom is a pure python package for parsing DICOM files
|
|
|
|
into natural pythonic structures for further manipulation.
|
|
|
|
Modified datasets can be written again to DICOM format files.
|
2016-10-13 21:55:11 +02:00
|
|
|
|
|
|
|
DICOM is a standard (http://medical.nema.org) for communicating
|
|
|
|
medical images and related information such as reports
|
|
|
|
and radiotherapy objects.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pydicom-%{version}
|
|
|
|
|
|
|
|
%build
|
2017-09-11 17:09:39 +02:00
|
|
|
%python_build
|
2016-10-13 21:55:11 +02:00
|
|
|
|
|
|
|
%install
|
2017-09-11 17:09:39 +02:00
|
|
|
%python_install
|
2022-09-24 12:21:18 +02:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/pydicom
|
|
|
|
%python_expand rm -r %{buildroot}%{$python_sitelib}/pydicom/{benchmarks,tests,data/test_files}
|
2017-09-11 17:09:39 +02:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2016-10-13 21:55:11 +02:00
|
|
|
|
|
|
|
%check
|
|
|
|
export LANG=en_US.UTF-8
|
2022-10-10 10:51:09 +02:00
|
|
|
|
|
|
|
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))"
|
|
|
|
|
2022-09-24 12:21:18 +02:00
|
|
|
# Failures only on ppc64
|
|
|
|
skips="$skips or test_invalid_arr_dtype_raises or TestHandlerGenerateMultiplex or TestHandlerMultiplexArray"
|
|
|
|
# Failures only on i586
|
2022-10-10 10:51:09 +02:00
|
|
|
skips="$skips or test_write_file_id or test_file_id or test_encapsulate_bot_large_raises or (TestPillowHandler_JPEG2K and test_array)"
|
|
|
|
|
|
|
|
# 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)"
|
2022-09-24 12:21:18 +02:00
|
|
|
|
|
|
|
%post
|
|
|
|
%python_install_alternative pydicom
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative pydicom
|
2016-10-13 21:55:11 +02:00
|
|
|
|
2017-09-11 17:09:39 +02:00
|
|
|
%files %{python_files}
|
2022-09-24 12:21:18 +02:00
|
|
|
%doc README.md
|
2018-08-29 14:15:08 +02:00
|
|
|
%license LICENSE
|
2022-09-24 12:21:18 +02:00
|
|
|
%python_alternative %{_bindir}/pydicom
|
|
|
|
%{python_sitelib}/pydicom*
|
2016-10-13 21:55:11 +02:00
|
|
|
|
|
|
|
%changelog
|