summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO2
-rw-r--r--.gitignore9
-rw-r--r--PKGBUILD6
-rw-r--r--fix-ruamel-yaml-tests.diff80
-rw-r--r--src.rej78
5 files changed, 169 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 494c98692263..e217697d44b4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = python-pykwalify
pkgdesc = Python lib/cli for JSON/YAML schema validation
pkgver = 1.8.0
- pkgrel = 3
+ pkgrel = 4
url = https://github.com/Grokzen/pykwalify
arch = any
license = MIT
diff --git a/.gitignore b/.gitignore
index a27179663548..1b66bb0334a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
-PKGBUILD
-.SRCINFO
-.gitignore
-*
+pkg/
+src/
+*.pkg.tar.xz
+*.tar.gz
+*.tar.zst
diff --git a/PKGBUILD b/PKGBUILD
index cf85e1447b3f..8a4d6b923a97 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
_name=pykwalify
pkgname=python-pykwalify
pkgver=1.8.0
-pkgrel=3
+pkgrel=4
pkgdesc='Python lib/cli for JSON/YAML schema validation'
arch=('any')
url=https://github.com/Grokzen/pykwalify
@@ -17,6 +17,10 @@ source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_
sha256sums=('796b2ad3ed4cb99b88308b533fb2f559c30fa6efb4fa9fda11347f483d245884')
b2sums=('1593f5e3e15188929574ece60bf6818438258bf024d105ae26323a97a202ac69001a15ca6daaa430970af3659c49da745bcf1f77c23ac72bed2ddca14440d943')
+prepare() {
+ patch -d $srcdir -p1 -i $startdir/fix-ruamel-yaml-tests.diff
+}
+
build() {
cd $_name-$pkgver
python setup.py build
diff --git a/fix-ruamel-yaml-tests.diff b/fix-ruamel-yaml-tests.diff
new file mode 100644
index 000000000000..7a3292e9b534
--- /dev/null
+++ b/fix-ruamel-yaml-tests.diff
@@ -0,0 +1,80 @@
+diff --unified --recursive --text package.orig/pykwalify-1.8.0/tests/test_core.py package.new/pykwalify-1.8.0/tests/test_core.py
+--- package.orig/pykwalify-1.8.0/tests/test_core.py 2020-12-30 06:31:07.000000000 -0700
++++ package.new/pykwalify-1.8.0/tests/test_core.py 2024-03-31 15:54:58.926575787 -0700
+@@ -12,7 +12,7 @@
+
+ # 3rd party imports
+ import pytest
+-from pykwalify.compat import yaml
++from pykwalify.compat import yml
+ from testfixtures import compare
+
+
+@@ -567,7 +567,7 @@
+ for passing_test_file in pass_tests:
+ f = self.f(os.path.join("success", passing_test_file))
+ with open(f, "r") as stream:
+- yaml_data = yaml.safe_load_all(stream)
++ yaml_data = yml.load_all(stream)
+
+ for document_index, document in enumerate(yaml_data):
+ data = document["data"]
+@@ -588,7 +588,7 @@
+ for failing_test, exception_type in _fail_tests:
+ f = self.f(os.path.join("fail", failing_test))
+ with open(f, "r") as stream:
+- yaml_data = yaml.safe_load_all(stream)
++ yaml_data = yml.load_all(stream)
+
+ for document_index, document in enumerate(yaml_data):
+ data = document["data"]
+diff --unified --recursive --text package.orig/pykwalify-1.8.0/tests/test_unicode.py package.new/pykwalify-1.8.0/tests/test_unicode.py
+--- package.orig/pykwalify-1.8.0/tests/test_unicode.py 2020-12-06 13:29:59.000000000 -0700
++++ package.new/pykwalify-1.8.0/tests/test_unicode.py 2024-03-31 15:50:39.926571625 -0700
+@@ -12,7 +12,7 @@
+ from pykwalify.errors import SchemaError
+
+ # 3rd party imports
+-from pykwalify.compat import yaml
++from pykwalify.compat import yml
+ from testfixtures import compare
+
+
+@@ -47,7 +47,8 @@
+ }
+
+ source_f = tmpdir.join(u"2så.json")
+- source_f.write(yaml.safe_dump(fail_data_2s_yaml, allow_unicode=True))
++ with source_f.open('w') as stream:
++ yml.dump(fail_data_2s_yaml, stream)
+
+ _pass_tests = [
+ # Test mapping with unicode key and value
+@@ -65,7 +66,7 @@
+ f = self.f(passing_test_files)
+
+ with open(f, "r") as stream:
+- yaml_data = yaml.safe_load(stream)
++ yaml_data = yml.load(stream)
+ data = yaml_data["data"]
+ schema = yaml_data["schema"]
+
+@@ -102,7 +103,8 @@
+ }
+
+ source_f = tmpdir.join(u"2få.json")
+- source_f.write(yaml.safe_dump(fail_data_2f_yaml, allow_unicode=True))
++ with source_f.open('w') as stream:
++ yml.dump(fail_data_2f_yaml, stream)
+
+ _fail_tests = [
+ # Test mapping with unicode key and value but wrong type
+@@ -120,7 +122,7 @@
+ f = self.f(failing_test)
+
+ with open(f, "r") as stream:
+- yaml_data = yaml.safe_load(stream)
++ yaml_data = yml.load(stream)
+ data = yaml_data["data"]
+ schema = yaml_data["schema"]
+ errors = yaml_data["errors"]
diff --git a/src.rej b/src.rej
new file mode 100644
index 000000000000..fa5c10131f59
--- /dev/null
+++ b/src.rej
@@ -0,0 +1,78 @@
+--- pykwalify-1.8.0/tests/test_core.py 2020-12-30 06:31:07.000000000 -0700
++++ pykwalify-1.8.0/tests/test_core.py 2024-03-31 15:54:58.926575787 -0700
+@@ -12,7 +12,7 @@
+
+ # 3rd party imports
+ import pytest
+-from pykwalify.compat import yaml
++from pykwalify.compat import yml
+ from testfixtures import compare
+
+
+@@ -567,7 +567,7 @@
+ for passing_test_file in pass_tests:
+ f = self.f(os.path.join("success", passing_test_file))
+ with open(f, "r") as stream:
+- yaml_data = yaml.safe_load_all(stream)
++ yaml_data = yml.load_all(stream)
+
+ for document_index, document in enumerate(yaml_data):
+ data = document["data"]
+@@ -588,7 +588,7 @@
+ for failing_test, exception_type in _fail_tests:
+ f = self.f(os.path.join("fail", failing_test))
+ with open(f, "r") as stream:
+- yaml_data = yaml.safe_load_all(stream)
++ yaml_data = yml.load_all(stream)
+
+ for document_index, document in enumerate(yaml_data):
+ data = document["data"]
+--- pykwalify-1.8.0/tests/test_unicode.py 2020-12-06 13:29:59.000000000 -0700
++++ pykwalify-1.8.0/tests/test_unicode.py 2024-03-31 15:50:39.926571625 -0700
+@@ -12,7 +12,7 @@
+ from pykwalify.errors import SchemaError
+
+ # 3rd party imports
+-from pykwalify.compat import yaml
++from pykwalify.compat import yml
+ from testfixtures import compare
+
+
+@@ -47,7 +47,8 @@
+ }
+
+ source_f = tmpdir.join(u"2så.json")
+- source_f.write(yaml.safe_dump(fail_data_2s_yaml, allow_unicode=True))
++ with source_f.open('w') as stream:
++ yml.dump(fail_data_2s_yaml, stream)
+
+ _pass_tests = [
+ # Test mapping with unicode key and value
+@@ -65,7 +66,7 @@
+ f = self.f(passing_test_files)
+
+ with open(f, "r") as stream:
+- yaml_data = yaml.safe_load(stream)
++ yaml_data = yml.load(stream)
+ data = yaml_data["data"]
+ schema = yaml_data["schema"]
+
+@@ -102,7 +103,8 @@
+ }
+
+ source_f = tmpdir.join(u"2få.json")
+- source_f.write(yaml.safe_dump(fail_data_2f_yaml, allow_unicode=True))
++ with source_f.open('w') as stream:
++ yml.dump(fail_data_2f_yaml, stream)
+
+ _fail_tests = [
+ # Test mapping with unicode key and value but wrong type
+@@ -120,7 +122,7 @@
+ f = self.f(failing_test)
+
+ with open(f, "r") as stream:
+- yaml_data = yaml.safe_load(stream)
++ yaml_data = yml.load(stream)
+ data = yaml_data["data"]
+ schema = yaml_data["schema"]
+ errors = yaml_data["errors"]