Files
MINGW-packages/mingw-w64-python-cloudpickle/PKGBUILD
2025-11-04 04:11:07 +01:00

50 lines
2.0 KiB
Bash

# Maintainer: Sarah Ottinger <schalaalexiazeal@gmail.com>
_realname=cloudpickle
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=3.1.2
pkgrel=1
pkgdesc='Extended pickling support for Python objects (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
msys2_references=(
'purl: pkg:pypi/cloudpickle'
)
url="https://github.com/cloudpipe/cloudpickle"
license=('spdx:BSD-3-Clause')
depends=("${MINGW_PACKAGE_PREFIX}-python")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest"
"${MINGW_PACKAGE_PREFIX}-python-psutil"
"${MINGW_PACKAGE_PREFIX}-python-tornado"
"${MINGW_PACKAGE_PREFIX}-python-numpy")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-flit-core")
options=('!emptydirs')
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('7fda9eb655c9c230dab534f1983763de5835249750e85fbcef43aaa30a9a2414')
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}/tests/cloudpickle_testpkg"
${MINGW_PREFIX}/bin/python -m pytest || warning "Tests failed"
cd ../..
PYTHONPATH="$PWD/tests/cloudpickle_testpkg/build/lib/" \
${MINGW_PREFIX}/bin/pytest --deselect tests/cloudpickle_file_test.py::CloudPickleFileTests::test_pickling_special_file_handles \
--deselect tests/cloudpickle_test.py::CloudPickleTest::test_pickling_file_handles \
--deselect tests/cloudpickle_test.py::Protocol2CloudPickleTest::test_pickling_file_handles || warning "Tests failed"
}
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"
}