From eab6c1e8db569369c69f58af5906251dfde24245 Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Tue, 27 Dec 2022 23:01:30 +0100 Subject: [PATCH 10/10] gnu: Add python-orjson. * gnu/packages/python-xyz.scm (python-orjson): New vairable. diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 91af772a4f..dd9fc64f3f 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -30047,6 +30047,113 @@ (define-public python-orgparse "This package is a Python module for reading Emacs Org mode files.") (license license:bsd-3))) +(define-public python-orjson + (package + (name "python-orjson") + (version "3.8.3") + (source (origin + (method url-fetch) + (uri (pypi-uri "orjson" version)) + (sha256 + (base32 + "0y3ig7067n13m25hmh365nlbiaxipwf8c8hly8a8c5l9a95578gd")))) + (build-system pyproject-build-system) + (arguments + (list + ; #:imported-modules (append %cargo-build-system-modules + ; %pyproject-build-system-modules) + ; #:modules `(((guix build cargo-build-system) #:prefix cargo:) + ; ,@%pyproject-build-system-modules + ; (srfi srfi-1) + ; (ice-9 match)) + #:phases + #~(modify-phases (@ (guix build pyproject-build-system) %standard-phases) +; (add-after 'unpack 'adjust-pyo3-requirement +; (lambda _ +; ;; The package depends on 0.15.2, which is not on crates.io(!?). +; ;; Downgrade to 0.15.1... +; (substitute* "src/rust/Cargo.toml" +; (("pyo3 = \\{ version = \"0\\.15\\.2\"") +; "pyo3 = { version = \"0.15.1\"")))) +; (add-before 'build 'configure-cargo +; (lambda* (#:key inputs #:allow-other-keys) +; ;; Hide irrelevant inputs from cargo-build-system so it does +; ;; not try to unpack sanity-check.py, etc. +; (let ((cargo-inputs (filter (match-lambda +; ((name . path) +; (or (string-prefix? "rust-" name) +; (string=? "gcc" name)))) +; inputs))) +; (with-directory-excursion "src" +; ((assoc-ref cargo:%standard-phases 'unpack-rust-crates) +; #:inputs cargo-inputs +; #:vendor-dir "guix-vendor") +; ((assoc-ref cargo:%standard-phases 'configure) +; #:inputs cargo-inputs) +; ((assoc-ref cargo:%standard-phases 'patch-cargo-checksums) +; #:vendor-dir "guix-vendor")) +; (rename-file "src/.cargo" ".cargo")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-vv" "tests"))))))) + (home-page "https://github.com/ijl/orjson") +; (native-inputs (list rust-cc-1 +; rust-pyo3-build-config-0.17 +; rust-version-check-0.9)) +; rust-maturin-0.14)) + (inputs (list python-autoflake + python-black + python-isort + ;maturin + python-mypy + python-types-python-dateutil + python-types-pytz + python-types-simplejson + python-types-ujson + python-memory-profiler + python-pytest-benchmark + python-pytest-random-order + python-rapidjson + python-simplejson + python-tabulate + python-ujson + python-flask + python-gunicorn + python-httpx + python-psutil + python-pendulum + python-numpy + python-arrow + python-pytest + python-pytz + python-typing-extensions + python-xxhash + ; rust-maturin-0.14 + ; rust-ahash-0.8 + ; rust-arrayvec-0.7 + ; rust-associative-cache-1 + ; rust-beef-0.5 + ; rust-bytecount-0.6 + ; rust-chrono-0.4 + ; rust-compact-str-0.6 + ; rust-encoding-rs-0.8 + ; rust-itoa-1 + ; rust-once-cell-1 + ; rust-pyo3-ffi-0.17 + ; rust-ryu-1 + ; rust-serde-1 + ; rust-serde-json-1 + ; rust-simdutf8-0.1 + ; rust-smallvec-1 + )) + (synopsis + "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy") + (description + "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy") + ;; Dual-licensed + (license (list license:expat license:asl2.0)))) + (define-public dynaconf (package (name "dynaconf") -- 2.38.1