upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / python-portend / trunk / PKGBUILD
blobd414b41951cf60f6d57c8a8e61f6bcc7714df8fb
1 # Maintainer: Thore Bödecker <foxxx0@archlinux.org>
2 # Contributor: Laurent Soest <laurent.soest(at)gmail.com>
4 pkgname='python-portend'
5 _pkgbase="${pkgname//python-/}"
6 pkgver=3.1.0
7 pkgrel=3
8 pkgdesc="Use portend to monitor TCP ports for bound or unbound states."
9 arch=('any')
10 url="https://github.com/jaraco/portend"
11 license=('MIT')
12 depends=('python' 'python-tempora')
13 makedepends=('python-setuptools' 'python-setuptools-scm' 'python-tox'
14              'python-tempora')
15 checkdepends=('python-pytest')
16 source=("https://files.pythonhosted.org/packages/source/${_pkgbase:0:1}/${_pkgbase}/${_pkgbase}-${pkgver}.tar.gz"
17         'LICENSE')
18 sha512sums=('017dff68ea85f48d19398f71fbd8189329ca9c27c05d8599dd5e53632eb5ddc6dea322e94c924a0653f25f042a3c8ee1cda5f8450b02f3406a72036d54cd1aaf'
19             '1106afed483b7258e4ae89c5d9459c3834412b31aac90169725ed62d2ab44f61f6f79e894d4c9e4d8bd99e14530ab778df2187784f0b25eaab86d312fad68944')
21 prepare() {
22     cd "${srcdir}/${_pkgbase}-${pkgver}"
23     # remove linting/style tests, not relevant for downstream packaging
24     for pointless_flag in \
25       --flake8 \
26       --black \
27       --cov \
28       --cov-append \
29       --doctest-modules
30     do
31       sed -i "s/${pointless_flag}//g" pytest.ini
32     done
35 build() {
36     # setuptools wont find version from git tag
37     export SETUPTOOLS_SCM_PRETEND_VERSION="${pkgver}"
38     cd "${srcdir}/${_pkgbase}-${pkgver}"
39     python ./setup.py build
42 check() {
43     cd "${srcdir}/${_pkgbase}-${pkgver}"
44     # tox
45     py.test -vvv -s -ra --showlocals --noconftest .
48 package() {
49     cd "${srcdir}/${_pkgbase}-${pkgver}"
50     python ./setup.py install --root="${pkgdir}" --optimize=1
52     # the author has promised to include a LICENSE file in future releases:
53     # https://github.com/jaraco/skeleton/issues/1
54     # for now the LICENSE file has been taken from:
55     # https://github.com/jaraco/skeleton/blob/skeleton/LICENSE
56     install -D -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"