Hello community,

here is the log from the commit of package YODA for openSUSE:Factory checked in 
at 2020-01-21 21:00:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/YODA (Old)
 and      /work/SRC/openSUSE:Factory/.YODA.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "YODA"

Tue Jan 21 21:00:45 2020 rev:16 rq:765934 version:1.8.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/YODA/YODA.changes        2020-01-09 
22:54:47.938835532 +0100
+++ /work/SRC/openSUSE:Factory/.YODA.new.26092/YODA.changes     2020-01-21 
21:01:13.348872926 +0100
@@ -1,0 +2,15 @@
+Sat Jan 18 13:47:23 UTC 2020 - Atri Bhattacharya <[email protected]>
+
+- Add YODA-py3-compatibility-for-IO_pyx.patch -- Py3 compatibilty
+  for IO.pyx; patch taken from upstream commit and modified to fix
+  further similar errors
+  (https://gitlab.com/hepcedar/yoda/issues/4).
+- Change hashbangs referring to python or `env python` to use
+  `/usr/bin/python3` consistently in source dir, rather than
+  from buildroot after installation. This allows to run the tests
+  correctly in the %check section.
+- Move binaries using the python module to python3-%{name}
+  package.
+- Run make check.
+
+-------------------------------------------------------------------

New:
----
  YODA-py3-compatibility-for-IO_pyx.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ YODA.spec ++++++
--- /var/tmp/diff_new_pack.JuGBaX/_old  2020-01-21 21:01:14.676873546 +0100
+++ /var/tmp/diff_new_pack.JuGBaX/_new  2020-01-21 21:01:14.704873559 +0100
@@ -27,11 +27,17 @@
 URL:            http://yoda.hepforge.org/
 Source:         http://www.hepforge.org/archive/yoda/%{name}-%{version}.tar.bz2
 Patch1:         sover.diff
+# PATCH-FIX-UPSTREAM YODA-py3-compatibility-for-IO_pyx.patch 
[email protected] -- Py3 compatibilty for IO.pyx; patch taken from upstream 
commit
+Patch2:         YODA-py3-compatibility-for-IO_pyx.patch
 BuildRequires:  gcc-c++
 BuildRequires:  libtool
 BuildRequires:  pkg-config
 BuildRequires:  python3-Cython
 BuildRequires:  python3-devel
+# SECTION For running python tests in make check
+BuildRequires:  python3-matplotlib
+BuildRequires:  python3-numpy
+# /SECTION
 BuildRequires:  pkgconfig(zlib)
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
@@ -102,6 +108,18 @@
 %prep
 %setup -q
 %patch -P 1 -p1
+%patch2 -p1
+
+# USE PYTHON3 FOR HASHBANGS
+sed -Ei "1{s|/usr/bin/python|/usr/bin/python3|}" bin/*
+sed -Ei "1{s|/usr/bin/env python|/usr/bin/python3|}" bin/*
+sed -Ei "1{s|/usr/bin/env python|/usr/bin/python3|}" tests/pytest-*
+
+# FIX env BASED HASHBANGS
+sed -E -i "s|^#! /usr/bin/env bash|#! /bin/bash|" bin/yoda-config*
+
+# REMOVE AN UNNECESSARY ONE
+sed -E -i "1{s|^#! /usr/bin/env python||}" pyext/yoda/search.py
 
 %build
 export PYTHON_VERSION=%{py3_ver}
@@ -114,15 +132,8 @@
 
 find %{buildroot}%{_libdir}/ -name "*.la" -delete
 
-# FIX env BASED HASHBANGS
-for exe in %{buildroot}%{_bindir}/*
-do
-  sed -E -i "s|^#! /usr/bin/env python|#! /usr/bin/python|" ${exe}
-done
-sed -E -i "s|^#! /usr/bin/env bash|#! /bin/bash|" 
%{buildroot}%{_bindir}/yoda-config
-
-# REMOVE AN UNNECESSARY ONE
-sed -E -i "1{s|^#! /usr/bin/env python||}" 
%{buildroot}%{python3_sitearch}/yoda/search.py
+%check
+make %{?_smp_mflags} check
 
 %post   -n %{so_name} -p /sbin/ldconfig
 %postun -n %{so_name} -p /sbin/ldconfig
@@ -135,13 +146,23 @@
 %defattr(-,root,root)
 %doc AUTHORS ChangeLog
 %license COPYING
+%{_bindir}/yoda-config
+%{_libdir}/libYODA.so
+%{_libdir}/pkgconfig/yoda.pc
+%{_includedir}/%{name}/
+%{_datadir}/%{name}/
+
+%files -n python3-%{name}
+%defattr(-,root,root)
+%{python3_sitearch}/yoda/
+%{python3_sitearch}/yoda1/
+%{python3_sitearch}/yoda*.egg-info
 %{_bindir}/aida2flat
 %{_bindir}/aida2yoda
 %{_bindir}/flat2yoda
 %{_bindir}/yoda2aida
 %{_bindir}/yoda2flat
 %{_bindir}/yoda2yoda
-%{_bindir}/yoda-config
 %{_bindir}/yodamerge
 %{_bindir}/yodacmp
 %{_bindir}/yodacnv
@@ -150,15 +171,5 @@
 %{_bindir}/yodals
 %{_bindir}/yodaplot
 %{_bindir}/yodascale
-%{_libdir}/libYODA.so
-%{_libdir}/pkgconfig/yoda.pc
-%{_includedir}/%{name}/
-%{_datadir}/%{name}/
-
-%files -n python3-%{name}
-%defattr(-,root,root)
-%{python3_sitearch}/yoda/
-%{python3_sitearch}/yoda1/
-%{python3_sitearch}/yoda*.egg-info
 
 %changelog

++++++ YODA-py3-compatibility-for-IO_pyx.patch ++++++
>From c4ef6691606b33868b226fdd504bb081d0fcf11f Mon Sep 17 00:00:00 2001
From: Christian Gutschow <[email protected]>
Date: Sat, 21 Dec 2019 23:31:32 +0100
Subject: [PATCH] patch Py3 compatibilty for IO.pyx

---
 pyext/yoda/include/IO.pyx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: YODA-1.8.0/pyext/yoda/include/IO.pyx
===================================================================
--- YODA-1.8.0.orig/pyext/yoda/include/IO.pyx
+++ YODA-1.8.0/pyext/yoda/include/IO.pyx
@@ -215,7 +215,7 @@ def writeYODA(ana_objs, file_or_filename
     for a in aolist:
         vec.push_back(a._AnalysisObject())
     if type(file_or_filename) is str:
-        c.WriterYODA_create().write_to_file(file_or_filename, vec)
+        c.WriterYODA_create().write_to_file(file_or_filename.encode('utf-8'), 
vec)
     else:
         c.WriterYODA_create().write(oss, vec)
         _str_to_file(oss.str(), file_or_filename)
@@ -233,7 +233,7 @@ def writeFLAT(ana_objs, file_or_filename
     for a in aolist:
         vec.push_back(a._AnalysisObject())
     if type(file_or_filename) is str:
-        c.WriterFLAT_create().write_to_file(file_or_filename, vec)
+        c.WriterFLAT_create().write_to_file(file_or_filename.encode('utf-8'), 
vec)
     else:
         c.WriterFLAT_create().write(oss, vec)
         _str_to_file(oss.str(), file_or_filename)
@@ -251,7 +251,7 @@ def writeAIDA(ana_objs, file_or_filename
     for a in aolist:
         vec.push_back(a._AnalysisObject())
     if type(file_or_filename) is str:
-        c.WriterAIDA_create().write_to_file(file_or_filename, vec)
+        c.WriterAIDA_create().write_to_file(file_or_filename.encode('utf-8'), 
vec)
     else:
         c.WriterAIDA_create().write(oss, vec)
         _str_to_file(oss.str(), file_or_filename)

Reply via email to