David Runge pushed to branch main at Arch Linux / Packaging / Packages / python-schema
Commits: 861a9999 by David Runge at 2024-03-04T14:01:10+01:00 Switch to upstream provided source tarball Signed-off-by: David Runge <dv...@archlinux.org> - - - - - 1a54bf82 by David Runge at 2024-03-04T14:03:36+01:00 Add upstreamed patch to remove use of python-mock Signed-off-by: David Runge <dv...@archlinux.org> - - - - - 53732cea by David Runge at 2024-03-04T14:11:53+01:00 Switch to PEP517 Signed-off-by: David Runge <dv...@archlinux.org> - - - - - d69f0b4d by David Runge at 2024-03-04T14:14:41+01:00 upgpkg: 0.7.5-4 Rebuild to remove python-mock dependency and switch to PEP517. - - - - - 3 changed files: - + .SRCINFO - PKGBUILD - + python-schema-0.7.5-mock.patch Changes: ===================================== .SRCINFO ===================================== @@ -0,0 +1,20 @@ +pkgbase = python-schema + pkgdesc = Python module to validate and convert data structures. + pkgver = 0.7.5 + pkgrel = 4 + url = https://github.com/keleshev/schema + arch = any + license = MIT + checkdepends = python-pytest + makedepends = python-build + makedepends = python-installer + makedepends = python-setuptools + makedepends = python-wheel + depends = python + depends = python-contextlib2 + source = schema-0.7.5.tar.gz::https://github.com/keleshev/schema/archive/refs/tags/v0.7.5.tar.gz + source = python-schema-0.7.5-mock.patch + sha256sums = 9af94571c6c2df01be002a8dcd5efda33a64b08ce2c7fba9646d2a8fe762c8e3 + sha256sums = fa8c47083e9531f6865dfbe61e7f33eddd09b1e40d42cc55b99e3e69a4ce256d + +pkgname = python-schema ===================================== PKGBUILD ===================================== @@ -3,26 +3,38 @@ _name=schema pkgname="python-$_name" pkgver=0.7.5 -pkgrel=3 +pkgrel=4 pkgdesc='Python module to validate and convert data structures.' arch=(any) url="https://github.com/keleshev/$_name" depends=(python python-contextlib2) -makedepends=(python-setuptools) -checkdepends=(python-mock python-pytest) +makedepends=( + python-build + python-installer + python-setuptools + python-wheel +) +checkdepends=(python-pytest) license=(MIT) -source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz) -sha256sums=('f06717112c61895cabc4707752b88716e8420a8819d71404501e114f91043197') +source=( + $_name-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz + $pkgname-0.7.5-mock.patch +) +sha256sums=('9af94571c6c2df01be002a8dcd5efda33a64b08ce2c7fba9646d2a8fe762c8e3' + 'fa8c47083e9531f6865dfbe61e7f33eddd09b1e40d42cc55b99e3e69a4ce256d') prepare() { cd "$srcdir/$_name-$pkgver" # accept arbitrary versions sed 's|==|>=|g' -i requirements.txt + + # remove the use of python-mock + patch -Np1 -i ../$pkgname-0.7.5-mock.patch } build() { cd "$srcdir/$_name-$pkgver" - python setup.py build + python -m build --wheel --no-isolation } check() { @@ -32,7 +44,7 @@ check() { package() { cd "$srcdir/$_name-$pkgver" - python setup.py install --root="$pkgdir/" --optimize=1 --skip-build + python -m installer --destdir="$pkgdir" dist/*.whl install -D -m644 LICENSE-MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } ===================================== python-schema-0.7.5-mock.patch ===================================== @@ -0,0 +1,26 @@ +From 3baf0c3595ab7bb70f920968400947c117d1564d Mon Sep 17 00:00:00 2001 +From: Jelle van der Waa <je...@vdwaa.nl> +Date: Wed, 8 Nov 2023 10:07:25 +0100 +Subject: [PATCH] Make mock test dependency optional for Python > 3.3 + +Since Python 3.3 unittest.mock is available as a build in module. +--- + test_schema.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/test_schema.py b/test_schema.py +index 370298a..0dbaf88 100644 +--- a/test_schema.py ++++ b/test_schema.py +@@ -10,7 +10,10 @@ + from functools import partial + from operator import methodcaller + +-from mock import Mock ++try: ++ from unittest.mock import Mock ++except ImportError: ++ from mock import Mock + from pytest import mark, raises + + from schema import ( View it on GitLab: https://gitlab.archlinux.org/archlinux/packaging/packages/python-schema/-/compare/c93711c4b665a4aaa6dadcb7c3d01a5c56d8269e...d69f0b4d137270527716faed9a7d344f1155c2c5 -- View it on GitLab: https://gitlab.archlinux.org/archlinux/packaging/packages/python-schema/-/compare/c93711c4b665a4aaa6dadcb7c3d01a5c56d8269e...d69f0b4d137270527716faed9a7d344f1155c2c5 You're receiving this email because of your account on gitlab.archlinux.org.