archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / python-wheel / trunk / PKGBUILD
blobc8662fd269d4c183c1c93b1f9adf9fbd33639aa5
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Maintainer: Morten Linderud <foxboron@archlinux.org>
3 # Contributor: Lance Chen <cyen0312@gmail.com>
5 _pypiname=wheel
6 pkgname=python-wheel
7 pkgver=0.40.0
8 pkgrel=3
9 pkgdesc="A built-package format for Python"
10 arch=(any)
11 url="https://pypi.python.org/pypi/wheel"
12 license=('MIT')
13 depends=('python-packaging')
14 optdepends=('python-keyring: for wheel.signatures'
15             'python-xdg: for wheel.signatures')
16 makedepends=('python-setuptools' 'python-build' 'python-flit-core' 'python-installer')
17 checkdepends=('python-jsonschema' 'python-pytest' 'python-keyring' 'python-keyrings-alt'
18               'python-xdg' 'python-pytest-cov')
19 source=("$pkgname-$pkgver.tar.gz::https://github.com/pypa/wheel/archive/$pkgver.tar.gz")
20 sha512sums=('f23bddfb0c23c77d16b24d9c6b132b0272830c89ae63ac672f204af665863a38779c142a72a66a33c615c4b52450d433b4edcbd333de4e0d418b4fbe836de953')
22 prepare() {
23   cd wheel-$pkgver
24   # https://github.com/pypa/wheel/pull/365 but why?
25   rm -r src/wheel/vendored
26   sed -i 's/from .vendored.packaging.requirements import Requirement/from packaging.requirements import Requirement/' src/wheel/metadata.py
27   sed -i 's/from .vendored.packaging import tags/from packaging import tags/' src/wheel/bdist_wheel.py
28   sed -i 's/from .vendored.packaging import version as _packaging_version/from packaging import version as _packaging_version/' src/wheel/bdist_wheel.py
29   sed -i 's/from wheel.vendored.packaging import tags/from packaging import tags/' tests/test_bdist_wheel.py
32 build() {
33   cd wheel-$pkgver
34   python -m build --wheel --no-isolation
37 check() {
38   # Hack entry points by installing it
40   cd wheel-$pkgver
41   python -m installer --destdir="$PWD/tmp_install" dist/*.whl
42   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
43   PYTHONPATH="$PWD/tmp_install/$site_packages" pytest
46 package() {
47   cd wheel-$pkgver
48   python -m installer --destdir="$pkgdir" dist/*.whl
49   install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/