commit 04188522096557abef9d414956fb096b73b6b6dbcdac327045f769e91e1d59ca Author: Todd R Date: Thu Jul 25 20:16:04 2019 +0000 Accepting request 718633 from home:TheBlackCat:branches:devel:languages:python:numeric Package to read and write statistical data files into pandas OBS-URL: https://build.opensuse.org/request/show/718633 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pyreadstat?expand=0&rev=1 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_no_return_in_nonvoid_function.patch b/fix_no_return_in_nonvoid_function.patch new file mode 100644 index 0000000..c8e3ca1 --- /dev/null +++ b/fix_no_return_in_nonvoid_function.patch @@ -0,0 +1,46 @@ +From 54a9fdf3470d50100694c27aa338568fa1bd5e65 Mon Sep 17 00:00:00 2001 +From: Todd +Date: Thu, 25 Jul 2019 14:54:33 -0400 +Subject: [PATCH] Make sure non-void function returns a value + +`_close` is an `int` type function, so it should return an `int` rather than returning nothing. Otherwise you end up with a `no-return-in-nonvoid-function` issue. +--- + pyreadstat/conditional_includes.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/pyreadstat/conditional_includes.h b/pyreadstat/conditional_includes.h +index 5b6a938..0c09473 100644 +--- a/pyreadstat/conditional_includes.h ++++ b/pyreadstat/conditional_includes.h +@@ -31,6 +31,6 @@ + int _SH_DENYRD; + int _SH_DENYNO; + void assign_fd(void *io_ctx, int fd){}; +- int _close(int fd){}; ++ int _close(int fd){ return 0; }; + + #endif + + +From d915fc6df2d0832e5a7750ba8bf99954f2cab039 Mon Sep 17 00:00:00 2001 +From: Todd +Date: Thu, 25 Jul 2019 16:07:17 -0400 +Subject: [PATCH 3/3] Fix another nonvoid function + +--- + pyreadstat/conditional_includes.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyreadstat/conditional_includes.h b/pyreadstat/conditional_includes.h +index 05b7e4c..e60f1d7 100644 +--- a/pyreadstat/conditional_includes.h ++++ b/pyreadstat/conditional_includes.h +@@ -20,7 +20,7 @@ + + //int open(const char *path, int oflag, int mode); + //int close(int fd); +- int _wsopen(const wchar_t *filename, int oflag, int shflag, int pmode){}; ++ int _wsopen(const wchar_t *filename, int oflag, int shflag, int pmode){ return 0; }; + int _O_RDONLY; + int _O_BINARY; + int _O_WRONLY; diff --git a/pyreadstat-0.2.7.tar.gz b/pyreadstat-0.2.7.tar.gz new file mode 100644 index 0000000..feb243e --- /dev/null +++ b/pyreadstat-0.2.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c7a8088fee341919406cc62102b8d04b3a26ef279216d193fde6b097ebe19c4 +size 14352223 diff --git a/python-pyreadstat.changes b/python-pyreadstat.changes new file mode 100644 index 0000000..5d642f8 --- /dev/null +++ b/python-pyreadstat.changes @@ -0,0 +1,7 @@ +------------------------------------------------------------------- +Mon Jul 22 15:48:26 UTC 2019 - Todd R + +- Initial version +- Add fix_no_return_in_nonvoid_function.patch + to fix no-return-in-nonvoid-function error + From gh#Roche/pyreadstat#36 diff --git a/python-pyreadstat.spec b/python-pyreadstat.spec new file mode 100644 index 0000000..e75ba58 --- /dev/null +++ b/python-pyreadstat.spec @@ -0,0 +1,74 @@ +# +# spec file for package python-pyreadstat +# +# Copyright (c) 2019 SUSE LINUX 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-%{**}} +Name: python-pyreadstat +Version: 0.2.7 +Release: 0 +License: Apache-2.0 +Summary: Package to read and write statistical data files into pandas +Url: https://github.com/Roche/pyreadstat +Group: Development/Languages/Python +Source: https://codeload.github.com/Roche/pyreadstat/tar.gz/v%{version}#/pyreadstat-%{version}.tar.gz +# PATCH-FEATURE-UPSTREAM fix_no_return_in_nonvoid_function.patch -- gh#Roche/pyreadstat#36 +Patch0: fix_no_return_in_nonvoid_function.patch +BuildRequires: %{python_module devel} +BuildRequires: %{python_module numpy-devel} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: glibc-devel +BuildRequires: python-rpm-macros +BuildRequires: zlib-devel +# SECTION test requirements +BuildRequires: %{python_module pandas} +# /SECTION +Requires: python-numpy +Requires: python-pandas + +%python_subpackages + +%description +Reads and Writes SAS, SPSS and Stata files into pandas data frames. + +%prep +%setup -q -n pyreadstat-%{version} +%patch0 -p1 + +%build +export CFLAGS="%{optflags} -fno-strict-aliasing" +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitearch} + +%check +mv pyreadstat pyreadstat_temp +rm -rf build _build.* +export PYTHONDONTWRITEBYTECODE=1 +%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch} +rm -rf build _build.* +$python -B tests/test_basic.py +} +mv pyreadstat_temp pyreadstat + +%files %{python_files} +%doc README.md change_log.md +%license LICENSE +%{python_sitearch}/* + +%changelog