Skip to content

Commit

Permalink
Use PEP 517 for building if supported (2/10)
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed Jan 20, 2025
1 parent 497522e commit be6eaae
Show file tree
Hide file tree
Showing 22 changed files with 259 additions and 335 deletions.
4 changes: 2 additions & 2 deletions mingw-w64-python-bleach/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=6.2.0
pkgrel=1
pkgdesc="An easy whitelist-based HTML-sanitizing tool (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://bleach.readthedocs.io/"
msys2_repository_url="/~https://github.com/mozilla/bleach/"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
msys2_references=(
'pypi: bleach'
"cpe: cpe:/a:mozilla:bleach"
Expand Down
2 changes: 1 addition & 1 deletion mingw-w64-python-google-apitools/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pkgver=0.5.32
pkgrel=3
pkgdesc="client libraries for humans (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
msys2_references=(
'pypi: google-apitools'
)
Expand Down
2 changes: 1 addition & 1 deletion mingw-w64-python-h2/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pkgver=4.1.0
pkgrel=4
pkgdesc='HTTP/2 State-Machine based protocol implementation (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('MIT')
url='/~https://github.com/python-hyper/h2'
msys2_references=(
Expand Down
46 changes: 19 additions & 27 deletions mingw-w64-python-html5lib/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,54 @@
_realname=html5lib
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=1.1
pkgrel=5
pkgrel=6
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
pkgdesc="A Python HTML parser/tokenizer based on the WHATWG HTML5 spec (mingw-w64)"
url="/~https://github.com/html5lib"
msys2_references=(
'pypi: html5lib'
"cpe: cpe:2.3:a:html5lib:html5lib"
)
license=('MIT')
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-six"
"${MINGW_PACKAGE_PREFIX}-python-webencodings")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest"
"${MINGW_PACKAGE_PREFIX}-python-lxml"
"${MINGW_PACKAGE_PREFIX}-python-mock")
_test_commit=c305da74fae50fb018870de7a042da36c1a93b65
source=("${_realname}-${pkgver}.tar.gz::https://github.com/html5lib/html5lib-python/archive/${pkgver}.tar.gz"
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz"
"/~https://github.com/html5lib/html5lib-tests/archive/${_test_commit}.tar.gz")
sha256sums=('66e9e24a53c10c27abb6be8a3cf2cf55824c6ea1cef8570a633cb223ec46e894'
sha256sums=('b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f'
'cb261423c644b3469ac66926e290060b481371d0952995d270492fc761d0209a')

prepare() {
cd "${srcdir}"
pushd "${_realname}-python-${pkgver}"
rm -rf html5lib/tests/testdata
cp -r "${srcdir}/html5lib-tests-${_test_commit}" html5lib/tests/testdata
popd

rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-python-${pkgver}" "python-build-${MSYSTEM}"
prepare() {
cd "${srcdir}"/"${_realname}-${pkgver}"
rm -rf html5lib/tests/testdata
cp -r "${srcdir}/html5lib-tests-${_test_commit}" html5lib/tests/testdata
}

build() {
msg2 "Python build for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${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() {
msg2 "Python check for ${CARCH}"
cd "${srcdir}"/python-build-${MSYSTEM}
${MINGW_PREFIX}/bin/py.test

}

package() {
cd "${srcdir}/python-build-${MSYSTEM}"
cd "${srcdir}"/python-build-${MSYSTEM}

MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl

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
install -Dm755 LICENSE "${pkgdir}"${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE
}
32 changes: 14 additions & 18 deletions mingw-w64-python-httplib2/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,47 @@
_realname=httplib2
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.22.0
pkgrel=3
pkgrel=4
pkgdesc="Comprehensive HTTP client library, supporting many features (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('MIT')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="/~https://github.com/httplib2/httplib2"
msys2_references=(
"cpe: cpe:/a:httplib2_project:httplib2"
"pypi: httplib2"
)
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-certifi"
"${MINGW_PACKAGE_PREFIX}-ca-certificates"
"${MINGW_PACKAGE_PREFIX}-python-pyparsing")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=(${_realname}-${pkgver}.tar.gz::/~https://github.com/httplib2/httplib2/archive/v${pkgver}.tar.gz
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=(https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz
cert.patch)
sha256sums=('f0463bc04d2546325eaba1da15f8e45763ed2a52b47c0331c721f1c85470c9ca'
sha256sums=('d7a10bc5ef5ab08322488bde8c726eeee5c8618723fdb399597ec58f3d82df81'
'3503625ade773c17c9c44f4017aec634ff03db0073eb3ec11e6882a466d7aae6')

prepare() {
cd "${srcdir}/${_realname}-${pkgver}"

# Patch, ref FS#40179
patch -p1 -i "${srcdir}/cert.patch"

cd "${srcdir}"
rm -rf "python-build-${MSYSTEM}" | true
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
}

build() {
cd "${srcdir}/python-build-${MSYSTEM}"
${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
}

package() {
cd "${srcdir}/python-build-${MSYSTEM}"
cd "${srcdir}"/python-build-${MSYSTEM}

MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX#\/} --root="${pkgdir}" --optimize=1
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
Expand Down
27 changes: 10 additions & 17 deletions mingw-w64-python-httpretty/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=httpretty
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=1.1.4
pkgrel=4
pkgrel=5
pkgdesc="HTTP client mock for Python (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand All @@ -14,36 +14,29 @@ msys2_references=(
)
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python-urllib3")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('20de0e5dd5a18292d36d928cc3d6e52f8b2ac73daec40d41eb62dee154933b68')

prepare() {
cd "${srcdir}/${_realname}-${pkgver}"

# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}

build() {
cd "${srcdir}"
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"

"${MINGW_PREFIX}"/bin/python setup.py build
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
cd "${srcdir}/python-build-${MSYSTEM}"

"${MINGW_PREFIX}"/bin/python setup.py check
"${MINGW_PREFIX}"/bin/python -m pytest
}

package() {
cd "${srcdir}/python-build-${MSYSTEM}"
cd "${srcdir}"/python-build-${MSYSTEM}

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
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl

install -Dm644 COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/COPYING"
}
33 changes: 15 additions & 18 deletions mingw-w64-python-hyperframe/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,33 @@ _realname=hyperframe
pkgbase=mingw-w64-python-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-python-${_realname}
pkgver=6.0.1
pkgrel=4
pkgrel=5
pkgdesc='Pure-Python HTTP/2 framing (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('MIT')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='/~https://github.com/python-hyper/hyperframe'
msys2_references=(
'pypi: hyperframe'
)
license=('spdx:MIT')
depends=(${MINGW_PACKAGE_PREFIX}-python)
makedepends=(${MINGW_PACKAGE_PREFIX}-python-setuptools)
source=(/~https://github.com/python-hyper/${_realname}/archive/v${pkgver}.tar.gz)
sha256sums=('a126e1e0fb24135aa7ac53cefe11ad197d0c9a5e74f495c1236022b1e578a7a8')

prepare() {
rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
}
makedepends=(${MINGW_PACKAGE_PREFIX}-python-build
${MINGW_PACKAGE_PREFIX}-python-installer
${MINGW_PACKAGE_PREFIX}-python-setuptools)
source=(https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz)
sha256sums=('ae510046231dc8e9ecb1a6586f63d2347bf4c8905914aa84ba585ae85f28a914')

build() {
msg "Python build for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${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
}

package() {
cd "${srcdir}/python-build-${MSYSTEM}"
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}

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"
}
33 changes: 15 additions & 18 deletions mingw-w64-python-hyperlink/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,34 @@ _realname=hyperlink
pkgbase=mingw-w64-python-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-python-${_realname}
pkgver=21.0.0
pkgrel=4
pkgrel=5
pkgdesc='A featureful, immutable, and correct URL for Python (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('MIT')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='/~https://github.com/python-hyper/hyperlink'
msys2_references=(
'pypi: hyperlink'
)
license=('spdx:MIT')
depends=(${MINGW_PACKAGE_PREFIX}-python
${MINGW_PACKAGE_PREFIX}-python-idna)
makedepends=(${MINGW_PACKAGE_PREFIX}-python-setuptools)
source=(/~https://github.com/python-hyper/${_realname}/archive/v${pkgver}.tar.gz)
sha256sums=('6fdef854115f413e5d8a0241e1e67e93f0bd29c1d1317a742f3fdb189e1d57b5')

prepare() {
rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
}
makedepends=(${MINGW_PACKAGE_PREFIX}-python-build
${MINGW_PACKAGE_PREFIX}-python-installer
${MINGW_PACKAGE_PREFIX}-python-setuptools)
source=(https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz)
sha256sums=('427af957daa58bc909471c6c40f74c5450fa123dd093fc53efd2e91d2705a56b')

build() {
msg "Python build for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${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
}

package() {
cd "${srcdir}/python-build-${MSYSTEM}"
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}

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"
}
Loading

0 comments on commit be6eaae

Please sign in to comment.