# Contributor: Fabian Affolter # Maintainer: Fabian Affolter pkgname=py3-pip pkgver=22.0.4 pkgrel=0 pkgdesc="Tool for installing and managing Python packages" url="http://www.pip-installer.org" arch="noarch" license="MIT" depends=" py3-contextlib2 py3-pep517 py3-retrying py3-setuptools python3 " makedepends=" py3-sphinx py3-sphinx-copybutton py3-sphinx-inline-tabs py3-myst-parser " checkdepends=" py3-cryptography py3-freezegun py3-mock py3-pretend py3-pytest py3-yaml py3-scripttest py3-virtualenv py3-werkzeug " subpackages=" $pkgname-doc $pkgname-zsh-completion $pkgname-bash-completion " source="https://github.com/pypa/pip/archive/$pkgver/pip-$pkgver.tar.gz" builddir="$srcdir/pip-$pkgver" provides="py-pip=$pkgver-r$pkgrel" # Backwards compatibility replaces="py-pip" # Backwards compatibility options="!check" # check is broken prepare() { default_prepare # Remove certifi usage sed -i 's|from pip._vendor.certifi import where|where = lambda: "/etc/ssl/certs/ca-certificates.crt"|' src/pip/_internal/commands/debug.py # Do not use furo as HTML theme in docs # furo is not available in Alpine sed -i '/html_theme = "furo"/d' docs/html/conf.py # Upstream uses a Python 2/3 compatibility library for csv with Python 3 semantics in tests # We only target Python 3 and csv23 is not (yet) packaged # As of 20.1b1, this workaround was sufficient to get around the missing dependency sed -i 's/csv23/csv/g' tests/lib/wheel.py # not packaged (and has another ~5 deps), and not actually used it seems # (maybe for html docs) sed -i '/sphinxcontrib.towncrier/d' docs/html/conf.py } build() { python3 setup.py build # see noxfile.py export PYTHONPATH="$PWD/build/lib" sphinx-build -c docs/html -d docs/build/doctrees/man -b man docs/man docs/build/man } check() { # --deselect'ed and -k'ed tests are not compatible with the latest virtualenv # These files contain almost 500 tests so we should enable them back # as soon as pip will be compatible upstream # https://github.com/pypa/pip/pull/8441 PYTHONPATH="$PWD/build/lib" pytest -m 'not network' \ -k "not test_from_link_vcs_with_source_dir_obtains_commit_id and not test_from_link_vcs_without_source_dir and not test_should_cache_git_sha" \ --deselect tests/functional \ --deselect tests/lib/test_lib.py \ --deselect tests/unit/test_build_env.py } package() { python3 setup.py install --prefix=/usr --root="$pkgdir" install -Dm644 docs/build/man/* -t "$pkgdir"/usr/share/man/man1 local _py3ver=$(python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))') PYTHONPATH="$pkgdir"/usr/lib/python$_py3ver/site-packages "$pkgdir"/usr/bin/pip \ completion --bash | \ install -Dm644 /dev/stdin "$pkgdir"/usr/share/bash-completion/completions/pip PYTHONPATH="$pkgdir"/usr/lib/python$_py3ver/site-packages "$pkgdir"/usr/bin/pip \ completion --zsh | \ install -Dm644 /dev/stdin "$pkgdir"/usr/share/zsh/site-functions/_pip } sha512sums=" af6d1787b4fe97f2eec9c2e3e3f0f756efca8cb83f6ecdae797986fb6050ee60d872a8a8eb7502a32c4334fc0c7af8cf3c58ce980407d0e9f89eec28a4290093 pip-22.0.4.tar.gz "