1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 # Contributor: Dan McGee <dan@archlinux.org>
4 # Contributor: Eli Schwartz <eschwartz@archlinux.org>
5 # Contributor: Sebastien Binet <binet@lblbox>
11 pkgdesc="The PyPA recommended tool for installing Python packages"
12 url="https://pip.pypa.io/"
17 python-attrs # for vendored rich
18 python-cryptography # for vendored requests and urllib3
19 python-wheel # for internal misc utils
27 python-sphinx-copybutton
28 python-sphinx-inline-tabs
29 python-sphinxcontrib-towncrier
35 python-pytest-rerunfailures
43 source=(https://github.com/pypa/$_name/archive/$pkgver/$_name-$pkgver.tar.gz)
44 sha512sums=('b33070cb59a1258904a60b48ec8abfd9e316c5f87681fea13d89ddf6d516afac10965ae1db54fea299a0a72f98602ce02e8b3be46f239e857db84866045730e1')
45 b2sums=('511ac1a9405e377ccb2525e89676f4a63f138aa526d40e76f4d9681139d94db1f92772beab1a647654c17abc6bee09f52cf4c4f4484716874194565fda07d056')
50 python -m build --wheel --no-isolation
53 PYTHONPATH="$srcdir/$_name-$pkgver/src/" python pip_sphinxext.py
54 PYTHONPATH="$srcdir/$_name-$pkgver/src/" sphinx-build -b man -d build/doctrees/man man build/man -c html
58 local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
60 # deselect tests that would require python-pip in checkdepends (may or may not work due to devendored dependencies when python-pip is updated)
61 --deselect tests/unit/test_direct_url_helpers.py::test_from_link_vcs_with_source_dir_obtains_commit_id
62 --deselect tests/unit/test_direct_url_helpers.py::test_from_link_vcs_without_source_dir
63 --deselect tests/unit/test_wheel_builder.py::test_should_cache_git_sha
67 # install to temporary location
68 python -m installer --destdir=test_dir dist/*.whl
69 export PYTHONPATH="test_dir/$_site_packages:$PYTHONPATH"
70 pytest -vv -m unit "${_deselected[@]}" tests/
74 local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
77 python -m installer --destdir="$pkgdir" dist/*.whl
79 install -vDm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
80 install -vDm 644 docs/build/man/*.1 -t "$pkgdir/usr/share/man/man1/"
81 install -vDm 644 {NEWS,README}.rst -t "$pkgdir/usr/share/doc/$pkgname/"
83 # NOTE: zsh completion does not work: https://bugs.archlinux.org/task/65349#comment187166
84 PYTHONPATH="$pkgdir/$_site_packages" "$pkgdir"/usr/bin/pip completion --bash | install -vDm 644 /dev/stdin "$pkgdir"/usr/share/bash-completion/completions/pip
85 PYTHONPATH="$pkgdir/$_site_packages" "$pkgdir"/usr/bin/pip completion --fish | install -vDm 644 /dev/stdin "$pkgdir"/usr/share/fish/vendor_completions.d/pip.fish