summaryrefslogtreecommitdiff
path: root/dev-python/pip/pip-19.3.1-r1.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-12-15 18:09:03 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-12-15 18:09:03 +0000
commit7bc9c63c9da678a7e6fceb095d56c634afd22c56 (patch)
tree4a67d50a439e9af63947e5f8b6ba3719af98b6c9 /dev-python/pip/pip-19.3.1-r1.ebuild
parentb284a3168fa91a038925d2ecf5e4791011ea5e7d (diff)
gentoo resync : 15.12.2019
Diffstat (limited to 'dev-python/pip/pip-19.3.1-r1.ebuild')
-rw-r--r--dev-python/pip/pip-19.3.1-r1.ebuild114
1 files changed, 114 insertions, 0 deletions
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
+}