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/"
15 # packages required to devendor pip: https://github.com/pypa/pip/tree/main/src/pip/_vendor
37 python-typing-extensions
41 # add these until https://github.com/pypa/pip/issues/5354#issuecomment-672678167 is resolved
45 depends=("${_vendored[@]}" "${_vendored_optional[@]}")
52 python-sphinx-copybutton
53 python-sphinx-inline-tabs
54 python-sphinxcontrib-towncrier
62 python-pytest-rerunfailures
73 $_name-$pkgver.tar.gz::https://github.com/pypa/$_name/archive/$pkgver.tar.gz
74 $_name-22.1.2-devendor.patch
76 sha512sums=('bd59e28b55475b77a8f11ea771cbad3b2602ff974e219f9a55288963a9522c9279a5b00fde40fb65cfebefae0e905d3da3c06fe50b402aa5326b25f70a98a015'
77 '90f07252786d765c8ba7ce12915ed9434d3696addb8e5cfff298f280b9f499ad6836a158c9f515a51fc7373f1a77b9eb550b7855609114b041aa7bc5b2b821ae')
78 b2sums=('2179b0d3f5f05bbd678f1785b4dbc0613078c09c83b45faa62d766182dfeb564095abda809ed99f45644abcb06c125efc528aeaed3ad40ab1c9e8972e33ccbb2'
79 '892455034738c6c7a74cd7c136c0650f9c4eb54dd4708cf43d2e17ecbd9904adb567c9c3d5a05865048645ad3aac65406a82d23af43fd3889d9290b66d89ead5')
83 # set DEBUNDLED to True
84 patch -Np1 -d $_name-$pkgver -i ../$_name-22.1.2-devendor.patch
86 # remove vendored files, except __init__.py
87 rm -frv $_name-$pkgver/src/pip/_vendor/!(__init__.py)
94 python -m build --wheel --no-isolation
97 PYTHONPATH="$srcdir/$_name-$pkgver/src/" python pip_sphinxext.py
98 PYTHONPATH="$srcdir/$_name-$pkgver/src/" sphinx-build -b man -d build/doctrees/man man build/man -c html
102 local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
104 # deselect tests that would require python-pip in checkdepends (may or may not work due to devendored dependencies when python-pip is updated)
105 --deselect tests/unit/test_direct_url_helpers.py::test_from_link_vcs_with_source_dir_obtains_commit_id
106 --deselect tests/unit/test_direct_url_helpers.py::test_from_link_vcs_without_source_dir
107 --deselect tests/unit/test_wheel_builder.py::test_should_cache_git_sha
111 # install to temporary location
112 python -m installer --destdir=test_dir dist/*.whl
113 export PYTHONPATH="test_dir/$_site_packages:$PYTHONPATH"
114 pytest -vv -m unit "${_deselected[@]}"
118 local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
121 python -m installer --destdir="$pkgdir" dist/*.whl
123 install -vDm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
124 install -vDm 644 docs/build/man/*.1 -t "$pkgdir/usr/share/man/man1/"
125 install -vDm 644 {NEWS,README}.rst -t "$pkgdir/usr/share/doc/$pkgname/"
127 # NOTE: zsh completion does not work: https://bugs.archlinux.org/task/65349#comment187166
128 PYTHONPATH="$pkgdir/$_site_packages" "$pkgdir"/usr/bin/pip completion --bash | install -vDm 644 /dev/stdin "$pkgdir"/usr/share/bash-completion/completions/pip
129 PYTHONPATH="$pkgdir/$_site_packages" "$pkgdir"/usr/bin/pip completion --fish | install -vDm 644 /dev/stdin "$pkgdir"/usr/share/fish/vendor_completions.d/pip.fish