Subject: [bug#66397] [PATCH 1/3] gnu: Fix python-tortoise-orm's sanity-check.

From: Giacomo Leidi <[email-masked]>
Date: Sat, 7 Oct 2023 23:39:36 +0200

* gnu/packages/databases.scm (python-aiosqlite-0.17): New variable;
(python-tortoise-orm)[propagated-inputs]: use it.
---
 gnu/packages/databases.scm | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index b5077583c3..f458af2e1a 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -3087,7 +3087,7 @@ (define-public python-tortoise-orm
     (arguments '(#:tests? #f))
     (propagated-inputs
      (list python-aiomysql
-           python-aiosqlite
+           python-aiosqlite-0.17
            python-asyncmy
            python-asyncpg
            python-ciso8601
@@ -3777,6 +3777,34 @@ (define-public python-aiosqlite
 managers for automatically closing connections.")
     (license license:expat)))
 
+(define-public python-aiosqlite-0.17
+  (package
+    (inherit python-aiosqlite)
+    (version "0.17.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/omnilib/aiosqlite")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name (package-name python-aiosqlite)
+                                        version))
+              (sha256
+               (base32
+                "1agh7b9g7rgryvb8flph85i8m80ai1rinpljxzlsrs0s0y616qgg"))))
+    (build-system pyproject-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (if tests?
+                          (invoke "python" "-m" "unittest" "aiosqlite.tests")
+                          (format #t "test suite not run~%"))
+                      #t)))))
+    (propagated-inputs
+     (list python-typing-extensions))
+    (native-inputs
+     (list python-flit-core python-aiounittest))))
+
 (define-public python-databases
   (package
     (name "python-databases")

base-commit: 00a28bc435606dc98925fbae1ebe314881f35c90
-- 
2.41.0