[med-svn] [Git][python-team/packages/mypy][master] Added patch to fix the Python3.12 build with gcc-15. Closes: #1097426

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Tue Feb 18 00:38:29 GMT 2025



Michael R. Crusoe pushed to branch master at Debian Python Team / packages / mypy


Commits:
9e72cfb8 by Michael R. Crusoe at 2025-02-18T01:38:21+01:00
Added patch to fix the Python3.12 build with gcc-15. Closes: #1097426

- - - - -


7 changed files:

- debian/changelog
- + debian/patches/0005-pythoncapi_compat-don-t-define-Py_NULL-if-it-is-alre.patch
- debian/patches/gnu-hurd-getsockname
- debian/patches/hint-typeshed-package
- debian/patches/intersphinx
- debian/patches/series
- debian/patches/verbose


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+mypy (1.15.0-3) UNRELEASED; urgency=medium
+
+  * Added patch to fix the Python3.12 build with gcc-15. Closes:
+    #1097426
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Tue, 18 Feb 2025 01:37:32 +0100
+
 mypy (1.15.0-2.1) unstable; urgency=medium
 
   * Non-maintainer upload.


=====================================
debian/patches/0005-pythoncapi_compat-don-t-define-Py_NULL-if-it-is-alre.patch
=====================================
@@ -0,0 +1,30 @@
+From: "Michael R. Crusoe" <crusoe at debian.org>
+Date: Mon, 17 Feb 2025 19:40:07 +0100
+Subject: pythoncapi_compat: don't define Py_NULL if it is already defined
+
+Forwarded: https://github.com/python/mypy/pull/18699
+
+---
+ mypyc/lib-rt/pythoncapi_compat.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/mypyc/lib-rt/pythoncapi_compat.h b/mypyc/lib-rt/pythoncapi_compat.h
+index cee282d..c49af7a 100644
+--- a/mypyc/lib-rt/pythoncapi_compat.h
++++ b/mypyc/lib-rt/pythoncapi_compat.h
+@@ -33,6 +33,7 @@ extern "C" {
+ #  define _Py_CAST(type, expr) ((type)(expr))
+ #endif
+ 
++#ifndef _Py_NULL
+ // Static inline functions should use _Py_NULL rather than using directly NULL
+ // to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer,
+ // _Py_NULL is defined as nullptr.
+@@ -42,6 +43,7 @@ extern "C" {
+ #else
+ #  define _Py_NULL NULL
+ #endif
++#endif
+ 
+ // Cast argument to PyObject* type.
+ #ifndef _PyObject_CAST


=====================================
debian/patches/gnu-hurd-getsockname
=====================================
@@ -1,4 +1,3 @@
-From 4e2247a672c437da9e8d77a69a378bb61562d9e6 Mon Sep 17 00:00:00 2001
 From: Mattias Ellert <mattias.ellert at physics.uu.se>
 Date: Fri, 7 Feb 2025 15:44:22 +0100
 Subject: [PATCH] GNU/Hurd returns empty string from getsockname() for AF_UNIX
@@ -10,7 +9,7 @@ Build the socket name from directory name and name instead.
  1 file changed, 4 insertions(+)
 
 diff --git a/mypy/ipc.py b/mypy/ipc.py
-index 991f9ac56..b2046a47a 100644
+index 991f9ac..b2046a4 100644
 --- a/mypy/ipc.py
 +++ b/mypy/ipc.py
 @@ -303,6 +303,10 @@ class IPCServer(IPCBase):
@@ -24,6 +23,3 @@ index 991f9ac56..b2046a47a 100644
          else:
              name = self.sock.getsockname()
              assert isinstance(name, str)
--- 
-2.48.1
-


=====================================
debian/patches/hint-typeshed-package
=====================================
@@ -6,13 +6,16 @@ Co-authored-by: Markus Demleitner <msdemlei at fsfe.org>
 Forwarded: not-needed
 ---
  mypy/modulefinder.py                     | 4 +++-
- test-data/unit/check-modules.test        | 4 ++--
+ test-data/unit/check-errorcodes.test     | 2 +-
+ test-data/unit/check-modules.test        | 2 +-
  test-data/unit/fine-grained-modules.test | 4 ++--
- 3 files changed, 7 insertions(+), 5 deletions(-)
+ 4 files changed, 7 insertions(+), 5 deletions(-)
 
---- mypy.orig/mypy/modulefinder.py
-+++ mypy/mypy/modulefinder.py
-@@ -102,7 +102,9 @@
+diff --git a/mypy/modulefinder.py b/mypy/modulefinder.py
+index 61dbb6c..8b9e5ff 100644
+--- a/mypy/modulefinder.py
++++ b/mypy/modulefinder.py
+@@ -102,7 +102,9 @@ class ModuleNotFoundReason(Enum):
              notes = [doc_link]
          elif self is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED:
              msg = 'Library stubs not installed for "{module}"'
@@ -23,9 +26,24 @@ Forwarded: not-needed
              if not daemon:
                  notes.append(
                      '(or run "mypy --install-types" to install all missing stub packages)'
---- mypy.orig/test-data/unit/check-modules.test
-+++ mypy/test-data/unit/check-modules.test
-@@ -3130,7 +3130,7 @@
+diff --git a/test-data/unit/check-errorcodes.test b/test-data/unit/check-errorcodes.test
+index 2940386..eec7649 100644
+--- a/test-data/unit/check-errorcodes.test
++++ b/test-data/unit/check-errorcodes.test
+@@ -523,7 +523,7 @@ if int() is str():  # E: Non-overlapping identity check (left operand type: "int
+ 
+ [case testErrorCodeMissingModule]
+ from defusedxml import xyz  # E: Library stubs not installed for "defusedxml"  [import-untyped] \
+-                            # N: Hint: "python3 -m pip install types-defusedxml" \
++                            # N: Hint: On Debian systems, you can install the python3-typeshed package to provide mypy with stubs for many popular libraries. In virtual Python environments, you can instead run "python3 -m pip install types-defusedxml". \
+                             # N: (or run "mypy --install-types" to install all missing stub packages)
+ from nonexistent import foobar  # E: Cannot find implementation or library stub for module named "nonexistent"  [import-not-found]
+ import nonexistent2  # E: Cannot find implementation or library stub for module named "nonexistent2"  [import-not-found]
+diff --git a/test-data/unit/check-modules.test b/test-data/unit/check-modules.test
+index bee0984..e4e9f56 100644
+--- a/test-data/unit/check-modules.test
++++ b/test-data/unit/check-modules.test
+@@ -3130,7 +3130,7 @@ import google.non_existent  # E: Cannot find implementation or library stub for
  from google.non_existent import x
  
  import google.cloud.ndb  # E: Library stubs not installed for "google.cloud.ndb" \
@@ -34,9 +52,11 @@ Forwarded: not-needed
                           # N: (or run "mypy --install-types" to install all missing stub packages) \
                           # N: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
  from google.cloud import ndb
---- mypy.orig/test-data/unit/fine-grained-modules.test
-+++ mypy/test-data/unit/fine-grained-modules.test
-@@ -2199,12 +2199,12 @@
+diff --git a/test-data/unit/fine-grained-modules.test b/test-data/unit/fine-grained-modules.test
+index f28dbaa..6273fbf 100644
+--- a/test-data/unit/fine-grained-modules.test
++++ b/test-data/unit/fine-grained-modules.test
+@@ -2199,12 +2199,12 @@ import requests
  import jack
  [out]
  a.py:1: error: Library stubs not installed for "requests"
@@ -51,14 +71,3 @@ Forwarded: not-needed
  a.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
  
  [case testIgnoreErrorsFromTypeshed]
---- mypy.orig/test-data/unit/check-errorcodes.test
-+++ mypy/test-data/unit/check-errorcodes.test
-@@ -523,7 +523,7 @@
- 
- [case testErrorCodeMissingModule]
- from defusedxml import xyz  # E: Library stubs not installed for "defusedxml"  [import-untyped] \
--                            # N: Hint: "python3 -m pip install types-defusedxml" \
-+                            # N: Hint: On Debian systems, you can install the python3-typeshed package to provide mypy with stubs for many popular libraries. In virtual Python environments, you can instead run "python3 -m pip install types-defusedxml". \
-                             # N: (or run "mypy --install-types" to install all missing stub packages)
- from nonexistent import foobar  # E: Cannot find implementation or library stub for module named "nonexistent"  [import-not-found]
- import nonexistent2  # E: Cannot find implementation or library stub for module named "nonexistent2"  [import-not-found]


=====================================
debian/patches/intersphinx
=====================================
@@ -7,9 +7,11 @@ Forwarded: not-needed
  docs/source/conf.py | 13 ++++++++-----
  1 file changed, 8 insertions(+), 5 deletions(-)
 
---- mypy.orig/docs/source/conf.py
-+++ mypy/docs/source/conf.py
-@@ -276,11 +276,14 @@
+diff --git a/docs/source/conf.py b/docs/source/conf.py
+index 79a5c06..8d2b84e 100644
+--- a/docs/source/conf.py
++++ b/docs/source/conf.py
+@@ -276,11 +276,14 @@ texinfo_documents = [
  rst_prolog = ".. |...| unicode:: U+2026   .. ellipsis\n"
  
  intersphinx_mapping = {


=====================================
debian/patches/series
=====================================
@@ -2,3 +2,4 @@ hint-typeshed-package
 verbose
 intersphinx
 gnu-hurd-getsockname
+0005-pythoncapi_compat-don-t-define-Py_NULL-if-it-is-alre.patch


=====================================
debian/patches/verbose
=====================================
@@ -7,9 +7,11 @@ Forwarded: not-needed
  setup.py | 1 +
  1 file changed, 1 insertion(+)
 
---- mypy.orig/setup.py
-+++ mypy/setup.py
-@@ -152,6 +152,7 @@
+diff --git a/setup.py b/setup.py
+index e995068..4a41da6 100644
+--- a/setup.py
++++ b/setup.py
+@@ -152,6 +152,7 @@ if USE_MYPYC:
          # Use multi-file compilation mode on windows because without it
          # our Appveyor builds run out of memory sometimes.
          multi_file=sys.platform == "win32" or force_multifile,



View it on GitLab: https://salsa.debian.org/python-team/packages/mypy/-/commit/9e72cfb88e5dc11397aae13e36bb963f08b7b852

-- 
View it on GitLab: https://salsa.debian.org/python-team/packages/mypy/-/commit/9e72cfb88e5dc11397aae13e36bb963f08b7b852
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20250218/1af58e20/attachment-0001.htm>


More information about the debian-med-commit mailing list