#20 Fix build with pytest 7.2
Merged 3 months ago by lbalhar. Opened 3 months ago by churchyard.
rpms/ churchyard/python-cffi pytest7.2  into  rawhide

file modified
+1
@@ -1,4 +1,5 @@ 

  /cffi-*.tar.gz

+ /cffi-*.tar.bz2

  /cffi-*/

  /results_python-cffi/

  *.rpm

file added
+5414
The added file is too large to be shown here, see it at: 115.patch
file added
+103
@@ -0,0 +1,103 @@ 

+ From 9c7d865e17ec16a847090a3e0d1498b698b99756 Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

+ Date: Mon, 14 Nov 2022 12:30:12 +0100

+ Subject: [PATCH 1/2] 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/README.md b/README.md

+ index b4b84884..d39d88da 100644

+ --- a/README.md

+ +++ b/README.md

+ @@ -30,7 +30,7 @@ Testing/development tips

+  

+  To run tests under CPython, run::

+  

+ -    pip install pytest py  # if you don't have pytest and py already

+ +    pip install pytest    # if you don't have pytest already

+      pip install pycparser

+      python setup.py build_ext -f -i

+      pytest c/ testing/

+ diff --git a/requirements.txt b/requirements.txt

+ index 881a093f..a97f0282 100644

+ --- a/requirements.txt

+ +++ b/requirements.txt

+ @@ -1,3 +1,2 @@

+  pycparser

+  pytest

+ -py

+ 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

+ 

+ 

+ From 4c1551037965864cfe5494647af014e2390d077c Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

+ Date: Mon, 14 Nov 2022 13:12:31 +0100

+ Subject: [PATCH 2/2] Make the space count consistent with the past

+ 

+ --HG--

+ branch : py.code

+ ---

+  README.md | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/README.md b/README.md

+ index d39d88da..21c82b84 100644

+ --- a/README.md

+ +++ b/README.md

+ @@ -30,7 +30,7 @@ Testing/development tips

+  

+  To run tests under CPython, run::

+  

+ -    pip install pytest    # if you don't have pytest already

+ +    pip install pytest     # if you don't have pytest already

+      pip install pycparser

+      python setup.py build_ext -f -i

+      pytest c/ testing/

+ -- 

+ GitLab

+ 

file modified
+13 -7
@@ -1,15 +1,20 @@ 

  Name:           python-cffi

  %global general_version 1.15.1

  Version:        %{general_version}%{?prerel:~%{prerel}}

- Release:        2%{?dist}

+ Release:        3%{?dist}

  Summary:        Foreign Function Interface for Python to call C code

  License:        MIT

  URL:            https://cffi.readthedocs.org/

- Source0:        %{pypi_source cffi}

+ Source:         https://foss.heptapod.net/pypy/cffi/-/archive/v%{version}/cffi-v%{version}.tar.bz2

  

  # Adjust tests for a last minute Python 3.11 change in the traceback format 

  Patch:          https://foss.heptapod.net/pypy/cffi/-/merge_requests/113.patch

  

+ # Drop usage of the deprecated py.test package

+ Patch:          https://foss.heptapod.net/pypy/cffi/-/merge_requests/115.patch

+ # Drop usage of the deprecated py.code package

+ Patch:          https://foss.heptapod.net/pypy/cffi/-/merge_requests/116.patch

+ 

  BuildRequires:  make

  BuildRequires:  libffi-devel

  BuildRequires:  gcc
@@ -17,8 +22,6 @@ 

  # For tests:

  BuildRequires:  gcc-c++

  

- %?python_enable_dependency_generator

- 

  %description

  Foreign Function Interface for Python, providing a convenient and

  reliable way of calling existing C code from Python. The interface is
@@ -31,7 +34,6 @@ 

  BuildRequires:  python3-devel

  BuildRequires:  python3-setuptools

  BuildRequires:  python3-pycparser

- %{?python_provide:%python_provide python3-cffi}

  

  %description -n python3-cffi

  Foreign Function Interface for Python, providing a convenient and
@@ -46,7 +48,7 @@ 

  Documentation for CFFI, the Foreign Function Interface for Python.

  

  %prep

- %autosetup -p1 -n cffi-%{general_version}%{?prerel}

+ %autosetup -p1 -n cffi-v%{general_version}%{?prerel}

  

  %build

  %py3_build
@@ -62,7 +64,7 @@ 

  PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest c/ testing/

  

  %files -n python3-cffi

- %doc PKG-INFO

+ %doc README.md

  %license LICENSE

  %{python3_sitearch}/cffi/

  %{python3_sitearch}/_cffi_backend.*.so
@@ -72,6 +74,10 @@ 

  %doc doc/build/html

  

  %changelog

+ * Mon Nov 14 2022 Miro Hrončok <mhroncok@redhat.com> - 1.15.1-3

+ - Fix build with pytest 7.2

+ - Fixes: rhbz#2142063

+ 

  * Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.1-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (cffi-1.15.1.tar.gz) = e99cafcb029076abc29e435b490fa0573ee2856f4051b7ca8a5b38cd125d56dd9dae8b189f59ceb3d728a675da8ee83239e09e19f8b0feeddea4b186ab5173a5

+ SHA512 (cffi-v1.15.1.tar.bz2) = 4505c1e3206b66fbdf06ba39be6daac14a35f7148cef3156bb2015792cb59c004ea13fe7c7514feb35ecc5e7526a88fc0b3036ae84fd146a0a3b55bc676e8e51

no initial comment

rebased onto 2ba4713

3 months ago

rebased onto 851909d

3 months ago

1 new commit added

  • Drop deprecated and unneeded %python_provide
3 months ago

1 new commit added

  • Remove unneeded %python_enable_dependency_generator
3 months ago

Both patches are already merged upstream, all other changes look good and it builds fine in rawhide and copr so I'm gonna ship it.

Pull-Request has been merged by lbalhar

3 months ago