Skip to content
Snippets Groups Projects
Verified Commit 2228ab65 authored by Carl Smedstad's avatar Carl Smedstad
Browse files

upgpkg: 0.7.7-1: Upstream release

parent 00ce4fb5
No related branches found
No related tags found
No related merge requests found
pkgbase = python-schema
pkgdesc = Python module to validate and convert data structures.
pkgver = 0.7.5
pkgrel = 6
pkgdesc = Schema validation just got Pythonic
pkgver = 0.7.7
pkgrel = 1
url = https://github.com/keleshev/schema
arch = any
license = MIT
......@@ -11,11 +11,7 @@ pkgbase = python-schema
makedepends = python-setuptools
makedepends = python-wheel
depends = python
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
source = drop-contextlib2.patch
sha256sums = 9af94571c6c2df01be002a8dcd5efda33a64b08ce2c7fba9646d2a8fe762c8e3
sha256sums = fa8c47083e9531f6865dfbe61e7f33eddd09b1e40d42cc55b99e3e69a4ce256d
sha256sums = 8d90f933d7372d268b329ee8d6ca8ec843fef5826f752e57acb5f9238b5f76e3
source = python-schema-0.7.7.tar.gz::https://github.com/keleshev/schema/archive/v0.7.7.tar.gz
sha256sums = 5c2fbedb393646aaaaee5dd3098810418a2ed0d7a70294102196a4f6b8e07801
pkgname = python-schema
[python-schema]
source = "git"
git = "https://github.com/keleshev/schema.git"
prefix = "v"
source = "pypi"
pypi = "schema"
# Maintainer: Florian Pritz <bluewind@xinu.at>
_name=schema
pkgname="python-$_name"
pkgver=0.7.5
pkgrel=6
pkgdesc='Python module to validate and convert data structures.'
# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Contributor: Florian Pritz <bluewind@xinu.at>
pkgname="python-schema"
_pkgname=${pkgname#python-}
pkgver=0.7.7
pkgrel=1
pkgdesc="Schema validation just got Pythonic"
arch=(any)
url="https://github.com/keleshev/$_name"
url="https://github.com/keleshev/schema"
license=(MIT)
depends=(python)
makedepends=(
python-build
......@@ -15,42 +17,21 @@ makedepends=(
python-wheel
)
checkdepends=(python-pytest)
license=(MIT)
source=(
$_name-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz
$pkgname-0.7.5-mock.patch
drop-contextlib2.patch
)
sha256sums=('9af94571c6c2df01be002a8dcd5efda33a64b08ce2c7fba9646d2a8fe762c8e3'
'fa8c47083e9531f6865dfbe61e7f33eddd09b1e40d42cc55b99e3e69a4ce256d'
'8d90f933d7372d268b329ee8d6ca8ec843fef5826f752e57acb5f9238b5f76e3')
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
# remove contextlib2 requirement provided by Python since 3.3
patch -Np1 -i ../drop-contextlib2.patch
}
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('5c2fbedb393646aaaaee5dd3098810418a2ed0d7a70294102196a4f6b8e07801')
build() {
cd "$srcdir/$_name-$pkgver"
cd "$_pkgname-$pkgver"
python -m build --wheel --no-isolation
}
check() {
cd "$srcdir/$_name-$pkgver"
cd "$_pkgname-$pkgver"
pytest
}
package() {
cd "$srcdir/$_name-$pkgver"
cd "$_pkgname-$pkgver"
python -m installer --destdir="$pkgdir" dist/*.whl
install -D -m644 LICENSE-MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE-MIT
}
# vim: ts=2 sw=2 et:
From e446ee43919b0adfefd27ec04b2485a40bc77879 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= <github@dotlambda.de>
Date: Sat, 4 Feb 2023 23:07:37 -0800
Subject: [PATCH] only require contextlib2 on Python < 3.3
contextlib.ExitStack was added in Python 3.3
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 22f593a..4c1eafd 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1 +1 @@
-contextlib2>=0.5.5
+contextlib2>=0.5.5; python_version < "3.3"
From 3baf0c3595ab7bb70f920968400947c117d1564d Mon Sep 17 00:00:00 2001
From: Jelle van der Waa <jelle@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 (
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment