14
0
forked from pool/python-vistir

Accepting request 701030 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/701030
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-vistir?expand=0&rev=3
This commit is contained in:
2019-05-12 09:34:12 +00:00
committed by Git OBS Bridge
8 changed files with 28 additions and 178 deletions

View File

@@ -1,23 +0,0 @@
From a50e4effe9a4a729c46fef8d1e16c7909b75a132 Mon Sep 17 00:00:00 2001
From: John Vandenberg <jayvdb@gmail.com>
Date: Sun, 10 Mar 2019 11:01:21 +0700
Subject: [PATCH] Set colorama minimum version 0.3.4
Fixes https://github.com/sarugaku/vistir/issues/67
---
setup.cfg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.cfg b/setup.cfg
index 594ed5c..a19cb5e 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -37,7 +37,7 @@ setup_requires =
parver
wheel
install_requires =
- colorama
+ colorama>=0.3.4
backports.functools_lru_cache;python_version<="3.4"
backports.shutil_get_terminal_size;python_version<"3.3"
backports.weakref;python_version<"3.3"

View File

@@ -1,82 +0,0 @@
From 72e90d9aad81f66626f0913b7cb0a0ddd44483ae Mon Sep 17 00:00:00 2001
From: John Vandenberg <jayvdb@gmail.com>
Date: Sun, 10 Mar 2019 01:07:52 +0700
Subject: [PATCH] compat: Remove backports from Python 3.4
Remove complex version markers and runtime version checking
for unsupported versions between Python 2.7 and Python 3.4+.
The logic was wrong, requiring backports.functools_lru_cache
on Python 3.4 when the stdlib function was acceptable.
Fixes https://github.com/sarugaku/vistir/issues/63
---
setup.cfg | 6 +++---
src/vistir/compat.py | 28 +++++++++++-----------------
2 files changed, 14 insertions(+), 20 deletions(-)
diff --git a/setup.cfg b/setup.cfg
index 636788d..c3f39b0 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -38,9 +38,9 @@ setup_requires =
wheel
install_requires =
colorama>=0.3.4
- backports.functools_lru_cache;python_version<="3.4"
- backports.shutil_get_terminal_size;python_version<"3.3"
- backports.weakref;python_version<"3.3"
+ backports.functools_lru_cache;python_version=="2.7"
+ backports.shutil_get_terminal_size;python_version=="2.7"
+ backports.weakref;python_version=="2.7"
pathlib2;python_version<"3.5"
requests
six
diff --git a/src/vistir/compat.py b/src/vistir/compat.py
index b99f420..a1789e6 100644
--- a/src/vistir/compat.py
+++ b/src/vistir/compat.py
@@ -42,33 +42,27 @@
if sys.version_info >= (3, 5):
from pathlib import Path
- from functools import lru_cache
else:
from pathlib2 import Path
- from backports.functools_lru_cache import lru_cache
-
-if sys.version_info < (3, 3):
- from backports.shutil_get_terminal_size import get_terminal_size
-
- NamedTemporaryFile = _NamedTemporaryFile
-else:
+if six.PY3:
+ # Only Python 3.4+ is supported
+ from functools import lru_cache, partialmethod
from tempfile import NamedTemporaryFile
from shutil import get_terminal_size
-
-try:
from weakref import finalize
-except ImportError:
- from backports.weakref import finalize # type: ignore
-
-try:
- from functools import partialmethod
-except Exception:
+else:
+ # Only Python 2.7 is supported
+ from backports.functools_lru_cache import lru_cache
from .backports.functools import partialmethod # type: ignore
+ from backports.shutil_get_terminal_size import get_terminal_size
+ NamedTemporaryFile = _NamedTemporaryFile
+ from backports.weakref import finalize # type: ignore
try:
+ # Introduced Python 3.5
from json import JSONDecodeError
-except ImportError: # Old Pythons.
+except ImportError:
JSONDecodeError = ValueError # type: ignore
if six.PY2:

View File

@@ -1,40 +0,0 @@
From 7eb17a32c70fb0e2f2ea1754303df1f4bd46c2d1 Mon Sep 17 00:00:00 2001
From: John Vandenberg <jayvdb@gmail.com>
Date: Thu, 7 Mar 2019 18:35:48 +0700
Subject: [PATCH] cursor.py: Remove unnecessary loading of libffi
---
src/vistir/cursor.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/vistir/cursor.py b/src/vistir/cursor.py
index 22d643e..0c1b4c2 100644
--- a/src/vistir/cursor.py
+++ b/src/vistir/cursor.py
@@ -1,19 +1,21 @@
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function
-import ctypes
import os
import sys
__all__ = ["hide_cursor", "show_cursor"]
-class CONSOLE_CURSOR_INFO(ctypes.Structure):
- _fields_ = [("dwSize", ctypes.c_int), ("bVisible", ctypes.c_int)]
+if os.name == 'nt':
+ import ctypes
+ class CONSOLE_CURSOR_INFO(ctypes.Structure):
+ _fields_ = [("dwSize", ctypes.c_int), ("bVisible", ctypes.c_int)]
-WIN_STDERR_HANDLE_ID = ctypes.c_ulong(-12)
-WIN_STDOUT_HANDLE_ID = ctypes.c_ulong(-11)
+
+ WIN_STDERR_HANDLE_ID = ctypes.c_ulong(-12)
+ WIN_STDOUT_HANDLE_ID = ctypes.c_ulong(-11)
def get_stream_handle(stream=sys.stdout):

View File

@@ -1,23 +0,0 @@
From 02d68f380275e149d02442274b878172da4741ce Mon Sep 17 00:00:00 2001
From: John Vandenberg <jayvdb@gmail.com>
Date: Fri, 8 Mar 2019 21:54:00 +0700
Subject: [PATCH] rmtree: import FileNotFoundError from compat
FileNotFoundError does not exist on Python 2.
---
src/vistir/path.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vistir/path.py b/src/vistir/path.py
index d551aac..adddd01 100644
--- a/src/vistir/path.py
+++ b/src/vistir/path.py
@@ -331,7 +331,7 @@ def rmtree(directory, ignore_errors=False, onerror=None):
Setting `ignore_errors=True` may cause this to silently fail to delete the path
"""
-
+ from .compat import FileNotFoundError
directory = fs_encode(directory)
if onerror is None:
onerror = handle_remove_readonly

View File

@@ -1,3 +1,26 @@
-------------------------------------------------------------------
Mon May 6 09:37:57 UTC 2019 - pgajdos@suse.com
- version update to 0.4.0
- Fixed a bug which caused test failures due to generated paths on
*nix based operating systems which were too long.
`#65 <https://github.com/sarugaku/vistir/issues/65>`_
- Fixed a bug which caused spinner output to sometimes attempt to
double encode on python 2, resulting in failed output encoding.
`#69 <https://github.com/sarugaku/vistir/issues/69>`_
- Fixed an issue where paths could sometimes fail to be fs-encoded
properly when using backported ``NamedTemporaryFile`` instances.
`#74 <https://github.com/sarugaku/vistir/issues/74>`_
- Fixed a bug in ``vistir.misc.locale_encoding`` which caused
invocation of a non-existent method called ``getlocaleencoding``
which forced all systems to use default encoding of ``ascii``.
`#78 <https://github.com/sarugaku/vistir/issues/78>`_
- deleted patches
- merged_pr_68-colorama-pin.patch (upstreamed)
- merged_pr_75-backport-pins.patch (upstreamed)
- no-ffi.patch (upstreamed)
- py27-missing-exception.patch (upstreamed)
-------------------------------------------------------------------
Tue Apr 2 15:51:35 UTC 2019 - John Vandenberg <jayvdb@gmail.com>

View File

@@ -18,17 +18,13 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-vistir
Version: 0.3.1
Version: 0.4.0
Release: 0
Summary: Utilities for filesystems, paths, projects, subprocesses, and more
License: ISC
Group: Development/Languages/Python
URL: https://github.com/sarugaku/vistir
Source: https://github.com/sarugaku/vistir/archive/%{version}.tar.gz#/vistir-%{version}.tar.gz
Patch0: https://patch-diff.githubusercontent.com/raw/sarugaku/vistir/pull/61.patch#/no-ffi.patch
Patch1: https://patch-diff.githubusercontent.com/raw/sarugaku/vistir/pull/62.patch#/py27-missing-exception.patch
Patch2: https://patch-diff.githubusercontent.com/raw/sarugaku/vistir/pull/68.patch#/merged_pr_68-colorama-pin.patch
Patch3: https://patch-diff.githubusercontent.com/raw/sarugaku/vistir/pull/75.patch#/merged_pr_75-backport-pins.patch
BuildRequires: %{python_module setuptools >= 38.2.5}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -65,9 +61,8 @@ subprocesses, and more.
%prep
%setup -q -n vistir-%{version}
%autopatch -p1
sed -i '/invoke/d;/parver/d;/wheel$/d' setup.cfg
sed -i '/invoke/d;/parver/d;/wheel$/d;/addopts/d' setup.cfg
rm -r tasks
%build

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:283e777366cc0be27fe604194ec5381b40f6beb196e74eb4145cf56bae1ad0e3
size 72674

3
vistir-0.4.0.tar.gz Normal file
View File

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