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.
54 lines
2.0 KiB
Bash
54 lines
2.0 KiB
Bash
# Contributor: Mehdi Chinoune <mehdi.chinoune@hotmail.com>
|
|
|
|
_realname=structlog
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
|
pkgver=25.1.0
|
|
pkgrel=1
|
|
pkgdesc="Structured Logging for Python (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
url="https://www.structlog.org/"
|
|
msys2_repository_url="https://github.com/hynek/structlog/"
|
|
msys2_references=(
|
|
'archlinux: python-structlog'
|
|
'purl: pkg:pypi/structlog'
|
|
)
|
|
license=('spdx:Apache-2.0 OR MIT')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
|
|
"${MINGW_PACKAGE_PREFIX}-python-installer"
|
|
"${MINGW_PACKAGE_PREFIX}-python-hatchling"
|
|
"${MINGW_PACKAGE_PREFIX}-python-hatch-vcs"
|
|
"${MINGW_PACKAGE_PREFIX}-python-hatch-fancy-pypi-readme")
|
|
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-freezegun"
|
|
"${MINGW_PACKAGE_PREFIX}-python-pretend"
|
|
"${MINGW_PACKAGE_PREFIX}-python-pytest-asyncio"
|
|
"${MINGW_PACKAGE_PREFIX}-python-pytest"
|
|
"${MINGW_PACKAGE_PREFIX}-python-simplejson")
|
|
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
|
|
sha256sums=('2ef2a572e0e27f09664965d31a576afe64e46ac6084ef5cec3c2b8cd6e4e3ad3')
|
|
|
|
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 || 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-APACHE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE-APACHE"
|
|
install -Dm644 LICENSE-MIT "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE-MIT"
|
|
}
|