File python-guidata.spec of Package python-guidata

#
# spec file for package python-guidata
#
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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.

# Please submit bugfixes or comments via http://bugs.opensuse.org/


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_with     test
Name:           python-guidata
Version:        1.7.6
Release:        0
License:        CECILL-2.0
Summary:        Generat GUIs for easy dataset editing and display 
Url:            https://github.com/PierreRaybaut/guidata
Group:          Development/Languages/Python
Source:         https://files.pythonhosted.org/packages/source/g/guidata/guidata-%{version}.zip
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module qt5}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  unzip
%if %{with test}
BuildRequires:  %{python_module pytest}
%endif
Requires:       python-qt5
Recommends:     python-h5py
Recommends:     spyder
BuildArch:      noarch

%python_subpackages

%description
Based on the Qt Python binding module PyQt5, guidata is a Python
library generating graphical user interfaces for easy dataset editing
and display. It also provides helpers and application development 
tools for PyQt5.

PyQt4 and pyside are also supported.

%prep
%setup -q -n guidata-%{version}
# Fix wrong file end-of-line encoding
sed -i 's/\r$//' CHANGELOG.md
sed -i 's/\r$//' Licence_CeCILL_V2-en.txt
sed -i 's/\r$//' README.md

%build
%python_build

%install
%python_install
%{python_expand sed -i 's/\r//' %{buildroot}%{$python_sitelib}/guidata/userconfig.py
chmod +x %{buildroot}%{$python_sitelib}/guidata/userconfig.py
sed -i "s|^#!/usr/bin/env python$|#!%__$python|" %{buildroot}%{$python_sitelib}/guidata/userconfig.py
$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/guidata/
$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/guidata/
%fdupes %{buildroot}%{$python_sitelib}
}
rm %{buildroot}%{_bindir}/guidata-tests-py*

%if %{with test}
%check
%python_exec setup.py test
%endif


%files %{python_files}
%defattr(-,root,root,-)
%doc CHANGELOG.md Licence_CeCILL_V2-en.txt README.md
%{python_sitelib}/guidata/
%{python_sitelib}/guidata-%{version}-py*.egg-info

%changelog
openSUSE Build Service is sponsored by