Carl Smedstad pushed to branch main at Arch Linux / Packaging / Packages / 
python-jose


Commits:
abc31618 by Carl Smedstad at 2024-10-07T05:54:23+02:00
Avoid modifying setup.py by supplying --skip-dependency-check to build

- - - - -
c5ab9e55 by Carl Smedstad at 2024-10-07T06:06:22+02:00
Patch to fix failing tests in test_ec_compat.py

Tests are failing due to certificate comparisons diffing on newlines
only. Fix by normalizing certificates by removing all newlines before
comparing.

- - - - -
2b9af11e by Carl Smedstad at 2024-10-07T06:09:13+02:00
upgpkg: 3.3.0-8: Drop unneeded checkdep python-pytest-cov

https://archlinux.org/todo/drop-python-pytest-cov-dependency-if-unneeded/

- - - - -


3 changed files:

- .SRCINFO
- PKGBUILD
- + fix-test-ec-compat.patch


Changes:

=====================================
.SRCINFO
=====================================
@@ -1,13 +1,12 @@
 pkgbase = python-jose
        pkgdesc = A JOSE implementation in Python
        pkgver = 3.3.0
-       pkgrel = 7
+       pkgrel = 8
        url = https://github.com/mpdavis/python-jose
        arch = any
        license = MIT
        checkdepends = python-cryptography
        checkdepends = python-pycryptodome
-       checkdepends = python-pytest-cov
        checkdepends = python-pytest
        makedepends = python-setuptools
        makedepends = python-build
@@ -15,10 +14,11 @@ pkgbase = python-jose
        makedepends = python-wheel
        depends = python-rsa
        depends = python-ecdsa
-       depends = python-future
        optdepends = python-cryptography: one option for better performance
        optdepends = python-pycryptodome: one option for better performance
        source = 
https://github.com/mpdavis/python-jose/archive/3.3.0/python-jose-3.3.0.tar.gz
+       source = fix-test-ec-compat.patch
        sha512sums = 
de7147cc6e12406d6e459c32829acae46395acba727c53e65bc05f4794ee3050eecd355e3ae2e87f4ebdbd871f53822eea08a10f25d7ca6088fc6128dc7d9637
+       sha512sums = 
32e57e1d403aac51c7d3044592ff5aaa2e611227d0cc93c270d08a201c4df7e98d3ae4e581b93d865e448d75d8cf78cff9896a8bd1ba4c2f622026e9b7a407b4
 
 pkgname = python-jose


=====================================
PKGBUILD
=====================================
@@ -2,7 +2,7 @@
 
 pkgname=python-jose
 pkgver=3.3.0
-pkgrel=7
+pkgrel=8
 pkgdesc="A JOSE implementation in Python"
 arch=('any')
 license=('MIT')
@@ -11,18 +11,20 @@ depends=('python-rsa' 'python-ecdsa')
 optdepends=('python-cryptography: one option for better performance'
             'python-pycryptodome: one option for better performance')
 makedepends=('python-setuptools' 'python-build' 'python-installer' 
'python-wheel')
-checkdepends=('python-cryptography' 'python-pycryptodome' 'python-pytest-cov' 
'python-pytest')
-source=("https://github.com/mpdavis/python-jose/archive/$pkgver/$pkgname-$pkgver.tar.gz";)
-sha512sums=('de7147cc6e12406d6e459c32829acae46395acba727c53e65bc05f4794ee3050eecd355e3ae2e87f4ebdbd871f53822eea08a10f25d7ca6088fc6128dc7d9637')
+checkdepends=('python-cryptography' 'python-pycryptodome' 'python-pytest')
+source=("https://github.com/mpdavis/python-jose/archive/$pkgver/$pkgname-$pkgver.tar.gz";
+        "fix-test-ec-compat.patch")
+sha512sums=('de7147cc6e12406d6e459c32829acae46395acba727c53e65bc05f4794ee3050eecd355e3ae2e87f4ebdbd871f53822eea08a10f25d7ca6088fc6128dc7d9637'
+            
'32e57e1d403aac51c7d3044592ff5aaa2e611227d0cc93c270d08a201c4df7e98d3ae4e581b93d865e448d75d8cf78cff9896a8bd1ba4c2f622026e9b7a407b4')
 
 prepare() {
   cd python-jose-$pkgver
-  sed -i '/"pytest-runner",/d' setup.py
+  patch -Np1 < ../fix-test-ec-compat.patch
 }
 
 build() {
   cd python-jose-$pkgver
-  python -m build --wheel --no-isolation
+  python -m build --wheel --no-isolation --skip-dependency-check
 }
 
 check() {


=====================================
fix-test-ec-compat.patch
=====================================
@@ -0,0 +1,36 @@
+diff --unified --recursive --text --new-file 
python-jose-3.3.0.orig/tests/algorithms/test_EC_compat.py 
python-jose-3.3.0/tests/algorithms/test_EC_compat.py
+--- python-jose-3.3.0.orig/tests/algorithms/test_EC_compat.py  2024-10-07 
06:03:56.068570898 +0200
++++ python-jose-3.3.0/tests/algorithms/test_EC_compat.py       2024-10-07 
06:04:13.065247305 +0200
+@@ -37,7 +37,7 @@
+         key = BackendFrom(private_key, ALGORITHMS.ES256)
+         key2 = BackendTo(private_key, ALGORITHMS.ES256)
+ 
+-        assert key.public_key().to_pem().strip() == 
key2.public_key().to_pem().strip()
++        assert key.public_key().to_pem().strip().replace(b'\n', b'') == 
key2.public_key().to_pem().strip().replace(b'\n', b'')
+ 
+     @pytest.mark.parametrize("BackendFrom", [ECDSAECKey, CryptographyECKey])
+     @pytest.mark.parametrize("BackendTo", [ECDSAECKey, CryptographyECKey])
+@@ -45,7 +45,7 @@
+         key = BackendFrom(private_key, ALGORITHMS.ES256)
+         key2 = BackendTo(private_key, ALGORITHMS.ES256)
+ 
+-        assert key.to_pem().strip() == key2.to_pem().strip()
++        assert key.to_pem().strip().replace(b'\n', b'') == 
key2.to_pem().strip().replace(b'\n', b'')
+ 
+     @pytest.mark.parametrize("BackendFrom", [ECDSAECKey, CryptographyECKey])
+     @pytest.mark.parametrize("BackendTo", [ECDSAECKey, CryptographyECKey])
+@@ -57,7 +57,7 @@
+ 
+         pub_target = BackendTo(pub_pem_source, ALGORITHMS.ES256)
+ 
+-        assert pub_pem_source == pub_target.to_pem().strip()
++        assert pub_pem_source.replace(b'\n', b'') == 
pub_target.to_pem().strip().replace(b'\n', b'')
+ 
+     @pytest.mark.parametrize("BackendFrom", [ECDSAECKey, CryptographyECKey])
+     @pytest.mark.parametrize("BackendTo", [ECDSAECKey, CryptographyECKey])
+@@ -68,4 +68,4 @@
+ 
+         target = BackendTo(pem_source, ALGORITHMS.ES256)
+ 
+-        assert pem_source == target.to_pem().strip()
++        assert pem_source.replace(b'\n', b'') == 
target.to_pem().strip().replace(b'\n', b'')



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/python-jose/-/compare/b7f15a92bd20416b0955f6b26c1c46028736241b...2b9af11e91fd901d94e7a53919ed14410789c3a2

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/python-jose/-/compare/b7f15a92bd20416b0955f6b26c1c46028736241b...2b9af11e91fd901d94e7a53919ed14410789c3a2
You're receiving this email because of your account on gitlab.archlinux.org.


Reply via email to