GNU bug report logs - #69260
[PATCH 0/3] Fix python-mysqlclient segfault

Previous Next

Package: guix-patches;

Reported by: rimarko <at> libero.it

Date: Sun, 18 Feb 2024 22:11:01 UTC

Severity: normal

Tags: patch

Done: Hilton Chain <hako <at> ultrarare.space>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 69260 <at> debbugs.gnu.org (full text, mbox):

From: rimarko <at> libero.it
To: 69260 <at> debbugs.gnu.org
Cc: Marco Rimoldi <rimarko <at> libero.it>
Subject: [PATCH 1/3] gnu: python-mysqlclient: Enable selected tests.
Date: Sun, 18 Feb 2024 23:12:05 +0100
From: Marco Rimoldi <rimarko <at> libero.it>

* gnu/packages/databases.scm (python-mysqlclient)
[build-system]: Change to pyproject-build-system.
[arguments]
<#:phases>: Add 'fix-test phase.
<#:test-flags>: Specify tests to run.
[native-inputs]: Add python-pytest.
[homepage]: Updated.

Change-Id: I5ae0873155f9a7cc90a318762b77864665fadc01
---
 gnu/packages/databases.scm | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 5169795404..4bb992c97c 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -4155,15 +4155,24 @@ (define-public python-mysqlclient
        (method url-fetch)
        (uri (pypi-uri "mysqlclient" version))
        (sha256
-        (base32
-         "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
-    (build-system python-build-system)
-    (arguments '(#:tests? #f))          ;XXX: requires a live database
-    (inputs
-     `(("mysql-dev" ,mariadb "dev")))
-    (home-page "https://github.com/PyMySQL/mysqlclient-python")
-    (synopsis "MySQLdb is an interface to the popular MySQL database server for Python")
-    (description "MySQLdb is an interface to the popular MySQL database server
+        (base32 "1rf5l8hazs3v18hmcrm90z3hi9wxv553ipwd5l6kj8j7l6p7abzv"))))
+    (build-system pyproject-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-before 'check 'fix-test
+                    (lambda _
+                      (substitute* "tests/test_MySQLdb_times.py"
+                        (("^import mock")
+                         "from unittest import mock")))))
+       #:test-flags '("tests/test__mysql.py" ;tests not needing a live db
+                      "tests/test_MySQLdb_times.py")))
+    (native-inputs (list python-pytest))
+    (inputs `(("mysql-dev" ,mariadb "dev")))
+    (home-page "https://github.com/PyMySQL/mysqlclient")
+    (synopsis
+     "MySQLdb is an interface to the popular MySQL database server for Python")
+    (description
+     "MySQLdb is an interface to the popular MySQL database server
 for Python.  The design goals are:
 @enumerate
 @item Compliance with Python database API version 2.0 [PEP-0249],
-- 
2.41.0





This bug report was last modified 1 year and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.