From f98d39954fa0052af32d03824a3f9c4a47091d24 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 14 Jan 2024 16:41:54 +0200 Subject: gnu: Add python-pydantic-core. * gnu/packages/python-xyz.scm (python-pydantic-core): New variable. Change-Id: I163db0e6230662c585b7f0d222feba55e20136f1 --- gnu/packages/python-xyz.scm | 60 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python-xyz.scm') diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index c3dfb9603c..0e36ec03de 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 ;;; Copyright © 2015, 2017 Ben Woodcroft ;;; Copyright © 2015, 2016 Erik Edrosa -;;; Copyright © 2015-2023 Efraim Flashner +;;; Copyright © 2015-2024 Efraim Flashner ;;; Copyright © 2015, 2017, 2020 Kyle Meyer ;;; Copyright © 2015, 2016 Chris Marusich ;;; Copyright © 2016 Danny Milosavljevic @@ -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) @@ -7387,6 +7388,63 @@ 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-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") -- cgit 1.4.1 From cdc550581937e1c8208f523adcd6376b48f71069 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 14 Jan 2024 16:44:34 +0200 Subject: gnu: Add python-annotated-types. * gnu/packages/python-xyz.scm (python-annotated-types): New variable. Change-Id: I8d601a226fbf25be7746a617c88084ab067978d4 --- gnu/packages/python-xyz.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gnu/packages/python-xyz.scm') diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 0e36ec03de..f2bc04813b 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -6230,6 +6230,25 @@ 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)) + (home-page "https://github.com/annotated-types/annotated-types") + (synopsis "Reusable constraint types to use with typing.Annotated") + (description "Reusable constraint types to use with typing.Annotated") + (license license:expat))) + (define-public python-anytree (package (name "python-anytree") -- cgit 1.4.1 From fe6b25287c50250cf4aee110d03bfa37e9718f4c Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 14 Jan 2024 16:44:54 +0200 Subject: gnu: Add python-pydantic-2. * gnu/packages/python-xyz.scm (python-pydantic-2): New variable. Change-Id: I81c07fd91f522662dd912309313db7a3f4f49b75 --- gnu/packages/python-xyz.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'gnu/packages/python-xyz.scm') diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index f2bc04813b..9369cc06a8 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -7407,6 +7407,44 @@ 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") -- cgit 1.4.1 From 063868688355c08bd568a78bc3b4d1a44f5f8f06 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Sun, 11 Feb 2024 16:07:52 +0200 Subject: gnu: python-annotated-types: Update package. * gnu/packages/python-xyz.scm (python-annotated-types) [propagated-inputs]: Add python-typing-extensions. [description]: Expand. Change-Id: I90d198602a9f3f42be26f5728a61b3089b32a81e --- gnu/packages/python-xyz.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python-xyz.scm') diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 9369cc06a8..a012241dbd 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -6244,9 +6244,14 @@ important tasks for becoming a daemon process: (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 "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 -- cgit 1.4.1 From 0ae4b8c42aaa10a23643dd22d266ad38d44569f3 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 25 Feb 2024 10:57:02 +0200 Subject: gnu: python-databind-core: Allow newer versions of typing-extensions. * gnu/packages/python-xyz.scm (python-databind-core)[source]: Add snippet to allow newer versions of python-typing-extensions. Change-Id: I8515c4767d6241542a53746f3654074010ab25f1 --- gnu/packages/python-xyz.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python-xyz.scm') diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index a012241dbd..b97ab7e86e 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -578,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 -- cgit 1.4.1 From f5f64cd773018f102dab4b294e94df7ebcc073f9 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 27 Feb 2024 10:59:00 +0200 Subject: gnu: python-databind-json: Allow newer versions of typing-extensions. * gnu/packages/python-xyz.scm (python-databind-json)[source]: Add snippet to allow newer versions of python-typing-extensions. Change-Id: I9a8ec799d273ba6f92029afd2f5d2007f3579eb3 --- gnu/packages/python-xyz.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python-xyz.scm') diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index b97ab7e86e..79e9edb8d8 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -629,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 -- cgit 1.4.1