unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#42792] [PATCH] gnu: Add python-pydantic.
@ 2020-08-10  8:43 Tanguy Le Carrour
  2020-08-10 10:05 ` bug#42792: " Mathieu Othacehe
  0 siblings, 1 reply; 5+ messages in thread
From: Tanguy Le Carrour @ 2020-08-10  8:43 UTC (permalink / raw)
  To: 42792; +Cc: Tanguy Le Carrour

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4026d13f2d..a36e99aa32 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3820,6 +3820,41 @@ 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>
+         ;; Not sure how to apply the suggested fix!?
+         (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 "Data validation and settings management using python type hinting")
+    (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")
-- 
2.28.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-11  9:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10  8:43 [bug#42792] [PATCH] gnu: Add python-pydantic Tanguy Le Carrour
2020-08-10 10:05 ` bug#42792: " Mathieu Othacehe
2020-08-10 14:19   ` [bug#42792] " Tanguy Le Carrour
2020-08-11  8:35     ` Mathieu Othacehe
2020-08-11  9:00       ` Tanguy Le Carrour

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).