This allows us to include a version and we already use PURL for other things, so might as well remove the pypi special case. Normalize the names, since that is required for PURLs.
53 lines
1.7 KiB
Bash
53 lines
1.7 KiB
Bash
# Maintainer: Peter Budai <peterbudai@hotmail.com>
|
|
|
|
_realname=testpath
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
|
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
pkgver=0.6.0
|
|
pkgrel=3
|
|
pkgdesc="Test utilities for code working with files and commands (mingw-w64)"
|
|
url="https://github.com/jupyter/testpath"
|
|
arch=('any')
|
|
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
msys2_references=(
|
|
'purl: pkg:pypi/testpath'
|
|
)
|
|
license=('MIT')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
|
|
"${MINGW_PACKAGE_PREFIX}-python-installer"
|
|
"${MINGW_PACKAGE_PREFIX}-python-flit-core")
|
|
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
|
|
sha256sums=('2f1b97e6442c02681ebe01bd84f531028a7caea1af3825000f52345c30285e0f')
|
|
|
|
prepare() {
|
|
cd "${srcdir}/${_realname}-${pkgver}"
|
|
rm testpath/cli*.exe
|
|
sed -i 's/shutil.copy(src, dst)/return/' testpath/commands.py
|
|
}
|
|
|
|
build() {
|
|
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
|
|
|
|
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
|
|
}
|
|
|
|
check() {
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
|
|
${MINGW_PREFIX}/bin/python -m pytest
|
|
}
|
|
|
|
package() {
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
|
|
MSYS2_ARG_CONV_EXCL="--prefix=" \
|
|
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
|
|
--destdir="${pkgdir}" dist/*.whl
|
|
|
|
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
|
|
}
|