Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-ctypeslib2 for 
openSUSE:Factory checked in at 2023-04-26 17:26:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ctypeslib2 (Old)
 and      /work/SRC/openSUSE:Factory/.python-ctypeslib2.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-ctypeslib2"

Wed Apr 26 17:26:23 2023 rev:9 rq:1082938 version:2.3.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ctypeslib2/python-ctypeslib2.changes      
2022-10-14 15:43:27.804010986 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-ctypeslib2.new.1533/python-ctypeslib2.changes
    2023-04-26 17:26:24.837991682 +0200
@@ -1,0 +2,12 @@
+Mon Apr 24 21:34:46 UTC 2023 - Ben Greiner <[email protected]>
+
+- Update to 2.3.4
+  * no release notes
+- Release 2.3.3
+  * be more specific on the warning
+- Upstream released only a wheel not an sdist: use github tarball
+- Drop ctypeslib-pr113-clang2py-h.patch
+- Add ctypeslib2-suse-remove-info-check.patch
+- Restrict to clang15 on Tumbleweed
+
+-------------------------------------------------------------------

Old:
----
  ctypeslib-pr113-clang2py-h.patch
  ctypeslib2-2.3.2.tar.gz

New:
----
  ctypeslib2-2.3.4-gh.tar.gz
  ctypeslib2-suse-remove-info-check.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-ctypeslib2.spec ++++++
--- /var/tmp/diff_new_pack.lcacte/_old  2023-04-26 17:26:25.505995579 +0200
+++ /var/tmp/diff_new_pack.lcacte/_new  2023-04-26 17:26:25.565995929 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-ctypeslib2
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -21,30 +21,37 @@
 %define pythons python3
 # help in the rename from multiflavor to python3 only
 %define primary_python3 python%{python3_version_nodots}
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %ifarch %{ix86} x86_64
 %bcond_without test
 %else
 %bcond_with test
 %endif
+%if 0%{suse_version} >= 1599
+# Tumbleweed default 16 is not compatible
+%define clangmajor 15
+%endif
 Name:           python-ctypeslib2
-Version:        2.3.2
+Version:        2.3.4
 Release:        0
 Summary:        Python FFI toolkit using clang
 License:        MIT
 Group:          Development/Languages/Python
 URL:            https://github.com/trolldbois/ctypeslib
-Source:         
https://files.pythonhosted.org/packages/source/c/ctypeslib2/ctypeslib2-%{version}.tar.gz
-# PATCH-FIX-UPSTREAM ctypeslib-pr113-clang2py-h.patch -- 
gh#trolldbois/ctypeslib#113
-Patch1:         ctypeslib-pr113-clang2py-h.patch
-BuildRequires:  %{python_module clang >= 11}
+Source:         
https://github.com/trolldbois/ctypeslib/archive/refs/tags/%{version}.tar.gz#/ctypeslib2-%{version}-gh.tar.gz
+# PATCH-FIX-OPENSUSE ctypeslib2-suse-remove-info-check.patch 
[email protected], python3-clang does not provide dist- or egg-info, we do not 
use the unofficial pypi package there
+Patch1:         ctypeslib2-suse-remove-info-check.patch
+BuildRequires:  %{python_module clang%{?clangmajor} >= 11}
+BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module pytest}
+BuildRequires:  %{python_module setuptools_scm}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module testsuite}
-BuildRequires:  clang >= 11
+BuildRequires:  %{python_module wheel}
+BuildRequires:  clang%{?clangmajor} >= 11
 BuildRequires:  fdupes
+%{?clangmajor:BuildRequires:  llvm%{?clangmajor}-libclang13}
 BuildRequires:  python-rpm-macros >= 20220610
-Requires:       python-clang >= 11
+Requires:       python-clang%{?clangmajor} >= 11
 Requires(post): update-alternatives
 Requires(postun):update-alternatives
 Provides:       %{primary_python3}-ctypeslib2 = %{version}-%{release}
@@ -56,20 +63,15 @@
 Python FFI toolkit using clang.
 
 %prep
-%autosetup -p1 -n ctypeslib2-%{version}
+%autosetup -p1 -n ctypeslib-%{version}
 sed -i '1{/^#!/d}' ctypeslib/clang2py.py
 
-# avoid pkg_resources/importlib errors because python3-clang does not provide 
an egg-info (even upstream does not)
-sed -i '/clang>=/ d' setup.py
-
-# avoid toml error: gh#trolldbois/ctypeslib#94
-sed -i 's/True/true/' pyproject.toml
-
 %build
-%python_build
+export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
+%pyproject_wheel
 
 %install
-%python_install
+%pyproject_install
 %python_clone -a %{buildroot}%{_bindir}/clang2py
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
@@ -79,8 +81,8 @@
 LDFLAGS="-shared"
 clang $CFLAGS $LDFLAGS -o test/data/test-callbacks.so 
test/data/test-callbacks.c
 
+%python_flavored_alternatives
 export LANG=en_US.UTF-8
-export PATH="$(pwd)/build/bin:$PATH"
 export CPATH=$(clang  -print-resource-dir)/include
 if [ $(getconf LONG_BIT) -eq 32 ]; then
   # not for 32-bit (looks for gnu/stubs-64.h)
@@ -89,7 +91,8 @@
   sed -i 's/test_extern_function_pointer_multiarg/_&/' 
test/test_types_values.py
 fi
 
-%pyunittest discover -s test/ -v
+%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} clang2py --version
+%pyunittest -v test.alltests
 %endif
 
 %post

++++++ ctypeslib2-suse-remove-info-check.patch ++++++
# python3-clang does not provide dist- or egg-info, we do not use the 
unofficial pypi package there
Index: ctypeslib-2.3.4/ctypeslib/__init__.py
===================================================================
--- ctypeslib-2.3.4.orig/ctypeslib/__init__.py
+++ ctypeslib-2.3.4/ctypeslib/__init__.py
@@ -11,7 +11,9 @@ and providing tools for handling errors
 import ctypes
 import os
 import re
+import subprocess
 import sys
+import sysconfig
 import warnings
 from ctypes.util import find_library
 
@@ -114,7 +116,10 @@ try:
     from clang import cindex
     from ctypeslib.codegen.codegenerator import translate, translate_files
 
-    __clang_py_version__ = get_distribution('clang').version
+    purelib = sysconfig.get_path("purelib")
+    __clang_py_version__ = subprocess.check_output(
+        ["rpm", "--query", "--queryformat", "%{version}", "-f", 
f"{purelib}/clang"],
+        text=True)
     __clang_library_filename = __configure_clang_cindex()
     if __clang_library_filename is None:
         warnings.warn("Could not find the clang library. please install llvm 
libclang", RuntimeWarning)
Index: ctypeslib-2.3.4/pyproject.toml
===================================================================
--- ctypeslib-2.3.4.orig/pyproject.toml
+++ ctypeslib-2.3.4/pyproject.toml
@@ -15,7 +15,6 @@ classifiers = [
     "Programming Language :: Python :: 3.8",
     "Topic :: Software Development :: Libraries :: Python Modules",
 ]
-dependencies = ["clang>=11"]
 dynamic = ["version"]
 
 [project.urls]

Reply via email to