Subject: [bug#70400] [PATCH 2/7] gnu: Add python-pytoolconfig.

From: Jonathan Pieper <[email-masked]>
Date: Mon, 15 Apr 2024 19:45:05 +0200

* gnu/packages/python-xyz.scm (python-pytoolconfig): New variable.
---
 gnu/packages/python-xyz.scm | 52 +++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 9521119a84..27107c3d8f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -36309,6 +36309,58 @@ (define-public python-zeroc-ice-3.6
                (base32
                 "0mikjfvq26kh8asnn9v55z41pap4c5ypymqnwwi4xkavc3mzyda2"))))))
 
+(define-public python-pytoolconfig
+  (package
+    (name "python-pytoolconfig")
+    (version "1.2.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytoolconfig" version))
+       (sha256
+        (base32 "18isxi4ijarl949d0zmf0b4606r6hihpi3p5yb7763m4c7ra24i5"))))
+    (build-system pyproject-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'update-license
+                    (lambda _
+                      (substitute* "pyproject.toml"
+                        (("license-expression = (\"[^\"]*\")" all license)
+                         (string-append "license = {text = " license "}")))))
+                  (add-after 'unpack 'remove-mypy
+                    (lambda _
+                      (substitute* "pyproject.toml"
+                        (("^.*mypy.*")
+                         "")
+                        (("strict = true")
+                         ""))))
+                  (add-after 'unpack 'use-pdm-backend-instead-of-pep517
+                    (lambda _
+                      (substitute* "pyproject.toml"
+                        (("pdm-pep517")
+                         "pdm-backend")
+                        (("pdm\\.pep517\\.api")
+                         "pdm.backend"))))
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        ;; Disable failing test.
+                        (invoke "python" "-m" "pytest" "-k"
+                                "not test_documentation")))))))
+    (native-inputs (list python-pdm-backend
+                         python-tomli
+                         python-pytest
+                         python-docutils
+                         python-sphinx
+                         python-tabulate))
+    (propagated-inputs (list python-appdirs))
+    (home-page "https://github.com/bagel897/pytoolconfig")
+    (synopsis "Python Tool Configuration")
+    (description
+     "This module manages configuration for python tools,
+such as rope and add support for a pyproject.toml configuration file.")
+    (license license:lgpl3+)))
+
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar
-- 
2.41.0