Skip to content

Commit

Permalink
Use PEP 517 for building if supported (10/10)
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed Jan 20, 2025
1 parent d36d84e commit 9c4daa8
Show file tree
Hide file tree
Showing 20 changed files with 266 additions and 354 deletions.
6 changes: 3 additions & 3 deletions mingw-w64-python-pygments-docs/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ pkgver=2.18.0
pkgrel=1
pkgdesc="Python syntax highlighter (mingw-w64) (documentation)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://pygments.org/"
msys2_repository_url="/~https://github.com/pygments/pygments"
msys2_references=(
'pypi: Pygments'
"cpe: cpe:/a:pygments:pygments"
)
url="https://pygments.org/"
msys2_repository_url="/~https://github.com/pygments/pygments"
license=('spdx:BSD-2-Clause')
makedepends=(
"${MINGW_PACKAGE_PREFIX}-python-sphinx"
Expand Down
3 changes: 1 addition & 2 deletions mingw-w64-python-smartypants/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ build() {
}

check() {
msg "Python test for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py test
${MINGW_PREFIX}/bin/python -m pytest
}

package() {
Expand Down
2 changes: 1 addition & 1 deletion mingw-w64-python-sphinxcontrib-log-cabinet/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build() {

check() {
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py test
${MINGW_PREFIX}/bin/python -m pytest
}

package() {
Expand Down
32 changes: 14 additions & 18 deletions mingw-w64-python-typogrify/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,38 @@ _realname=typogrify
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=2.0.7
pkgrel=6
pkgrel=7
pkgdesc='Filters to enhance web typography, including support for Django & Jinja templates (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="/~https://github.com/mintchaos/typogrify"
msys2_references=(
'pypi: typogrify'
)
url="/~https://github.com/mintchaos/typogrify"
license=('BSD')
license=('spdx:BSD-3-Clause')
depends=(
"${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-smartypants"
)
makedepends=(
"${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
)
source=("${_pyname}-${pkgver}.tar.gz::https://pypi.org/packages/source/${_pyname::1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
source=("https://pypi.org/packages/source/${_pyname::1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
sha256sums=('8be4668cda434163ce229d87ca273a11922cb1614cb359970b7dc96eed13cb38')

prepare() {
cd "$srcdir"
rm -rf python-build-${MSYSTEM} | true
cp -r "${_pyname//_/-}-$pkgver" "python-build-${MSYSTEM}"
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}

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.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
45 changes: 19 additions & 26 deletions mingw-w64-python-ukpostcodeparser/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=ukpostcodeparser
_pyname=UkPostcodeParser
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.2
pkgrel=5
pkgrel=6
pkgdesc="UK Postcode parser (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='/~https://github.com/hamstah/ukpostcodeparser'
license=('MIT')
msys2_references=(
'pypi: UkPostcodeParser'
)
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=("${_realname}-${pkgver}.tar.gz"::"/~https://github.com/hamstah/ukpostcodeparser/archive/v${pkgver}.tar.gz")
sha512sums=('8113522b728c095f937a9f53f21c369130e3e63c4fc3546dbea4ad1c53648742fb0e766b1254c76ee65d69dec585f1a90caa7d39ca540de1765ff5f989a702de')

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

# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=("https://pypi.org/packages/source/${_pyname::1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
sha256sums=('930264efa293db80af0103a4fe9c161b06365598d24bb6fe5403f3f57c70530e')

build() {
msg "Python build for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py build
cp -r "${_pyname}-${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 ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python -m unittest discover -s ukpostcodeparser/test -p '*.py' || warning "Tests failed"
}

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"
}
39 changes: 17 additions & 22 deletions mingw-w64-python-unidecode/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
# Maintainer: Konstantin Podsvirov <konstantin@podsvirov.pro>

_realname=unidecode
_pyname=Unidecode
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=1.3.8
pkgrel=2
pkgrel=3
pkgdesc='ASCII transliterations of Unicode text (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='/~https://github.com/avian2/unidecode'
msys2_references=(
'pypi: unidecode'
'pypi: Unidecode'
)
license=('GPL')
license=('spdx:GPL-2.0-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=("unidecode-unidecode-${pkgver}.tar.gz"::"/~https://github.com/avian2/unidecode/archive/unidecode-${pkgver}.tar.gz")
sha256sums=('1473bf9bb665dae048b851a56e52a8467647f2832df8760e78257f3415aa72eb')

prepare() {
cd "${srcdir}"
rm -rf "python-build-${MSYSTEM}" | true
cp -r "unidecode-unidecode-${pkgver}" "python-build-${MSYSTEM}"
}
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
options=(!strip)
source=("https://pypi.org/packages/source/${_pyname::1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
sha256sums=('cfdb349d46ed3873ece4586b96aa75258726e2fa8ec21d6f00a591d98806c2f4')

build() {
msg "Python build for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py build
cp -r "${_pyname}-${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}" -O1 --skip-build
cd "${srcdir}"/python-build-${MSYSTEM}

for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*-script.py; do
sed -e '1 { s/^#!.*$// }' -i ${_f}
done
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
36 changes: 15 additions & 21 deletions mingw-w64-python-virtualenv-clone/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,37 @@ _realname=virtualenv-clone
pkgbase=mingw-w64-python-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-python-${_realname}
pkgver=0.5.7
pkgrel=4
pkgrel=5
pkgdesc="A script for cloning a non-relocatable virtualenv."
url="/~https://github.com/edwardgeorge/virtualenv-clone"
license=('spdx:MIT')
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="/~https://github.com/edwardgeorge/virtualenv-clone"
msys2_references=(
'pypi: virtualenv-clone'
)
license=('spdx:MIT')
depends=(
${MINGW_PACKAGE_PREFIX}-python
${MINGW_PACKAGE_PREFIX}-python-virtualenv
)
makedepends=(${MINGW_PACKAGE_PREFIX}-python-setuptools)
makedepends=(${MINGW_PACKAGE_PREFIX}-python-build
${MINGW_PACKAGE_PREFIX}-python-installer
${MINGW_PACKAGE_PREFIX}-python-setuptools)
options=(!strip)
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('418ee935c36152f8f153c79824bb93eaf6f0f7984bae31d3f48f350b9183501a')

prepare() {
rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-${pkgver/v/}" "python-build-${MSYSTEM}"
}

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.txt"

for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*-script.py*; do
sed -e '1 { s|^#!.*$|#!/usr/bin/env pythonw.exe|g }' -i ${_f}
done
}
35 changes: 12 additions & 23 deletions mingw-w64-python-wcag-contrast-ratio/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,27 @@ _realname=wcag-contrast-ratio
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=0.9
pkgrel=4
pkgrel=5
pkgdesc="Library for computing contrast ratios, as required by WCAG 2.0 (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='/~https://github.com/gsnedders/wcag-contrast-ratio'
msys2_references=(
'pypi: wcag-contrast-ratio'
)
license=('MIT')
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python"
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-hypothesis")
source=("${_realname}-${pkgver}.tar.gz"::"$url/archive/$pkgver/${_realname}-${pkgver}.tar.gz")
sha256sums=('5263b7b2d0f5a8de2eb409421284947df6229b67bca0055fa10da38153835815')

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

## (OPTIONAL) Only if setuptools-scm is used
# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('69192b8e5c0a7d0dc5ff1187eeb3e398141633a4bde51c69c87f58fe87ed361c')

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() {
Expand All @@ -43,11 +34,9 @@ check() {
}

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}

install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl
}
Loading

0 comments on commit 9c4daa8

Please sign in to comment.