Date: Thursday, April 13, 2023 @ 04:08:45
  Author: felixonmars
Revision: 474009

upgpkg: python-cffi 1.15.1-3: rebuild with python 3.11

Added:
  python-cffi/trunk/python-cffi-remove-py-usage.patch
Modified:
  python-cffi/trunk/PKGBUILD

-----------------------------------+
 PKGBUILD                          |   25 ++++++++++++----
 python-cffi-remove-py-usage.patch |   54 ++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-04-13 03:58:04 UTC (rev 474008)
+++ PKGBUILD    2023-04-13 04:08:45 UTC (rev 474009)
@@ -3,7 +3,7 @@
 
 pkgname=python-cffi
 pkgver=1.15.1
-pkgrel=2
+pkgrel=3
 pkgdesc="Foreign Function Interface for Python calling C code"
 arch=('x86_64')
 url="https://cffi.readthedocs.org/";
@@ -11,16 +11,29 @@
 depends=('python-pycparser')
 makedepends=('python-setuptools')
 checkdepends=('python-pytest-runner')
-source=("https://foss.heptapod.net/pypy/cffi/-/archive/v$pkgver/cffi-v$pkgver.tar.bz2";)
-sha512sums=('4505c1e3206b66fbdf06ba39be6daac14a35f7148cef3156bb2015792cb59c004ea13fe7c7514feb35ecc5e7526a88fc0b3036ae84fd146a0a3b55bc676e8e51')
+source=("https://foss.heptapod.net/pypy/cffi/-/archive/v$pkgver/cffi-v$pkgver.tar.bz2";
+        $pkgname-remove-py-usage.patch
+        
$pkgname-remove-py-test-usage.patch::https://foss.heptapod.net/pypy/cffi/-/merge_requests/115.patch
+        
$pkgname-python-3.11.patch::https://foss.heptapod.net/pypy/cffi/-/commit/8a3c2c816d789639b49d3ae867213393ed7abdff.patch)
+sha512sums=('4505c1e3206b66fbdf06ba39be6daac14a35f7148cef3156bb2015792cb59c004ea13fe7c7514feb35ecc5e7526a88fc0b3036ae84fd146a0a3b55bc676e8e51'
+            
'3b3c0b34719704cb593919ed50af1eaee29db45b1e3c942c3ca4e0ceebfd263c0bb9ca3703fae19929ed5622ecb78969d89d2d6e32719c5b67f20e7b55548116'
+            
'bb5707330a30f9f66ab9bf642b8cc74adee61e3b0f4b5dababde8cc1d5637e946e327e9358dbb83ecad49db4a1457ea76d79b6465708464d3e8571993553410d'
+            
'c4b675c96f931fb9177701830c41da9354f2e2875d31723a759aa35c4e975003ade23ed72dab18065a3437db660863b2ce4f91c15a24e983cd927426a1fc4199')
 
+prepare() {
+  cd cffi-v$pkgver
+  patch -p1 -i ../$pkgname-remove-py-test-usage.patch
+  patch -p1 -i ../$pkgname-remove-py-usage.patch
+  patch -p1 -i ../$pkgname-python-3.11.patch
+}
+
 build() {
-  cd "$srcdir"/cffi-v$pkgver
+  cd cffi-v$pkgver
   python setup.py build
 }
 
 check() {
-  cd "$srcdir"/cffi-v$pkgver
+  cd cffi-v$pkgver
   python setup.py pytest
 }
 
@@ -31,5 +44,5 @@
   rm -rf testing/cffi{0,1}/__pycache__/
 
   python setup.py install --root="$pkgdir" --optimize=1
-  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
 }

Added: python-cffi-remove-py-usage.patch
===================================================================
--- python-cffi-remove-py-usage.patch                           (rev 0)
+++ python-cffi-remove-py-usage.patch   2023-04-13 04:08:45 UTC (rev 474009)
@@ -0,0 +1,54 @@
+From 9c7d865e17ec16a847090a3e0d1498b698b99756 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <[email protected]>
+Date: Mon, 14 Nov 2022 12:30:12 +0100
+Subject: [PATCH] Drop py.code usage from tests, no longer depend on the
+ deprecated py package
+
+--HG--
+branch : py.code
+---
+ README.md                                     | 2 +-
+ requirements.txt                              | 1 -
+ testing/cffi0/test_zintegration.py            | 3 ++-
+ testing/cffi1/test_dlopen_unicode_literals.py | 4 ++--
+ 4 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/testing/cffi0/test_zintegration.py 
b/testing/cffi0/test_zintegration.py
+index d6a02ce0..ca2d4642 100644
+--- a/testing/cffi0/test_zintegration.py
++++ b/testing/cffi0/test_zintegration.py
+@@ -1,5 +1,6 @@
+ import py, os, sys, shutil
+ import subprocess
++import textwrap
+ from testing.udir import udir
+ import pytest
+ 
+@@ -66,7 +67,7 @@ def really_run_setup_and_program(dirname, 
venv_dir_and_paths, python_snippet):
+         remove(os.path.join(basedir, '__pycache__'))
+     olddir = os.getcwd()
+     python_f = udir.join('x.py')
+-    python_f.write(py.code.Source(python_snippet))
++    python_f.write(textwrap.dedent(python_snippet))
+     try:
+         os.chdir(str(SNIPPET_DIR.join(dirname)))
+         if os.name == 'nt':
+diff --git a/testing/cffi1/test_dlopen_unicode_literals.py 
b/testing/cffi1/test_dlopen_unicode_literals.py
+index e792866e..dc955a57 100644
+--- a/testing/cffi1/test_dlopen_unicode_literals.py
++++ b/testing/cffi1/test_dlopen_unicode_literals.py
+@@ -1,4 +1,4 @@
+-import py, os
++import os
+ 
+ s = """from __future__ import unicode_literals
+ """
+@@ -6,4 +6,4 @@ s = """from __future__ import unicode_literals
+ with open(os.path.join(os.path.dirname(__file__), 'test_dlopen.py')) as f:
+     s += f.read()
+ 
+-exec(py.code.compile(s))
++exec(compile(s, filename='test_dlopen.py', mode='exec'))
+-- 
+GitLab
+

Reply via email to