summaryrefslogtreecommitdiff
path: root/dev-python/pip/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-05-30 11:44:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-05-30 11:44:06 +0100
commitf516638b7fe9592837389826a6152a7e1b251c54 (patch)
tree8bfecb640b7b6403d7a3d662d923eed630033da7 /dev-python/pip/files
parent1a61119f9f7b057830e2ce0563f913ec86f282ad (diff)
gentoo resync : 30.05.2020
Diffstat (limited to 'dev-python/pip/files')
-rw-r--r--dev-python/pip/files/pip-19.3.1-disable-system-install.patch17
-rw-r--r--dev-python/pip/files/pip-20.1.1-test-endian.patch78
2 files changed, 78 insertions, 17 deletions
diff --git a/dev-python/pip/files/pip-19.3.1-disable-system-install.patch b/dev-python/pip/files/pip-19.3.1-disable-system-install.patch
deleted file mode 100644
index 70583957bd74..000000000000
--- a/dev-python/pip/files/pip-19.3.1-disable-system-install.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-install: Raise an error to avoid breaking python-exec
-
-Running pip without --target, --root, or --user will result in packages
-being installed systemwide. This has a tendency to break python-exec if
-setuptools gets installed or upgraded.
-
---- pip-19.1/src/pip/_internal/commands/install.py
-+++ pip-19.1/src/pip/_internal/commands/install.py
-@@ -246,6 +246,9 @@ class InstallCommand(RequirementCommand):
- if options.upgrade:
- upgrade_strategy = options.upgrade_strategy
-
-+ if not any((options.use_user_site, options.target_dir, options.root_path, options.prefix_path)):
-+ raise CommandError("(Gentoo) Please run pip with the --user option to avoid breaking python-exec")
-+
- if options.build_dir:
- options.build_dir = os.path.abspath(options.build_dir)
diff --git a/dev-python/pip/files/pip-20.1.1-test-endian.patch b/dev-python/pip/files/pip-20.1.1-test-endian.patch
new file mode 100644
index 000000000000..b6aea145656f
--- /dev/null
+++ b/dev-python/pip/files/pip-20.1.1-test-endian.patch
@@ -0,0 +1,78 @@
+From b30dd1e04e1f37901733f1be0a5a1e02c466ad0c Mon Sep 17 00:00:00 2001
+From: gutsytechster <prashantsharma161198@gmail.com>
+Date: Wed, 15 Apr 2020 19:54:48 +0530
+Subject: [PATCH] fix(tests/unit): Update tests to be endian safe
+
+This updates `test_path_to_display` and `test_str_to_display__encoding`
+to use the endian safe expected result instead of the hardcoded one.
+
+This fixes https://github.com/pypa/pip/issues/7921
+---
+ tests/unit/test_compat.py | 8 +++++++-
+ tests/unit/test_utils.py | 16 +++++++++++++---
+ 2 files changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/tests/unit/test_compat.py b/tests/unit/test_compat.py
+index 1f31bc5c..b13087a1 100644
+--- a/tests/unit/test_compat.py
++++ b/tests/unit/test_compat.py
+@@ -2,6 +2,7 @@
+
+ import locale
+ import os
++import sys
+
+ import pytest
+
+@@ -91,8 +92,13 @@ def test_str_to_display__decode_error(monkeypatch, caplog):
+ # Encode with an incompatible encoding.
+ data = u'ab'.encode('utf-16')
+ actual = str_to_display(data)
++ # Keep the expected value endian safe
++ if sys.byteorder == "little":
++ expected = "\\xff\\xfea\x00b\x00"
++ elif sys.byteorder == "big":
++ expected = "\\xfe\\xff\x00a\x00b"
+
+- assert actual == u'\\xff\\xfea\x00b\x00', (
++ assert actual == expected, (
+ # Show the encoding for easier troubleshooting.
+ 'encoding: {!r}'.format(locale.getpreferredencoding())
+ )
+diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py
+index 7d74a664..ebabd29e 100644
+--- a/tests/unit/test_utils.py
++++ b/tests/unit/test_utils.py
+@@ -375,6 +375,18 @@ def test_rmtree_retries_for_3sec(tmpdir, monkeypatch):
+ rmtree('foo')
+
+
++if sys.byteorder == "little":
++ expected_byte_string = (
++ u"b'\\xff\\xfe/\\x00p\\x00a\\x00t\\x00h\\x00/"
++ "\\x00d\\x00\\xe9\\x00f\\x00'"
++ )
++elif sys.byteorder == "big":
++ expected_byte_string = (
++ u"b'\\xfe\\xff\\x00/\\x00p\\x00a\\x00t\\x00h\\"
++ "x00/\\x00d\\x00\\xe9\\x00f'"
++ )
++
++
+ @pytest.mark.parametrize('path, fs_encoding, expected', [
+ (None, None, None),
+ # Test passing a text (unicode) string.
+@@ -383,9 +395,7 @@ def test_rmtree_retries_for_3sec(tmpdir, monkeypatch):
+ (u'/path/déf'.encode('utf-8'), 'utf-8', u'/path/déf'),
+ # Test a bytes object with a character that can't be decoded.
+ (u'/path/déf'.encode('utf-8'), 'ascii', u"b'/path/d\\xc3\\xa9f'"),
+- (u'/path/déf'.encode('utf-16'), 'utf-8',
+- u"b'\\xff\\xfe/\\x00p\\x00a\\x00t\\x00h\\x00/"
+- "\\x00d\\x00\\xe9\\x00f\\x00'"),
++ (u'/path/déf'.encode('utf-16'), 'utf-8', expected_byte_string),
+ ])
+ def test_path_to_display(monkeypatch, path, fs_encoding, expected):
+ monkeypatch.setattr(sys, 'getfilesystemencoding', lambda: fs_encoding)
+--
+2.26.2
+