diff --git a/mingw-w64-python-pyflakes/PKGBUILD b/mingw-w64-python-pyflakes/PKGBUILD index 82bcbfabc3..4e66f05d41 100644 --- a/mingw-w64-python-pyflakes/PKGBUILD +++ b/mingw-w64-python-pyflakes/PKGBUILD @@ -1,7 +1,4 @@ -# Maintainer: Some One -#This value is here because some python package names have capital letters -#while there is a strong preference for lowercase letters in ArchLinux and -#MSYS packages. +# Maintainer: Biswapriyo Nath _realname=pyflakes pkgbase=mingw-w64-python-${_realname} @@ -9,66 +6,39 @@ 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=3.0.1 -pkgrel=2 +pkgver=3.1.0 +pkgrel=1 pkgdesc="A lint-like tool for Python to identify common errors quickly without executing code (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') url='https://pypi.python.org/pypi/pyflakes' -license=('MIT') +license=('spdx:MIT') depends=("${MINGW_PACKAGE_PREFIX}-python") -makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools") -options=('staticlibs' 'strip' '!debug') -source=("https://pypi.io/packages/source/p/pyflakes/pyflakes-${pkgver}.tar.gz") -sha256sums=('ec8b276a6b60bd80defed25add7e439881c19e64850afd9b346283d4165fd0fd') - -# Helper macros to help make tasks easier # -apply_patch_with_msg() { - for _patch in "$@" - do - msg2 "Applying ${_patch}" - patch -Nbp1 -i "${srcdir}/${_patch}" - done -} - -del_file_exists() { - for {_fname} in "$@" - do - if [ -f ${_fname} ]; then - rm -rf ${_fname} - fi - done -} -# =========================================== # - -prepare() { - rm -rf python-build-${CARCH} | true - cp -r "${_realname}-${pkgver}" "python-build-${CARCH}" -} +makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-installer" + "${MINGW_PACKAGE_PREFIX}-python-setuptools" + "${MINGW_PACKAGE_PREFIX}-python-wheel") +checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest") +options=('!strip') +source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz") +sha256sums=('a0aae034c444db0071aa077972ba4768d40c830d9539fd45bf4cd3f8f6992efc') build() { - msg "Python build for ${CARCH}" - cd "${srcdir}/python-build-${CARCH}" - ${MINGW_PREFIX}/bin/python setup.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() { - msg "Python test for ${CARCH}" - cd "${srcdir}/python-build-${CARCH}" - ${MINGW_PREFIX}/bin/python setup.py test + cd "${srcdir}/python-build-${MSYSTEM}" + ${MINGW_PREFIX}/bin/python -m pytest || warning "Tests failed" } package() { - cd "${srcdir}/python-build-${CARCH}" - MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ - ${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} \ - --root="${pkgdir}" --optimize=1 --skip-build + cd "${srcdir}/python-build-${MSYSTEM}" - install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/COPYING" + MSYS2_ARG_CONV_EXCL="--prefix=" \ + ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ + --destdir="${pkgdir}" dist/*.whl - local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) - # fix python command in files - for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do - sed -e "s|${PREFIX_WIN}/bin/|/usr/bin/env |g" -i ${_f} - done + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE" }