From 7fbde81f37bcd35d97ab53e5c1217ab4be9ad6d096890de59510ae03ab030d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 14 Mar 2020 07:54:30 +0000 Subject: [PATCH] - Fix build without python2 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pickleshare?expand=0&rev=9 --- python-pickleshare.changes | 5 +++++ python-pickleshare.spec | 27 +++++++++++---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/python-pickleshare.changes b/python-pickleshare.changes index 56f2bf8..0298840 100644 --- a/python-pickleshare.changes +++ b/python-pickleshare.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Mar 14 07:54:17 UTC 2020 - Tomáš Chvátal + +- Fix build without python2 + ------------------------------------------------------------------- Tue Dec 4 12:51:30 UTC 2018 - Matej Cepl diff --git a/python-pickleshare.spec b/python-pickleshare.spec index 89c3b5b..a699e21 100644 --- a/python-pickleshare.spec +++ b/python-pickleshare.spec @@ -1,7 +1,7 @@ # # spec file for package python-pickleshare # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# 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 @@ -16,42 +16,40 @@ # -%bcond_without test - %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%bcond_without python2 Name: python-pickleshare Version: 0.7.5 Release: 0 Summary: Tiny shelve-like database with concurrency support License: MIT -Group: Development/Languages/Python -Url: https://github.com/vivainio/pickleshare +URL: https://github.com/vivainio/pickleshare Source: https://files.pythonhosted.org/packages/source/p/pickleshare/pickleshare-%{version}.tar.gz +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes -BuildRequires: python-pathlib2 BuildRequires: python-rpm-macros -%if %{with test} -BuildRequires: %{python_module pytest} +BuildArch: noarch +%if %{with python2} +BuildRequires: python-pathlib2 %endif %ifpython2 Requires: python-pathlib2 %endif -BuildArch: noarch %python_subpackages %description PickleShare - a small 'shelve' like datastore with concurrency support Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike shelve, -many processes can access the database simultaneously. Changing a value in +many processes can access the database simultaneously. Changing a value in database is immediately visible to other processes accessing the same database. Concurrency is possible because the values are stored in separate files. Hence the "database" is a directory where *all* files are governed by PickleShare. This module is certainly not ZODB, but can be used for low-load -(non-mission-critical) situations where tiny code size trumps the +(non-mission-critical) situations where tiny code size trumps the advanced features of a "real" object database. Installation guide: pip install path pickleshare @@ -59,7 +57,7 @@ Installation guide: pip install path pickleshare %prep %setup -q -n pickleshare-%{version} # Remove shebang -sed -i '1{\@^#!/usr/bin/env python@d}' pickleshare.py +sed -i '1{\@^#!%{_bindir}/env python@d}' pickleshare.py %build %python_build @@ -68,12 +66,9 @@ sed -i '1{\@^#!/usr/bin/env python@d}' pickleshare.py %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} -%if %{with test} %check -# need to set locale to avoid UnicodeEncodeError export LANG=en_US.UTF-8 -%python_expand py.test-%{$python_bin_suffix} . -%endif +%pytest . %files %{python_files} %doc README.md