summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ea4226b37fe57484d99f6e4eb37e5e1f3c15f468 (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
# Maintainer: Mohamed Amine Zghal (medaminezghal) <medaminezghal at outlook dot com>

_name=devtools
pkgname=python-${_name}
pkgver=0.12.2
pkgrel=1
pkgdesc="Python's missing debug print command, and more."
arch=('any')
url='https://github.com/samuelcolvin/python-devtools'
license=('MIT')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name//-/_}-${pkgver}.tar.gz")
sha256sums=('efceab184cb35e3a11fa8e602cc4fadacaa2e859e920fc6f87bf130b69885507')
depends=('python>=3.7' 'python-executing' 'python-asttokens' 'python-six' 'python-pygments')
makedepends=('python-hatchling')
checkdepends=('python-coverage' 'python-pytest' 'python-pytest-mock' 'python-pytest-pretty' 'python-asyncpg' 'python-black' 'python-multidict' 'python-numpy' 'python-pydantic' 'python-sqlalchemy')

build() {
  cd "${srcdir}"/${_name//-/_}-${pkgver}
  python -m build --wheel --no-isolation
}

check() {
  local pytest_options=(
    --deselect tests/test_expr_render.py::test_executing_failure
    --deselect tests/test_insert_assert.py::test_insert_assert
    --deselect tests/test_insert_assert.py::test_insert_assert_no_pretty
    --deselect tests/test_insert_assert.py::test_insert_assert_print
    --deselect tests/test_insert_assert.py::test_insert_assert_fail
    --deselect tests/test_insert_assert.py::test_deep
    --deselect tests/test_insert_assert.py::test_enum
    --deselect tests/tests/test_insert_assert.py::test_insert_assert_repeat
    --deselect tests/test_prettier.py::test_ast_expr
  )
  cd "${srcdir}"/${_name//-/_}-${pkgver}
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest "${pytest_options[@]}" tests
}

package() {
  cd "${srcdir}"/${_name//-/_}-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}