From c628ab5d3738ce072c39136a72c70782d23607f448fa81bd74a0d58beda6ec1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 17 Aug 2020 06:29:06 +0000 Subject: [PATCH] Accepting request 827000 from home:andythe_great Uncertain to why it failed on leap 15.1 Also, did I fix the fromstring warning correctly? Thanks OBS-URL: https://build.opensuse.org/request/show/827000 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-gwyfile?expand=0&rev=1 --- .gitattributes | 23 +++++++++ .gitignore | 1 + Fix_depreciated_fromstring_warning.patch | 12 +++++ gwyfile-0.2.0.tar.gz | 3 ++ python-gwyfile.changes | 4 ++ python-gwyfile.spec | 64 ++++++++++++++++++++++++ 6 files changed, 107 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Fix_depreciated_fromstring_warning.patch create mode 100644 gwyfile-0.2.0.tar.gz create mode 100644 python-gwyfile.changes create mode 100644 python-gwyfile.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Fix_depreciated_fromstring_warning.patch b/Fix_depreciated_fromstring_warning.patch new file mode 100644 index 0000000..13904be --- /dev/null +++ b/Fix_depreciated_fromstring_warning.patch @@ -0,0 +1,12 @@ +diff -ruN a/gwyfile/objects.py b/gwyfile/objects.py +--- a/gwyfile/objects.py 2017-02-20 02:36:19.000000000 +0700 ++++ b/gwyfile/objects.py 2020-08-16 16:39:00.455203869 +0700 +@@ -348,7 +348,7 @@ + } + dtype = typelookup[typecode] + pos, endpos = endpos, endpos + dtype.itemsize * numitems +- data = np.fromstring(buf[pos:endpos], dtype=dtype) ++ data = np.frombuffer(buf[pos:endpos], dtype=dtype) + elif typecode == 'S': + numitems = struct.unpack(' + +- Initial package release. diff --git a/python-gwyfile.spec b/python-gwyfile.spec new file mode 100644 index 0000000..0491666 --- /dev/null +++ b/python-gwyfile.spec @@ -0,0 +1,64 @@ +# +# spec file for package python-gwyfile +# +# Copyright (c) 2020 SUSE LLC +# +# 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 https://bugs.opensuse.org/ +# + + +%define packagename gwyfile +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-gwyfile +Version: 0.2.0 +Release: 0 +Summary: Pure Python implementation of the Gwyddion file format +License: MIT +Group: Development/Languages/Python +URL: https://github.com/tuxu/gwyfile +Source: https://github.com/tuxu/gwyfile/archive/%{version}.tar.gz#/%{packagename}-%{version}.tar.gz +# PATCH-FIX-OPENSUSE Fix_depreciated_fromstring_warning.patch andythe_great@pm.me -- Fix fromstring depreciated to frombuffer warning during testing. +Patch0: Fix_depreciated_fromstring_warning.patch +BuildRequires: %{python_module numpy} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module six} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-numpy +Requires: python-six +BuildArch: noarch +%python_subpackages + +%description +Pure Python implementation of the Gwyddion file format. + +%prep +%autosetup -p1 -n %{packagename}-%{version} + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%doc CHANGELOG.rst README.rst +%license LICENSE.rst +%{python_sitelib}/*egg-info +%{python_sitelib}/%{packagename} + +%changelog