archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-pdm / trunk / PKGBUILD
blob346dedc5fbb0a484efb6802eae2b6291e4860579
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 _name=pdm
4 pkgname=python-pdm
5 pkgver=2.6.1
6 pkgrel=1
7 pkgdesc="A modern Python package manager with PEP 582 support"
8 arch=(any)
9 url="https://github.com/pdm-project/pdm"
10 license=(MIT)
11 depends=(
12   python
13   python-blinker
14   python-cachecontrol
15   python-certifi
16   python-dotenv
17   python-findpython
18   python-installer
19   python-lockfile  # required optdepends of python-cachecontrol
20   python-packaging
21   python-pdm-backend
22   python-platformdirs
23   python-pyproject-hooks
24   python-requests  # required by python-requests-toolbelt
25   python-requests-toolbelt
26   python-resolvelib
27   python-rich
28   python-shellingham
29   python-tomlkit
30   python-unearth
31   python-virtualenv
33 makedepends=(
34   python-build
35   python-wheel
37 checkdepends=(
38   python-setuptools
39   python-pytest
40   python-pytest-httpserver
41   python-pytest-mock
43 optdepends=(
44   'python-keyring: for storing credentials'
45   'python-pytest-mock: for pytest plugin'
46   'python-setuptools: for parsing setup.py files'
48 source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
49 sha512sums=('91d0967f407f1f1e2d23e9b43e268d105ed14ec7772eaa433bf20912fa710478ee7a33d01691d795b875cf6385d61bb3d431d176d53c16d3018670e28794b9c5')
50 b2sums=('65a3f8e8badf4bd6da2d801ea38f1e85c1e6ccf204a8c4fb1aa7be31c9093ae8ac93b882a511a00814b4838a479fd7b0cfdcea452198388abfec7cdc00b6b610')
52 build() {
53   cd $_name-$pkgver
54   python -m build --wheel --no-isolation
57 check() {
58   local pytest_options=(
59     -vv
60     # https://github.com/pdm-project/pdm/issues/1831
61     --deselect tests/cli/test_others.py::test_build_distributions
62     # we don't want to run tests that require the internet
63     --deselect tests/test_project.py::test_access_index_with_auth
64   )
65   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
67   cd $_name-$pkgver
68   # install to temporary location, as importlib is used
69   python -m installer --destdir=test_dir dist/*.whl
70   export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH"
71   pytest "${pytest_options[@]}"
74 package() {
75   cd $_name-$pkgver
76   python -m installer --destdir="$pkgdir" dist/*.whl
77   install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
78   install -vDm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
79   # completions
80   install -vd "$pkgdir/usr/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
81   "$pkgdir"/usr/bin/pdm completion bash > "$pkgdir/usr/share/bash-completion/completions/$_name"
82   "$pkgdir"/usr/bin/pdm completion fish > "$pkgdir/usr/share/fish/vendor_completions.d/$_name.fish"
83   "$pkgdir"/usr/bin/pdm completion zsh > "$pkgdir/usr/share/zsh/site-functions/_$_name"