summary refs log tree commit diff
path: root/gnu/packages/python-xyz.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2024-02-28 12:18:45 +0200
committerEfraim Flashner <efraim@flashner.co.il>2024-02-28 12:18:45 +0200
commitf29f80c194d0c534a92354b2bc19022a9b70ecf8 (patch)
treeadc3c4114f59ef88ed3e097a8ec8517979f71562 /gnu/packages/python-xyz.scm
parentc034088e37b51018d5bfeb88d822c559b38d51db (diff)
parent7947d47c9b891d2461ca9e7c53048d0e44294b5d (diff)
downloadguix-f29f80c194d0c534a92354b2bc19022a9b70ecf8.tar.gz
Merge branch 'rust-team'
Change-Id: Iee31c5de29c357c822f60df4fa8ce758779eb349
Diffstat (limited to 'gnu/packages/python-xyz.scm')
-rw-r--r--gnu/packages/python-xyz.scm138
1 files changed, 135 insertions, 3 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index cb74de1051..0abd25df07 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -14,7 +14,7 @@
 ;;; Copyright © 2015, 2016, 2017, 2019, 2022 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2015, 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2015, 2016 Erik Edrosa <erik.edrosa@gmail.com>
-;;; Copyright © 2015-2023 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2015-2024 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015, 2017, 2020 Kyle Meyer <kyle@kyleam.com>
 ;;; Copyright © 2015, 2016 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
@@ -181,6 +181,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages crates-io)
+  #:use-module (gnu packages crates-windows)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dbm)
@@ -577,7 +578,13 @@ workspaces.
        (method url-fetch)
        (uri (pypi-uri "databind.core" version))
        (sha256
-        (base32 "130hr19kbzizx9n2q7cwfzfk20ii3cqmqjrzb16psnafll303k2d"))))
+        (base32 "130hr19kbzizx9n2q7cwfzfk20ii3cqmqjrzb16psnafll303k2d"))
+       (snippet
+        #~(begin (use-modules (guix build utils))
+                 ;; The problem with python-typing-extensions >= 4.7 is only
+                 ;; with python-3.7.
+                 (substitute* "pyproject.toml"
+                   ((",<4.7.*") "\"\n"))))))
     (build-system pyproject-build-system)
     (arguments
      (list
@@ -622,7 +629,13 @@ Python dataclasses.")
        (method url-fetch)
        (uri (pypi-uri "databind.json" version))
        (sha256
-        (base32 "1lm864d7arfq0pw64hyc83bwn1z94wjg7a22q1xf0qkjynqs70gg"))))
+        (base32 "1lm864d7arfq0pw64hyc83bwn1z94wjg7a22q1xf0qkjynqs70gg"))
+       (snippet
+        #~(begin (use-modules (guix build utils))
+                 ;; The problem with python-typing-extensions >= 4.7 is only
+                 ;; with python-3.7.
+                 (substitute* "pyproject.toml"
+                   ((",<4.7.*") "\"\n"))))))
     (build-system pyproject-build-system)
     (arguments
      (list
@@ -6239,6 +6252,30 @@ important tasks for becoming a daemon process:
     ;; Only setup.py is gpl3+, everything else is apache 2.0 licensed.
     (license (list license:asl2.0 license:gpl3+))))
 
+(define-public python-annotated-types
+  (package
+    (name "python-annotated-types")
+    (version "0.6.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "annotated_types" version))
+       (sha256
+        (base32 "0paaz0i4xqk335ji5w887i2bhgm2krnzr6by4sfgsgz50zl3jcsn"))))
+    (build-system pyproject-build-system)
+    (native-inputs
+     (list python-hatchling
+           python-pytest))
+    (propagated-inputs (list python-typing-extensions))
+    (home-page "https://github.com/annotated-types/annotated-types")
+    (synopsis "Reusable constraint types to use with typing.Annotated")
+    (description "This package provides metadata objects which can be used to
+represent common constraints such as upper and lower bounds on scalar values and
+collection sizes, a Predicate marker for runtime checks, and descriptions of how
+we intend these metadata to be interpreted.  In some cases, we also note
+alternative representations which do not require this package.")
+    (license license:expat)))
+
 (define-public python-anytree
   (package
     (name "python-anytree")
@@ -7397,6 +7434,101 @@ which can produce feeds in RSS 2.0, RSS 0.91, and Atom formats.")
 errors when data is invalid.")
     (license license:expat)))
 
+(define-public python-pydantic-2
+  (package
+    (inherit python-pydantic)
+    (name "python-pydantic")
+    (version "2.5.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pydantic" version))
+       (sha256
+        (base32 "0yiz75zp93x6x2czm772cz5pzn00i703irncjwb99c1m4p35gvxk"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+       #:test-flags #~(list "--ignore=tests/test_docs.py"   ; no pytest_examples
+                            ;; need python-email-validator >= 2.0.0
+                            "-k not test_fastapi_startup_perf")
+       #:phases
+       #~(modify-phases %standard-phases
+           (add-before 'check 'pre-check
+             (lambda _
+               ;; Remove the addopts from pyproject.toml, it breaks the 'check phase.
+               (substitute* "pyproject.toml"
+                 (("'--benchmark") "#'--benchmark")))))))
+    (native-inputs
+     (list python-hatchling
+           python-hatch-fancy-pypi-readme
+           python-cloudpickle
+           python-dirty-equals
+           python-faker
+           python-pytest
+           python-pytest-benchmark
+           python-pytest-mock))
+    (propagated-inputs
+     (list python-annotated-types
+           python-pydantic-core
+           python-typing-extensions))))
+
+(define-public python-pydantic-core
+  (package
+    (name "python-pydantic-core")
+    (version "2.14.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pydantic_core" version))
+       (sha256
+        (base32 "0j79pd6ixapsiwsigsxzmvbrpmdr7f7c4l9sl7xl6a1pjp9w3l0z"))))
+    (build-system cargo-build-system)
+    (arguments
+     (list
+      #:imported-modules `(,@%cargo-build-system-modules
+                           ,@%pyproject-build-system-modules)
+      #:modules '((guix build cargo-build-system)
+                  ((guix build pyproject-build-system) #:prefix py:)
+                  (guix build utils))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'prepare-python-module 'build-python-module
+            (assoc-ref py:%standard-phases 'build))
+          (add-after 'build-python-module 'install-python-module
+            (assoc-ref py:%standard-phases 'install)))
+      #:cargo-inputs
+      `(("rust-ahash" ,rust-ahash-0.8)
+        ("rust-base64" ,rust-base64-0.21)
+        ("rust-enum-dispatch" ,rust-enum-dispatch-0.3)
+        ("rust-idna" ,rust-idna-0.4)
+        ("rust-jiter" ,rust-jiter-0.0.4)
+        ("rust-num-bigint" ,rust-num-bigint-0.4)
+        ("rust-python3-dll-a" ,rust-python3-dll-a-0.2)
+        ("rust-pyo3" ,rust-pyo3-0.20)
+        ("rust-pyo3-build-config" ,rust-pyo3-build-config-0.20)
+        ("rust-regex" ,rust-regex-1)
+        ("rust-strum" ,rust-strum-0.25)
+        ("rust-strum-macros" ,rust-strum-macros-0.25)
+        ("rust-serde" ,rust-serde-1)
+        ("rust-serde-json" ,rust-serde-json-1)
+        ("rust-smallvec" ,rust-smallvec-1)
+        ("rust-speedate" ,rust-speedate-0.13)
+        ("rust-url" ,rust-url-2)
+        ("rust-uuid" ,rust-uuid-1)
+        ("rust-version-check" ,rust-version-check-0.9))
+      #:cargo-development-inputs
+      `(("rust-pyo3" ,rust-pyo3-0.20))
+      #:install-source? #false))
+    (native-inputs
+     (list maturin python-wrapper))
+    (propagated-inputs
+     (list python-typing-extensions))
+    (home-page "https://github.com/pydantic/pydantic-core")
+    (synopsis "Core validation logic for pydantic")
+    (description "This package provides the core functionality for pydantic
+validation and serialization.")
+    (license license:expat)))
+
 (define-public python-pydantic-cli
   (package
     (name "python-pydantic-cli")