summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanguy Le Carrour <tanguy@bioneland.org>2020-08-10 10:43:43 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-08-10 12:02:53 +0200
commit0f89ec799e391d9d2453a929bca7a2a906d3435f (patch)
tree5be72d6d0781401d7b6239b5502453427a2b31be
parente79e3ffadc43eff3c51a9b2fb9fe7b83ec8611bd (diff)
downloadguix-0f89ec799e391d9d2453a929bca7a2a906d3435f.tar.gz
gnu: Add python-pydantic.
* gnu/packages/python-xyz.scm (python-pydantic): New variable.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
-rw-r--r--gnu/packages/python-xyz.scm37
1 files changed, 37 insertions, 0 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4026d13f2d..4102902465 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3820,6 +3820,43 @@ Language (TOML) configuration files.")
      "This package provides a JSON RPC 2.0 server library for Python.")
     (license license:expat)))
 
+(define-public python-pydantic
+  (package
+    (name "python-pydantic")
+    (version "1.6.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/samuelcolvin/pydantic")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1380s9k77g6q15by9fkxndczjk89q6xpz09jdrqip535xws2z3j8"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         ;; Reported upstream:
+         ;; <https://github.com/samuelcolvin/pydantic/issues/1580>.
+         ;; Disable the faulty test as the fix is unclear.
+         (add-before 'check 'disable-test
+           (lambda _
+             (substitute* "tests/test_validators.py"
+               (("test_assert_raises_validation_error")
+                "_test_assert_raises_validation_error"))
+             #t))
+         (replace 'check
+           (lambda _ (invoke "pytest" "-vv" "tests"))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/samuelcolvin/pydantic")
+    (synopsis "Python data validation and settings management")
+    (description
+     "Pydantic enforces type hints at runtime, and provides user friendly
+errors when data is invalid.")
+    (license license:expat)))
+
 (define-public python-pydocstyle
   (package
     (name "python-pydocstyle")