diff options
author | Universebenzene | 2023-07-10 15:46:27 +0800 |
---|---|---|
committer | Universebenzene | 2023-07-10 15:46:27 +0800 |
commit | 5d6577ccf915e0343f85e50659d4266da8c9f254 (patch) | |
tree | f90358b96e41d00ea6d8ee5b225f78d53bbc9b4e | |
parent | 49f9b8ed3edfd8bf8719ee7aa02169f02fc4dbeb (diff) | |
download | aur-5d6577ccf915e0343f85e50659d4266da8c9f254.tar.gz |
Change to PEP 517 build
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | PKGBUILD | 52 |
3 files changed, 60 insertions, 17 deletions
@@ -3,13 +3,18 @@ pkgbase = python-fast-histogram pkgver = 0.11 pkgrel = 1 url = https://github.com/astrofrog/fast-histogram - arch = i386 + arch = i686 arch = x86_64 - license = CUSTOM - makedepends = python-setuptools - depends = python - depends = python-numpy - source = https://pypi.io/packages/source/f/fast-histogram/fast-histogram-0.11.tar.gz + license = BSD + checkdepends = python-pytest + checkdepends = python-hypothesis + makedepends = python-setuptools-scm + makedepends = python-wheel + makedepends = python-build + makedepends = python-installer + makedepends = python-numpy + source = https://files.pythonhosted.org/packages/source/f/fast-histogram/fast-histogram-0.11.tar.gz sha256sums = 9acb6fa5b6efd928663008965da186962bdeae20e6d5bbb3b1195dfbd1d906f0 pkgname = python-fast-histogram + depends = python-numpy diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..e896dcd6056d --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +src +pkg +*.src.tar.gz +*.tar.gz +*.tar.bz2 +*.part +*.pkg.tar.* +*.log @@ -1,22 +1,52 @@ -# Maintainer: Ista Zahn <istazahn@gmail.com> +# Maintainer: Astro Benzene <universebenzene at sina dot com> +# Maintainer: Ista Zahn <istazahn at gmail dot com> pkgname=python-fast-histogram _pyname=fast-histogram pkgver=0.11 pkgrel=1 pkgdesc="Fast 1D and 2D histogram functions in Python" -arch=('i386' 'x86_64') +arch=('i686' 'x86_64') url="https://github.com/astrofrog/fast-histogram" -license=('CUSTOM') -depends=('python' 'python-numpy') -makedepends=('python-setuptools') - -source=(https://pypi.io/packages/source/f/${_pyname}/${_pyname}-${pkgver}.tar.gz) +license=('BSD') +makedepends=('python-setuptools-scm' + 'python-wheel' + 'python-build' + 'python-installer' + 'python-numpy') +checkdepends=('python-pytest' 'python-hypothesis') +source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz") sha256sums=('9acb6fa5b6efd928663008965da186962bdeae20e6d5bbb3b1195dfbd1d906f0') +get_pyver() { + python -c "import sys; print('$1'.join(map(str, sys.version_info[:2])))" +} + +prepare() { + cd ${srcdir}/${_pyname}-${pkgver} + + sed -i -e "/oldest-supported-numpy/d" -e "/\"wheel\"/s/,/]/" pyproject.toml +} + +build() { + cd ${srcdir}/${_pyname}-${pkgver} + + python -m build --wheel --no-isolation +} + +check() { + cd ${srcdir}/${_pyname}-${pkgver} + pytest "build/lib.linux-${CARCH}-cpython-$(get_pyver)" \ + --deselect=build/lib.linux-x86_64-cpython-311/fast_histogram/tests/test_histogram.py::test_1d_compare_with_numpy \ + --deselect=build/lib.linux-x86_64-cpython-311/fast_histogram/tests/test_histogram.py::test_2d_compare_with_numpy \ + --deselect=build/lib.linux-x86_64-cpython-311/fast_histogram/tests/test_histogram.py::test_dd_compare_with_numpy || warning "Tests failed" -vv --color=yes +} + package() { - cd "${srcdir}/${_pyname}-${pkgver}" - python setup.py install -O1 --root="${pkgdir}" - install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" - install -Dm 644 README.rst "${pkgdir}/usr/share/doc/${pkgname}/README" + depends=('python-numpy') + cd "${srcdir}/${_pyname}-${pkgver}" + + python -m installer --destdir="${pkgdir}" dist/*.whl + install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm 644 README.rst "${pkgdir}/usr/share/doc/${pkgname}/README" } |