gnu: python-asyncmy: Update to 0.2.10.

* gnu/packages/databases.scm (python-asyncmy): Update to 0.2.10.
[source]: Switch to git-fetch.
[build-system]: Switch to pyproject-build-system.
[arguments]<#:tests?>: Disable them for now.
<#:phases>: Replace 'check phase. Add a 'cleanup phase.
[native-inputs]: Add mysql, python-poetry-core, python-pytest,
python-pytest-asyncio, python-setuptools, python-wheel.

Change-Id: I759a85d29372b0d50c2d8992ee303724b7462958
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves 2025-07-31 23:33:59 +02:00 committed by Sharlatan Hellseher
parent 11902d484c
commit 2f1dd4f326
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -3694,15 +3694,66 @@ with Python's asyncio framework.")
(define-public python-asyncmy (define-public python-asyncmy
(package (package
(name "python-asyncmy") (name "python-asyncmy")
(version "0.2.5") (version "0.2.10")
(source (source
(origin (origin
(method url-fetch) (method git-fetch)
(uri (pypi-uri "asyncmy" version)) (uri (git-reference
(url "https://github.com/long2ice/asyncmy")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256 (sha256
(base32 "0i18zxy6xvzv6dk791xifn2sw2q4zvqwpzrzy8qx51d3mp8z6gng")))) (base32 "10sqihiwx7vsdaavgl418hhk7d5rl6d1i60y5bjr76mdfny18q55"))))
(build-system python-build-system) (build-system pyproject-build-system)
(native-inputs (list python-cython)) (arguments
(list
;; XXX: Most tests fail, probably because
;; of pytest-asyncio version mismatch.
#:tests? #f
#:phases
#~(modify-phases %standard-phases
(add-after 'install 'cleanup
(lambda* (#:key inputs outputs #:allow-other-keys)
(for-each delete-file
(find-files (site-packages inputs outputs)
"\\.(c|pyx)$"))))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys #:rest rest)
(when tests?
;; XXX: Else pytest picks up the wrong __init__.py
(delete-file-recursively "asyncmy")
;; The tests rely on a MySQL or MariaDB test server
;; being available.
(let ((datadir "/tmp/mysql")
(socket "/tmp/mysql/mysqld.sock")
(username "root")
(password "123456")) ;default in conftest.py
(invoke "mysqld" "--initialize-insecure"
(string-append "--datadir=" datadir))
(spawn "mysqld"
(list
"mysqld"
;; Respect '--datadir'.
"--no-defaults"
(string-append "--datadir=" datadir)
(string-append "--socket=" socket)))
(sleep 1)
(invoke "mysql"
(string-append "--socket=" socket)
"-u" "root"
"-e" (string-append
"ALTER USER 'root'@'localhost' IDENTIFIED BY '"
password "';"))
(apply (assoc-ref %standard-phases 'check)
`(#:tests? ,tests? ,@rest)))))))))
(native-inputs
(list mysql
python-cython
python-poetry-core
python-pytest
python-pytest-asyncio
python-setuptools))
(home-page "https://github.com/long2ice/asyncmy") (home-page "https://github.com/long2ice/asyncmy")
(synopsis "Fast MySQL driver for Python") (synopsis "Fast MySQL driver for Python")
(description "@code{asyncmy} is a fast @code{asyncio} MySQL driver, which (description "@code{asyncmy} is a fast @code{asyncio} MySQL driver, which