[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#69048] [PATCH 29/32] gnu: Add python-pydantic-core.
From: |
Hartmut Goebel |
Subject: |
[bug#69048] [PATCH 29/32] gnu: Add python-pydantic-core. |
Date: |
Sun, 11 Feb 2024 12:43:38 +0100 |
* gnu/packages/python-xyz.scm (python-pydantic-core): New variable.
---
gnu/packages/python-xyz.scm | 84 +++++++++++++++++++++++++++++++++++++
1 file changed, 84 insertions(+)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b4b69e0f3f..4749c3f204 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -7340,6 +7340,90 @@ (define-public python-pydantic
errors when data is invalid.")
(license license:expat)))
+(define-public python-pydantic-core
+ (package
+ (name "python-pydantic-core")
+ (version "2.16.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "pydantic_core" version))
+ (sha256
+ (base32 "01hs4ynmqp2wlfvbygg4bzz3f7g5da4xw40z74ccr3cb1n2h798b"))))
+ (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-before 'patch-cargo-checksums 'relax-requirements
+ ;; pydantic-core updates to the newest available version quite
+ ;; often, including e.g. serde, which Guix does not (yet) update
+ ;; that often to avoid "rust world rebuild".
+ (lambda _
+ (substitute* "Cargo.toml"
+ (("^(serde.* = \\{ *version = \")[^\"]+(\")" _ pre post)
+ (string-append pre "1.0.0" post))
+ (("^(enum_dispatch = \")[^\"]+(\")" _ pre post)
+ (string-append pre "0.3.0" post))
+ (("^(smallvec = \")[^\"]+(\")" _ pre post)
+ (string-append pre "1.11.0" post))
+ (("^(ahash = \")[^\"]+(\")" _ pre post)
+ (string-append pre "0.8.0" post))
+ (("^(url = \")[^\"]+(\")" _ pre post)
+ (string-append pre "2.4.0" post))
+ (("^(base64 = \")[^\"]+(\")" _ pre post)
+ (string-append pre "0.21.0" post))
+ (("^(num-bigint = \")[^\"]+(\")" _ pre post)
+ (string-append pre "0.4.0" post))
+ (("^(uuid = \")[^\"]+(\")" _ pre post)
+ (string-append pre "1.3.0" post)))))
+ (add-before 'patch-cargo-checksums 'fix-crate-private
+ (lambda _
+ (substitute* "src/serializers/fields.rs"
+ (("pub fn
(main_to_python|main_serde_serialize|add_computed_fields)"
+ _ name )
+ (string-append "pub(crate) fn " name)))))
+ (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.5)
+ ("rust-jiter" ,rust-jiter-0.0.6)
+ ("rust-num-bigint" ,rust-num-bigint-0.4)
+ ("rust-pyo3" ,rust-pyo3-0.20)
+ ("rust-python3-dll-a", rust-python3-dll-a-0.2)
+ ("rust-regex" ,rust-regex-1)
+ ("rust-serde" ,rust-serde-1)
+ ("rust-serde-json" ,rust-serde-json-1)
+ ("rust-smallvec" ,rust-smallvec-1)
+ ("rust-speedate" ,rust-speedate-0.13)
+ ("rust-strum" ,rust-strum-0.25)
+ ("rust-strum-macros" ,rust-strum-macros-0.25)
+ ("rust-url" ,rust-url-2)
+ ("rust-uuid" ,rust-uuid-1)
+ ("rust-zerocopy" ,rust-zerocopy-0.7)
+ ("rust-lexical-parse-float" ,rust-lexical-parse-float-0.8))
+ #:install-source? #false))
+ (inputs
+ (list maturin))
+ (native-inputs
+ (list python-hatchling python-pytest python-wrapper))
+ (propagated-inputs (list python-typing-extensions))
+ (home-page "https://github.com/pydantic/pydantic-core")
+ (synopsis "Core functionality 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")
--
2.41.0
- [bug#69048] [PATCH 09/32] gnu: rust-lexical-write-float-0.8: Update to 0.8.5., (continued)
- [bug#69048] [PATCH 09/32] gnu: rust-lexical-write-float-0.8: Update to 0.8.5., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 04/32] gnu: rust-heck-0.4: Update to 0.4.1., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 13/32] gnu: Add rust-codspeed-bencher-compat-2., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 08/32] gnu: rust-lexical-util-0.8: Update to 0.8.5., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 10/32] gnu: rust-lexical-write-integer-0.8: Update to 0.8.5., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 14/32] gnu: Add rust-elain-0.3., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 27/32] gnu: Add rust-pyo3-0.20., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 21/32] gnu: Add rust-zerocopy-derive-0.7., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 17/32] gnu: Add rust-jiter-0.0.6., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 22/32] gnu: Add rust-zerocopy-0.7., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 29/32] gnu: Add python-pydantic-core.,
Hartmut Goebel <=
- [bug#69048] [PATCH 32/32] gnu: python-email-validator: Update to 2.1.0.post1., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 30/32] gnu: Add python-pydantic-2., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 26/32] gnu: Add rust-pyo3-macros-0.20., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 18/32] gnu: Add rust-strum-0.25., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 25/32] gnu: Add rust-pyo3-macros-backend-0.20., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 23/32] gnu: Add rust-pyo3-build-config-0.20., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 15/32] gnu: Add rust-idna-0.5., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 28/32] gnu: Add python-annotated-types., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 12/32] gnu: Add rust-codspeed-2., Hartmut Goebel, 2024/02/11
- [bug#69048] [PATCH 31/32] gnu: python-typing-extensions: Update to 4.9.0., Hartmut Goebel, 2024/02/11