diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-12-15 18:09:03 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-12-15 18:09:03 +0000 |
commit | 7bc9c63c9da678a7e6fceb095d56c634afd22c56 (patch) | |
tree | 4a67d50a439e9af63947e5f8b6ba3719af98b6c9 /dev-python/pip | |
parent | b284a3168fa91a038925d2ecf5e4791011ea5e7d (diff) |
gentoo resync : 15.12.2019
Diffstat (limited to 'dev-python/pip')
-rw-r--r-- | dev-python/pip/Manifest | 9 | ||||
-rw-r--r-- | dev-python/pip/files/pip-19.3.1-disable-system-install.patch | 17 | ||||
-rw-r--r-- | dev-python/pip/files/pip-19.3.1-network-tests.patch | 66 | ||||
-rw-r--r-- | dev-python/pip/files/pip-19.3.1-r2-disable-system-install.patch | 17 | ||||
-rw-r--r-- | dev-python/pip/pip-19.1.ebuild | 2 | ||||
-rw-r--r-- | dev-python/pip/pip-19.3.1-r1.ebuild | 114 | ||||
-rw-r--r-- | dev-python/pip/pip-19.3.1-r2.ebuild | 133 | ||||
-rw-r--r-- | dev-python/pip/pip-19.3.1.ebuild | 2 |
8 files changed, 356 insertions, 4 deletions
diff --git a/dev-python/pip/Manifest b/dev-python/pip/Manifest index bc05f76310f8..04d00b271a7a 100644 --- a/dev-python/pip/Manifest +++ b/dev-python/pip/Manifest @@ -1,6 +1,9 @@ AUX pip-19.1-disable-system-install.patch 795 BLAKE2B 03cf006ae4482d530a614d4e0b9b5420d924835c88118ea895bbd7db69faa07867d255585fe9b49ea6d81d9689324f1a4844bd2badf3a1304ad748db6c2d6aeb SHA512 fe6bd65e73ed389173b636e339c58de58a96ca6c6dece93e8e5c3178d0c1fcbe2aa5019efba34831b54b09aed956a186604f44da7a50026ec3bf5fad425eaf87 AUX pip-19.1-disable-version-check.patch 782 BLAKE2B 3dbd3472396edd592d79b418c0c76a2d71cde8557e2c5598bc061c618a7f0028fb086afb7e28e5c051075b65abc65e3568d3ac0c85335d0f8a3db6ad44795ad2 SHA512 ad65449df3e68e406052e21b6349d897dd988a0a257f4ee92032b8c0607807a4427e04d22b32bbef12b3607364299f8521d3c5a6774e32886a665b315b0b6779 AUX pip-19.3-disable-version-check.patch 872 BLAKE2B b0398674f56b78a066c4308f0a8ee0272c5c4c3cb569e6c300ac62fc9fbe8ec2a1bfe257047c15ddcf9cc44c47b7f8b9ab99e17b722bd6ae4cf9dc2a168e01d6 SHA512 1ece773f66556e4380eabf76490430e8fbec23f7cfad27dac02c7e49f7136b632515ef04843e89dfae42c095dbf5280d64e61da1544801c998f802aa59be8e22 +AUX pip-19.3.1-disable-system-install.patch 809 BLAKE2B e3a6027922291efe4d1603cb730a9b6aaf653692bc176fd9eea5b804f3d10c419317e9caa97673c02533d4072baf99439af4f76bd38dd5c2ddb98a234ea32c91 SHA512 cf5418444c1a39716b0e528f0630ef931cdd0a4890d16801a575a5072600eb15195d0c0c67e711290e5ed6c7fc40da3f2fd3e5993c638f152240e0ee6f895ac0 +AUX pip-19.3.1-network-tests.patch 2436 BLAKE2B bb4397074428c2fa0729380ee30e3e67be09871d592df1012937db495a79ffcbd92b534d48c8b459cd6f3ddd30e363f14961511fc8574d438cb5a8acc7b64f20 SHA512 ec3ca2a8381cdca5d8952803389837070b235b08c9df7985e4ffc4f78e83defb9284480fdee439fd42b86d0de5574c707c1de72b230742fee39ce7b8a57a066b +AUX pip-19.3.1-r2-disable-system-install.patch 835 BLAKE2B 11a8b86f57619b87d090e6f02c0e623f33e2bbae6b5b16acebc34c9205c53d8221ec98e99167e26eb789d3fbf075406bbdba6dc74c120288fea2d0bcd98beeec SHA512 eb2fb10828aca4a1179f8763c63d861f547e2d92da32c7fd697863e26583eba4f1b0d76a820a82afe3803a6ea22c61b01d3fd98291ec5cff4700855294b19286 AUX pip-9.0.1-disable-version-check.patch 1031 BLAKE2B 148e528aab19de021f193ac56d758c803e0875b618ee32e948eb103eb6b05eb56e2ecf5ed4dbe39893f5c44ddee17122fdd686f433f5ce89044b2c02291e0ba1 SHA512 8b5764d3ecdbfc871bdf051b41d9610d5028bc3b95a4bf990db46325d10e5d559449ec97ab052686148d6ab6abfa630fb38101c726b6648d19fa94ac593b0a28 AUX pip-disable-system-install.patch 1070 BLAKE2B 85bfd82888a169cf771467f4f811b9859fddc1cfd134ac21be42b9fd93d84118354fa23a2f4b0ec9c67024f571ba7035665302671420221b52f3fc89f24b1af3 SHA512 bb0a9a32b2eac0a12276c3f0527534226c03868300f54945d20eec16902ad51cbfdace9d79b0caa304bc641323194031a5ca9e5e784366a44527441bd0f3c231 DIST pip-19.1.tar.gz 6320747 BLAKE2B 9b69fcdef751d6938a7c67f44692afa7088f660ab1e0ae113d21d0f48b4e29f43e0f0bcc137cf16ac0324ea3b500bd2a84234823f8d82556d6727f68139aab4b SHA512 0d2442c22c41133118353ba98f45260f0615a891725b2a069d8fbf26ec4033cc7297bb671944c3dcc1f68800b91e92e58fb407ca5a333382e20ac4bb5c9e0cb6 @@ -10,8 +13,10 @@ DIST setuptools-41.0.1-py2.py3-none-any.whl 575966 BLAKE2B 332986453a35e4ec36ab2 DIST setuptools-41.4.0-py2.py3-none-any.whl 580302 BLAKE2B 58dc2d48445406f7467bfb0934dc507e8a569e4759bfcc95287cfb21b5b1a7bcab061656a29a8b4976ee3ae12a3adca570035ae4a6d9df09ae7a799857775d36 SHA512 a27b38d596931dfef81d705d05689b7748ce0e02d21af4a37204fc74b0913fa7241b8135535eb7749f09af361cad90c475af98493fef11c4ad974780ee01243d DIST wheel-0.33.1-py2.py3-none-any.whl 21496 BLAKE2B 41bb9ed91d43f94209a010c286d541da9d68b9e727ec8a339fe3c24fb806746b1de5b62c6cd26d2c2841be17406e1f99353b6d172f5258540faeba014945e9e8 SHA512 761ad8cb96557b146642871e1f8ce75849a9828193d992a19d072236b9f8452ab54907a3b82bc7441f75f036155ae21b7450120e0c4c19aa5100b58337945ac0 DIST wheel-0.33.6-py2.py3-none-any.whl 21556 BLAKE2B 6b6124c1e8e70592399a90c88b2a70efc5885bad81d2ff07a2e243eee008ba5cb0c927454036915a61e97489e29fe1abc4ba2e63d7eadf1a8985c8a8b7cdf4c4 SHA512 4663cd55ee9d3de138216bb06870606b546b19cb6a733f1beab211c0ba72e63d849c422d320ddc8aa8275ad04a30119a84c1351e589150cd18c2a34f9fdb224a -EBUILD pip-19.1.ebuild 3465 BLAKE2B 647982e0fa28779940255e9869b94521319c01559fc92f521b394cfb88e19719f0b069bb226a1c3add8186554456626ed323b429948deab3fa334614331a3c4f SHA512 89a138a6cb171b7e0e9ea60387038ebd7d515a627d9e9ba121dd55ddc60822da295e6718dbd75d63a91bf5a6c30d685524c2162a1ef801d387ea8a1a1f284b05 -EBUILD pip-19.3.1.ebuild 4013 BLAKE2B c92d4c8df5e7405b549e571935472865e9267c05b3eae3ab85a4767889df1df0c90300bfedd2ad40e53982d36d4b879fb391c45f14203801fbd98999461f1fdc SHA512 1623cd813a364a89223c86526b999d539db3e7081296b65c5bce07d86d98f540a28191bd27dbf209473bae285c8bd8f3aae9b1da9c4675f8770b602b8356d59e +EBUILD pip-19.1.ebuild 3481 BLAKE2B 760de9a795075cdc4a2c14a570d821f653e471864da78fe87705802aca9f053168ce0a64b86155c71812359f33e2d1bc5be38b08eb0032fb71332e08ec57e324 SHA512 2fc882c9d65b9cd8b1d60fb5e89d2c9e23849f15fd33cf4ae8f4aee2398e71789e2221c040be80afd2bdb53b1f7a62d0a8f630d15e6843030fbf71d5a18d35fd +EBUILD pip-19.3.1-r1.ebuild 3850 BLAKE2B 95e9b44d0b2cf318212f269c4733d93412e22c2b68485a599a9482233530e1362013653aa71afe2b495b0e277698eb909887858c27c875278c536119d71eb51b SHA512 0bbe5cf7c753a0c63b25f93849509fa04028f05384d6ecb836659f719767d7e5246b578e4dfe9d0c54a942aa7c5c297a63a25ca4dcb1067d785c5f9eadd8ef7d +EBUILD pip-19.3.1-r2.ebuild 3815 BLAKE2B 0164eb3c3245c29ee00200bdaae841745ff09f1a6e5cfb7688b2b517f01a2c6be509b24a5e3658a738094e244ef8f6fd9d8f55880bedfb03532e3d033c2bd952 SHA512 5f9e32098270620af2fe91c71e1dc251102f3f825e0dcc98fd166702b614b37c62d63eaee0dded745af9ac938fcb8e40b71700e1c804f618d9bb6976b1f357d6 +EBUILD pip-19.3.1.ebuild 4029 BLAKE2B 2a10677d9a0f72a4d883284d635d0b83892e07149125d007e5610905a1df443b940df8f942574882510221b57b952c7dd0fcd706edf136701c01a7dbf6dac3bd SHA512 3a35237038bfbc220fcc7961349533aa179e9a094d6c9d7a49dfe42d5f22bde247adad7032192712518827ed0f45a92e85a0132359664eacdabffa49c5507175 EBUILD pip-9.0.1-r1.ebuild 2331 BLAKE2B edca4ecfeac1bc3bffbb066b83fa87669304ccd59dcfe165fd4cb207f8155ba2836df80a2e15c954ae5513b060fc9bab1df1d5a15870815f199bf51e19781b50 SHA512 711042823b41c10c1db502afc046424c71f081c38dc173e5bc06d58de5ca57f2e3106d4ef24134f8e79e557228f63f49c91eee1e037a2416cdfdbb592fabe221 EBUILD pip-9.0.1-r2.ebuild 2474 BLAKE2B f9f8713be38bd3316e6fb37605b2efe913b759c1c8530ebdef06c3172ef3d13d09e3d4e251f082c167a0c56773195da830ad6f7148e69c0cf64affb748964b43 SHA512 69f38fdabaee85bf23a8f4302d77a7e6cc65ffa2bc1ffcbc7f598144002c5f59072ea24b21fbef891f7145d6a129fea3b45abbef0b90caf004c5264f01f5a4c4 MISC metadata.xml 366 BLAKE2B 6cfb3fe9bd6fa72a5bc5aafb74d7f79eaa1fdf273cf45be4fb7989fd917ea8b1ad60a855770cc51944611e7590abeec450ed02c7c9ae8d850084c2b4f7c0d009 SHA512 43ccb12f2797cb70b59ff495d149c32c813e5145c65521eda9a86f675eac7756eefadeb9f4ca977e8e8c7019bae144b445240e6d7128da771eaf6d19559336f6 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 new file mode 100644 index 000000000000..70583957bd74 --- /dev/null +++ b/dev-python/pip/files/pip-19.3.1-disable-system-install.patch @@ -0,0 +1,17 @@ +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-19.3.1-network-tests.patch b/dev-python/pip/files/pip-19.3.1-network-tests.patch new file mode 100644 index 000000000000..f194a7b34a90 --- /dev/null +++ b/dev-python/pip/files/pip-19.3.1-network-tests.patch @@ -0,0 +1,66 @@ +diff --git a/news/7359.trivial b/news/7359.trivial +new file mode 100644 +index 000000000..e69de29bb +diff --git a/tests/functional/test_freeze.py b/tests/functional/test_freeze.py +index d13c931d0..2e35de3e6 100644 +--- a/tests/functional/test_freeze.py ++++ b/tests/functional/test_freeze.py +@@ -721,6 +721,7 @@ def test_freeze_user(script, virtualenv, data): + assert 'simple2' not in result.stdout + + ++@pytest.mark.network + def test_freeze_path(tmpdir, script, data): + """ + Test freeze with --path. +@@ -734,5 +735,6 @@ def test_freeze_path(tmpdir, script, data): + _check_output(result.stdout, expected) + + ++@pytest.mark.network + def test_freeze_path_exclude_user(tmpdir, script, data): + """ +@@ -756,6 +758,7 @@ def test_freeze_path_exclude_user(tmpdir, script, data): + _check_output(result.stdout, expected) + + ++@pytest.mark.network + def test_freeze_path_multiple(tmpdir, script, data): + """ + Test freeze with multiple --path arguments. +diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py +index a9eff081d..ba7a0a55c 100644 +--- a/tests/functional/test_install.py ++++ b/tests/functional/test_install.py +@@ -1325,6 +1325,7 @@ def test_install_no_binary_disables_building_wheels(script, data, with_wheel): + assert "Running setup.py install for upper" in str(res), str(res) + + ++@pytest.mark.network + def test_install_no_binary_builds_pep_517_wheel(script, data, with_wheel): + to_install = data.packages.joinpath('pep517_setup_and_pyproject') + res = script.pip( +diff --git a/tests/functional/test_install_config.py b/tests/functional/test_install_config.py +index 176976c4e..308263928 100644 +--- a/tests/functional/test_install_config.py ++++ b/tests/functional/test_install_config.py +@@ -133,6 +133,7 @@ def test_command_line_appends_correctly(script, data): + ), 'stdout: {}'.format(result.stdout) + + ++@pytest.mark.network + def test_config_file_override_stack(script, virtualenv): + """ + Test config files (global, overriding a global config with a +diff --git a/tests/functional/test_install_upgrade.py b/tests/functional/test_install_upgrade.py +index 6d2eeb5dc..0024de4d4 100644 +--- a/tests/functional/test_install_upgrade.py ++++ b/tests/functional/test_install_upgrade.py +@@ -8,6 +8,7 @@ + from tests.lib.local_repos import local_checkout + + ++@pytest.mark.network + def test_no_upgrade_unless_requested(script): + """ + No upgrade if not specifically requested. diff --git a/dev-python/pip/files/pip-19.3.1-r2-disable-system-install.patch b/dev-python/pip/files/pip-19.3.1-r2-disable-system-install.patch new file mode 100644 index 000000000000..8486c37f0c73 --- /dev/null +++ b/dev-python/pip/files/pip-19.3.1-r2-disable-system-install.patch @@ -0,0 +1,17 @@ +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 options.use_user_site and not options.target_dir and not options.root_path and not os.getenv('GENTOO_PIP_TESTING'): ++ 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/pip-19.1.ebuild b/dev-python/pip/pip-19.1.ebuild index a60686a24855..4ead19048113 100644 --- a/dev-python/pip/pip-19.1.ebuild +++ b/dev-python/pip/pip-19.1.ebuild @@ -29,7 +29,7 @@ SLOT="0" IUSE="test -vanilla" # disable-system-install patch breaks tests -RESTRICT="!vanilla? ( test )" +RESTRICT="!vanilla? ( test ) !test? ( test )" RDEPEND=" >=dev-python/setuptools-39.2.0[${PYTHON_USEDEP}] diff --git a/dev-python/pip/pip-19.3.1-r1.ebuild b/dev-python/pip/pip-19.3.1-r1.ebuild new file mode 100644 index 000000000000..af825b576635 --- /dev/null +++ b/dev-python/pip/pip-19.3.1-r1.ebuild @@ -0,0 +1,114 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy{,3} ) +PYTHON_REQ_USE="ssl(+),threads(+)" + +inherit bash-completion-r1 distutils-r1 multiprocessing + +SETUPTOOLS_PV="41.4.0" +WHEEL_PV="0.33.6" + +DESCRIPTION="Installs python packages -- replacement for easy_install" +HOMEPAGE="https://pip.pypa.io/ https://pypi.org/project/pip/ https://github.com/pypa/pip/" +SRC_URI=" + https://github.com/pypa/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz + test? ( + https://files.pythonhosted.org/packages/py2.py3/s/setuptools/setuptools-${SETUPTOOLS_PV}-py2.py3-none-any.whl + https://files.pythonhosted.org/packages/py2.py3/w/wheel/wheel-${WHEEL_PV}-py2.py3-none-any.whl + ) +" +# PyPI archive does not have tests, so we need to download from GitHub. +# setuptools & wheel .whl files are required for testing, exact version is not very important. + +LICENSE="MIT" +KEYWORDS="amd64 arm64 ~hppa ~sparc ~x86" +SLOT="0" +IUSE="test -vanilla" + +# disable-system-install patch breaks tests +RESTRICT="!vanilla? ( test ) !test? ( test )" + +RDEPEND=" + >=dev-python/setuptools-39.2.0[${PYTHON_USEDEP}] +" +DEPEND=" + ${RDEPEND} + test? ( + dev-python/freezegun[${PYTHON_USEDEP}] + dev-python/mock[${PYTHON_USEDEP}] + dev-python/pretend[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/scripttest[${PYTHON_USEDEP}] + dev-python/virtualenv[${PYTHON_USEDEP}] + dev-python/wheel[${PYTHON_USEDEP}] + ) +" + +python_prepare_all() { + local PATCHES=( + "${FILESDIR}/${PN}-19.3-disable-version-check.patch" + ) + if ! use vanilla; then + PATCHES+=( "${FILESDIR}/pip-19.3.1-disable-system-install.patch" ) + fi + distutils-r1_python_prepare_all + + if use test; then + mkdir tests/data/common_wheels/ + cp "${DISTDIR}"/setuptools-${SETUPTOOLS_PV}-py2.py3-none-any.whl tests/data/common_wheels/ || die + cp "${DISTDIR}"/wheel-${WHEEL_PV}-py2.py3-none-any.whl tests/data/common_wheels/ || die + fi +} + +python_test () { + # pip test suite likes to test installed version of pip, both the module and the executable. + # Here we install it into a temporary dir and add to PATHs in a subshell. + EPYTHON_ROOT="${T}/${EPYTHON}_root" + esetup.py install --root "${EPYTHON_ROOT}" + + if [[ ${EPYTHON} == python2* ]]; then + # These tests just fail on Python 2. + EXCLUDE_TESTS=( or pep518_uses_build_env or install_package_with_root or install_editable_with_prefix + or install_from_current_directory_into_usersite or install_user_wheel + or uninstall_from_usersite_with_dist_in_global_site + or uninstall_editable_from_usersite + or build_env_isolation + ) + fi + + ( + export PATH="${EPYTHON_ROOT}/usr/bin:$PATH" + export PYTHONPATH="${EPYTHON_ROOT}/$(python_get_sitedir)" + + # Disable VCS and network tests. + # version_check tests are excluded since we explicitly disable this feature entirely. + # uninstall test just fails, likely because of our test environment setup. + python -m pytest -v \ + -k "not (svn or git or bazaar or mercurial or version_check or uninstall_non_local_distutils ${EXCLUDE_TESTS[*]})" \ + -m "not network" \ + || die + ) +} + +python_install_all() { + local DOCS=( AUTHORS.txt docs/html/**/*.rst ) + distutils-r1_python_install_all + + COMPLETION="${T}"/completion.tmp + + # 'pip completion' command embeds full $0 into completion script, which confuses + # 'complete' and causes QA warning when running as "${PYTHON} -m pip". + # This trick sets correct $0 while still calling just installed pip. + local pipcmd='import sys; sys.argv[0] = "pip"; import pip.__main__; sys.exit(pip.__main__._main())' + + ${PYTHON} -c "${pipcmd}" completion --bash > "${COMPLETION}" || die + newbashcomp "${COMPLETION}" ${PN} + + ${PYTHON} -c "${pipcmd}" completion --zsh > "${COMPLETION}" || die + insinto /usr/share/zsh/site-functions + newins "${COMPLETION}" _pip +} diff --git a/dev-python/pip/pip-19.3.1-r2.ebuild b/dev-python/pip/pip-19.3.1-r2.ebuild new file mode 100644 index 000000000000..6e7219b27dfe --- /dev/null +++ b/dev-python/pip/pip-19.3.1-r2.ebuild @@ -0,0 +1,133 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} pypy{,3} ) +PYTHON_REQ_USE="ssl(+),threads(+)" + +inherit bash-completion-r1 distutils-r1 multiprocessing + +SETUPTOOLS_PV="41.4.0" +WHEEL_PV="0.33.6" + +DESCRIPTION="Installs python packages -- replacement for easy_install" +HOMEPAGE="https://pip.pypa.io/ https://pypi.org/project/pip/ https://github.com/pypa/pip/" +SRC_URI=" + https://github.com/pypa/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz + test? ( + https://files.pythonhosted.org/packages/py2.py3/s/setuptools/setuptools-${SETUPTOOLS_PV}-py2.py3-none-any.whl + https://files.pythonhosted.org/packages/py2.py3/w/wheel/wheel-${WHEEL_PV}-py2.py3-none-any.whl + ) +" +# PyPI archive does not have tests, so we need to download from GitHub. +# setuptools & wheel .whl files are required for testing, exact version is not very important. + +LICENSE="MIT" +KEYWORDS="~amd64 ~arm64 ~sparc ~x86" +SLOT="0" +IUSE="test -vanilla" + +# disable-system-install patch breaks tests +RESTRICT="!test? ( test )" + +RDEPEND=" + >=dev-python/setuptools-39.2.0[${PYTHON_USEDEP}] +" +DEPEND=" + ${RDEPEND} + test? ( + dev-python/freezegun[${PYTHON_USEDEP}] + dev-python/mock[${PYTHON_USEDEP}] + dev-python/pretend[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/scripttest[${PYTHON_USEDEP}] + dev-python/virtualenv[${PYTHON_USEDEP}] + dev-python/wheel[${PYTHON_USEDEP}] + ) +" + +python_prepare_all() { + local PATCHES=( + "${FILESDIR}/${PN}-19.3-disable-version-check.patch" + + # these are from upstream git + "${FILESDIR}/pip-19.3.1-network-tests.patch" + ) + if ! use vanilla; then + PATCHES+=( "${FILESDIR}/pip-19.3.1-r2-disable-system-install.patch" ) + fi + distutils-r1_python_prepare_all + + if use test; then + mkdir tests/data/common_wheels/ || die + cp "${DISTDIR}"/setuptools-${SETUPTOOLS_PV}-py2.py3-none-any.whl \ + tests/data/common_wheels/ || die + + cp "${DISTDIR}"/wheel-${WHEEL_PV}-py2.py3-none-any.whl \ + tests/data/common_wheels/ || die + fi +} + +python_test() { + if [[ ${EPYTHON} == pypy* ]]; then + ewarn "Skipping tests on ${EPYTHON} since they are very broken" + return 0 + fi + + local -a exclude_tests + + # these will be built in to an expression passed to pytest to exclude + exclude_tests=( + git + svn + bazaar + mercurial + version_check + uninstall_non_local_distutils + pep518_uses_build_env + install_package_with_root + install_editable_with_prefix + install_user_wheel + install_from_current_directory_into_usersite + uninstall_editable_from_usersite + uninstall_from_usersite_with_dist_in_global_site + build_env_isolation + ) + + distutils_install_for_testing + + # generate the expression to exclude failing tests + local exclude_expr + printf -v exclude_expr "or %s " "${exclude_tests[@]}" || die + exclude_expr="not (${exclude_expr#or })" || die + + local -x GENTOO_PIP_TESTING=1 \ + PATH="${TEST_DIR}/scripts:${PATH}" \ + PYTHONPATH="${TEST_DIR}/lib:${BUILD_DIR}/lib" + + pytest -vv \ + -k "${exclude_expr}" \ + -m "not network" \ + || die "Tests fail with ${EPYTHON}" +} + +python_install_all() { + local DOCS=( AUTHORS.txt docs/html/**/*.rst ) + distutils-r1_python_install_all + + COMPLETION="${T}"/completion.tmp + + # 'pip completion' command embeds full $0 into completion script, which confuses + # 'complete' and causes QA warning when running as "${PYTHON} -m pip". + # This trick sets correct $0 while still calling just installed pip. + local pipcmd='import sys; sys.argv[0] = "pip"; import pip.__main__; sys.exit(pip.__main__._main())' + + ${PYTHON} -c "${pipcmd}" completion --bash > "${COMPLETION}" || die + newbashcomp "${COMPLETION}" ${PN} + + ${PYTHON} -c "${pipcmd}" completion --zsh > "${COMPLETION}" || die + insinto /usr/share/zsh/site-functions + newins "${COMPLETION}" _pip +} diff --git a/dev-python/pip/pip-19.3.1.ebuild b/dev-python/pip/pip-19.3.1.ebuild index a188c772c1ba..8a91d32fe62f 100644 --- a/dev-python/pip/pip-19.3.1.ebuild +++ b/dev-python/pip/pip-19.3.1.ebuild @@ -29,7 +29,7 @@ SLOT="0" IUSE="test -vanilla" # disable-system-install patch breaks tests -RESTRICT="!vanilla? ( test )" +RESTRICT="!vanilla? ( test ) !test? ( test )" RDEPEND=" >=dev-python/setuptools-39.2.0[${PYTHON_USEDEP}] |