diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..1446618554d9 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,36 @@ +# Maintainer: Carlos Aznarán <caznaranl@uni.pe> +_base=syrupy +pkgname=python-${_base} +pkgdesc="The sweeter pytest snapshot plugin" +pkgver=3.0.2 +pkgrel=1 +arch=(any) +url="https://github.com/tophat/${_base}" +license=(Apache) +depends=(python-pytest python-colored) +makedepends=(python-build python-installer python-poetry-core) +source=(${_base}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz) +sha512sums=('ccb2e07343d718e3293d5756f318ce9234d5903ca4b3fe0006b8fa19c1bf30ede9e52d99e75480622c6db5680aded6ecea13a88dfe8095f7e54656a2d61f26ff') + +build() { + cd ${_base}-${pkgver} + python -m build --wheel --skip-dependency-check --no-isolation +} + +check() { + cd ${_base}-${pkgver} + python -m venv --system-site-packages test-env + test-env/bin/python -m installer dist/*.whl + test-env/bin/python -m pytest +} + +package() { + cd ${_base}-${pkgver} + PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python -m installer --destdir="${pkgdir}" dist/*.whl + + # Symlink license file + local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") + install -d ${pkgdir}/usr/share/licenses/${pkgname} + ln -s "${site_packages}/${_base}-${pkgver}.dist-info/LICENSE" \ + "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} |