gnu: python-alchemy-mock: Switch to pyproject.

* gnu/packages/databases.scm (python-alchemy-mock):
[source]: Switch to git-fetch.
[build-system]: Switch to pyproject-build-system.
[arguments]: Pass pytest options through <#:test-flags> rather than
<#:phases>.
[native-inputs]: Add python-setuptools, python-wheel.

Change-Id: I03ad45d452c11001b500b513682c338f3bff33e8
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves 2025-08-14 11:06:54 +02:00 committed by Sharlatan Hellseher
parent 8cdd561e78
commit 26a3deadd4
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -4394,34 +4394,28 @@ You might also want to install the following optional dependencies:
(name "python-alchemy-mock") (name "python-alchemy-mock")
(version "0.4.3") (version "0.4.3")
(home-page "https://github.com/miki725/alchemy-mock") (home-page "https://github.com/miki725/alchemy-mock")
(source (origin (source
(method url-fetch) (origin
(uri (pypi-uri "alchemy-mock" version)) (method git-fetch)
(sha256 (uri (git-reference
(base32 (url "https://github.com/miki725/alchemy-mock")
"0ylxygl3bcdapzz529n8wgk7vx9gjwb3ism564ypkpd7dbsw653r")) (commit version)))
(snippet (file-name (git-file-name name version))
#~(begin (use-modules (guix build utils)) (sha256
(substitute* "alchemy_mock/comparison.py" (base32 "053gj8d8ca5kpp7v61wd7lcm9mqp9xqz3d8pp9spdbcjsaqz9nk9"))
(("collections\\.Mapping") "collections.abc.Mapping")))))) (snippet #~(begin
(build-system python-build-system) (use-modules (guix build utils))
(substitute* "alchemy_mock/comparison.py"
(("collections\\.Mapping")
"collections.abc.Mapping"))))))
(build-system pyproject-build-system)
(arguments (arguments
'(#:phases (modify-phases %standard-phases (list
(replace 'check #:test-flags
(lambda _ #~(list "--doctest-modules" "alchemy_mock")))
;; Create pytest.ini that adds doctest options to (native-inputs (list python-mock python-pytest python-setuptools
;; prevent test failure. Taken from tox.ini. python-wheel))
(call-with-output-file "pytest.ini" (propagated-inputs (list python-sqlalchemy))
(lambda (port)
(format port "[pytest]
doctest_optionflags=IGNORE_EXCEPTION_DETAIL
")))
(invoke "pytest" "-vv" "--doctest-modules"
"alchemy_mock/"))))))
(native-inputs
(list python-mock python-pytest))
(propagated-inputs
(list python-six python-sqlalchemy))
(synopsis "Mock helpers for SQLAlchemy") (synopsis "Mock helpers for SQLAlchemy")
(description (description
"This package provides mock helpers for SQLAlchemy that makes it easy "This package provides mock helpers for SQLAlchemy that makes it easy