archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-pipenv / repos / community-any / PKGBUILD
blob43e952e0f83177ec96c6a6402e23982886ce52dc
1 # Maintainer: Morten Linderud <foxboron@archlinux.org>
2 # Maintainer: Andrew Crerar <crerar@archlinux.org>
3 # Contributor: Maikel Wever <maikelwever@gmail.com>
5 pkgname=python-pipenv
6 pkgver=2023.4.29
7 pkgrel=1
8 pkgdesc="Sacred Marriage of Pipfile, Pip, & Virtualenv."
9 url="https://pipenv.pypa.io"
10 arch=('any')
11 license=('MIT')
12 depends=('python'
13          'python-pip'
14          'python-certifi'
15          'python-virtualenv-clone'
16          'python-virtualenv')
17 makedepends=('python-build'
18              'python-installer'
19              'python-setuptools'
20              'python-wheel')
21 checkdepends=('python-pytest'
22               'python-pytz')
23 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/pypa/pipenv/archive/v${pkgver}.tar.gz")
24 b2sums=('31432b80f82b041969e75d0ec0a28ca90068395be25dac94a7f34526f0b638adfae59e9396b147fa61592ee78af2d9cfb4a1b65dedea9bbb299b2624a6d6e9a1')
26 build() {
27   cd "pipenv-${pkgver}"
28   python -m build --wheel --no-isolation
31 check() {
32   cd "pipenv-${pkgver}"
33   pytest tests/unit --ignore tests/unit/test_utils_windows_executable.py
36 package() {
37   local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
39   cd "pipenv-${pkgver}"
40   python -m installer --destdir="$pkgdir" dist/*.whl
42   install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
43   pushd pipenv
44   find . -name \*LICENSE\* -exec install -Dm 644 \{\} "${pkgdir}/usr/share/licenses/${pkgname}/"\{\} \;
45   popd
47   PYTHONPATH="${pkgdir}/${_site_packages}" _PIPENV_COMPLETE=bash_source "${pkgdir}"/usr/bin/pipenv | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/pipenv"
48   PYTHONPATH="${pkgdir}/${_site_packages}" _PIPENV_COMPLETE=zsh_source  "${pkgdir}"/usr/bin/pipenv | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_pipenv"
49   PYTHONPATH="${pkgdir}/${_site_packages}" _PIPENV_COMPLETE=fish_source "${pkgdir}"/usr/bin/pipenv | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/pipenv.fish"
51   # Remove vendored cacert.pem
52   # Taken from python-certifi
53   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
54   rm "$pkgdir"/$site_packages/pipenv/patched/pip/_vendor/certifi/cacert.pem
55   ln -sf /etc/ssl/certs/ca-certificates.crt "$pkgdir"/$site_packages/pipenv/patched/pip/_vendor/certifi/cacert.pem