- Update to 1.5.0:

* More specific error when failing to create XDG fallback trash directory (#20)
  * Windows: Workaround for long paths (#23)
- Add patch to test properly under python2:
  * python2.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Send2Trash?expand=0&rev=7
This commit is contained in:
Tomáš Chvátal 2019-03-06 10:43:29 +00:00 committed by Git OBS Bridge
parent dfc65d9882
commit ba84b74220
5 changed files with 47 additions and 11 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:55e70d96b61a6c05911c96bb14ef313d5dc70d3e0197929dcc868870b58a1196
size 6068

3
Send2Trash-1.5.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:60001cc07d707fe247c94f74ca6ac0d3255aabcb930529690897ca2a39db28b2
size 10892

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Mar 6 10:34:17 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 1.5.0:
* More specific error when failing to create XDG fallback trash directory (#20)
* Windows: Workaround for long paths (#23)
- Add patch to test properly under python2:
* python2.patch
-------------------------------------------------------------------
Wed Dec 19 00:27:32 UTC 2018 - Jan Engelhardt <jengelh@inai.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-Send2Trash
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# 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
@ -18,20 +18,21 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# test scripts missing
%bcond_with test
%define oldpython python
Name: python-Send2Trash
Version: 1.4.1
Version: 1.5.0
Release: 0
Summary: Python library to send files to the Trash location
License: BSD-3-Clause
Group: Development/Languages/Python
Url: https://github.com/hsoft/send2trash
Source: https://files.pythonhosted.org/packages/source/S/Send2Trash/Send2Trash-%{version}.tar.gz
Patch0: python2.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Recommends: python-gobject
Requires: typelib(GObject)
Requires: typelib(Gio)
%ifpython2
Obsoletes: %{oldpython}-send2trash < %{version}
Provides: %{oldpython}-send2trash = %{version}
@ -51,6 +52,7 @@ freedesktop.org.
%prep
%setup -q -n Send2Trash-%{version}
%patch0 -p1
%build
%python_build
@ -59,13 +61,12 @@ freedesktop.org.
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with test}
%check
%python_exec setup.py test
%endif
export LANG=en_US.UTF8
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m unittest discover
%files %{python_files}
%defattr(-,root,root,-)
%license LICENSE
%doc CHANGES.rst README.rst
%{python_sitelib}/*

26
python2.patch Normal file
View File

@ -0,0 +1,26 @@
From 74352462f5df2cb5708b96458b81afef3070c800 Mon Sep 17 00:00:00 2001
From: Virgil Dupras <hsoft@hardcoded.net>
Date: Thu, 26 Jul 2018 08:30:39 -0400
Subject: [PATCH] Fix broken tests on py2
---
tests/test_plat_other.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/test_plat_other.py b/tests/test_plat_other.py
index b94295d..ae4f391 100644
--- a/tests/test_plat_other.py
+++ b/tests/test_plat_other.py
@@ -6,7 +6,11 @@
import send2trash.plat_other
from send2trash.plat_other import send2trash as s2t
from send2trash.compat import PY3
-from configparser import ConfigParser
+try:
+ from configparser import ConfigParser
+except ImportError:
+ # py2
+ from ConfigParser import ConfigParser
from tempfile import mkdtemp, NamedTemporaryFile, mktemp
import shutil
import stat