From aaf3bd6e07ae77426e191b9419d3a65b19fa58f6 Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Fri, 3 Oct 2025 14:49:46 +0200 Subject: [PATCH] gnu: python-pastel: Switch to pyproject. * gnu/packages/python-xyz.scm (python-pastel): [source]: Switch to git-fetch. [build-system]: Switch to pyproject-build-system. [arguments]<#:phases>: Replace 'check phase by <#:test-flags>. Add phase 'use-poetry-core. [native-inputs]: Add python-poetry-core and python-pytest. [description]: Improve style. Change-Id: I93377196595f380fcb722d52d44cd69b5fe7133f Signed-off-by: Sharlatan Hellseher --- gnu/packages/python-xyz.scm | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 39b7671c586e57d0a6dbe9dfb57a7047fefe9177..88e3e03c5785e423be65e0a270221a79bc68e5f7 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -1317,22 +1317,31 @@ of Ordered Set.") (version "0.2.0") (source (origin - (method url-fetch) - (uri (pypi-uri "pastel" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/sdispater/pastel") + (commit version))) + (file-name (git-file-name name version)) (sha256 - (base32 - "0dnaw44ss10i10z4ksy0xljknvjap7rb7g0b8p6yzm5x4g2my5a6")))) - (build-system python-build-system) + (base32 "016zqc41hjjm6szfjnzkmjl0y5q8y07i9792z2n71j9sirhas3b6")))) + (build-system pyproject-build-system) (arguments - `(#:phases (modify-phases %standard-phases - (replace 'check - (lambda _ (invoke "pytest" "pastel" "tests/")))))) - (native-inputs - (list python-pytest)) + (list + #:test-flags + #~(list "pastel" "tests/") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'use-poetry-core + (lambda _ + ;; Patch to use the core poetry API. + (substitute* "pyproject.toml" + (("poetry.masonry.api") "poetry.core.masonry.api"))))))) + (native-inputs (list python-poetry-core python-pytest)) (home-page "https://github.com/sdispater/pastel") (synopsis "Library to colorize strings in your terminal") - (description "Pastel is a simple library to help you colorize strings in -your terminal.") + (description + "Pastel is a simple library to help you colorize strings in your +terminal.") (license license:expat))) (define-public python-pathlib-abc