summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/python-josepy/PKGBUILD
blob: 7e56bdac07d67f0e7db4249f5b3766e56b0c57bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgbase=python-josepy
pkgname=(python-josepy python2-josepy)
pkgver=1.1.0
pkgrel=2
pkgdesc="JOSE protocol implementation in Python"
url="https://github.com/certbot/josepy"
license=('PerlArtistic')
arch=('any')
makedepends=('python-cryptography' 'python2-cryptography' 'python-pyopenssl' 'python2-pyopenssl'
             'python-setuptools' 'python2-setuptools')
checkdepends=('python-pytest-runner' 'python2-pytest-runner' 'python-coverage' 'python2-coverage'
              'python-pytest-isort' 'python2-pytest-isort' 'python-pytest-cache'
              'python2-pytest-cache' 'python-pytest-cov' 'python2-pytest-cov' 'flake8'
              'python2-flake8' 'python-pytest-flake8' 'python2-pytest-flake8' 'python-mock'
              'python2-mock')
source=("https://pypi.io/packages/source/j/josepy/josepy-$pkgver.tar.gz")
sha512sums=('eee886565b1cb92e6d7a42f1e3666a158c162fb891f90de844118ac32b24f6deccf2eee5990ba100827109203f7da99c2b55735fb7bda05fd7a447dca39d6362')

prepare() {
  # https://github.com/certbot/josepy/issues/24
  sed -i 's/flake8-ignore = E501/flake8-ignore = E501 W504/' josepy-$pkgver/pytest.ini\

  cp -a josepy-$pkgver{,-py2}
}

build() {
  cd "$srcdir"/josepy-$pkgver
  python setup.py build

  cd "$srcdir"/josepy-$pkgver-py2
  python2 setup.py build
}

check() {
  cd "$srcdir"/josepy-$pkgver
  python setup.py pytest

  cd "$srcdir"/josepy-$pkgver-py2
  python2 setup.py pytest
}

package_python-josepy() {
  depends=('python-cryptography' 'python-pyopenssl' 'python-setuptools')

  cd josepy-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}

package_python2-josepy() {
  depends=('python2-cryptography' 'python2-pyopenssl' 'python2-setuptools')

  cd josepy-$pkgver-py2
  python2 setup.py install --root="$pkgdir" --optimize=1

  mv "$pkgdir"/usr/bin/jws{,2}
}