From patchwork Sun Jun 18 09:59:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sharlatan Hellseher X-Patchwork-Id: 51033 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 96D3B27BBE9; Sun, 18 Jun 2023 11:00:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2B52E27BBE2 for ; Sun, 18 Jun 2023 11:00:16 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qApCZ-0007dK-OP; Sun, 18 Jun 2023 06:00:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qApCV-0007ck-Ll for guix-patches@gnu.org; Sun, 18 Jun 2023 06:00:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qApCV-0007qx-18 for guix-patches@gnu.org; Sun, 18 Jun 2023 06:00:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qApCU-00070A-9j for guix-patches@gnu.org; Sun, 18 Jun 2023 06:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64010] [PATCH v2] gnu: Add python-msgspec. References: In-Reply-To: Resent-From: Sharlatan Hellseher Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 18 Jun 2023 10:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64010 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64010@debbugs.gnu.org Cc: Sharlatan Hellseher Received: via spool by 64010-submit@debbugs.gnu.org id=B64010.168708236726840 (code B ref 64010); Sun, 18 Jun 2023 10:00:02 +0000 Received: (at 64010) by debbugs.gnu.org; 18 Jun 2023 09:59:27 +0000 Received: from localhost ([127.0.0.1]:53235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qApBu-0006yq-JA for submit@debbugs.gnu.org; Sun, 18 Jun 2023 05:59:27 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]:52330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qApBr-0006yZ-48 for 64010@debbugs.gnu.org; Sun, 18 Jun 2023 05:59:24 -0400 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3094910b150so2204268f8f.0 for <64010@debbugs.gnu.org>; Sun, 18 Jun 2023 02:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687082357; x=1689674357; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sz+PboTpQUEAIwOp76qmt8EGI8utOMbJt86dFMfW8Vo=; b=jd5uiwUbxlgq+2acp8nofKgrBoCRaCMcIbfhD3ekDfQsyHazDPZQDV/kCarohICrI3 3J9pH3eqDbwXP3W/nyqQQsIQFQ5KufMVdqYmaW2iIYGvpebU37BSGCRFvejuER4++aA9 Fd1XaKS0llv2aY+EivGO77C41SPk8aIg6exT/SW52DPS/HdQF/i0DMcrGRE2m7lG/oUa 7rOSX5GBtzIabyXOt7H5mk5uBoxN6XCiR3gaPRF9nm6EngW/w/NKndogd2plZjQXCFNC 6f7YULBh3o4W2VtVmSu9x21Pjg75kgeX3vhNhVXCBawUkxRH1Q6hkAUJWEYL7wAsVgfF MYoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687082357; x=1689674357; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sz+PboTpQUEAIwOp76qmt8EGI8utOMbJt86dFMfW8Vo=; b=Rfx9a5DPEeox1pE9tEvDH2qC7HemwQ4UUBJ/G4y7uAT2B29ERE3xTQ/1eht5uV616f HZy1pr2k7UOdKybTW9ZNOzKVAW4lLWUybf6l5wwkvlSFOt+26AQCLlnlIkCOofklRs0i RuNvi/MmfxJtWcuMaWwqpjU0/SwgAmXrOpHW8xVfWNEBM1W3+3fZ869fv6Tc6iybkwCn 6Ti/kC6pn6MksVCJe1DhYKq1dxNBLLgQvHvWByvpnz7glbs1Xy/4sVl/s5T0dANPGgh+ oHk9mwLB1U9ThNJV6BaaHEt6Qg3b2TqlSouDBTtOPlY0Ybotnsw54v6DvcxPFkqw1FZo IVTA== X-Gm-Message-State: AC+VfDySVTzhXKWGKQIdH+6XHFVZgKRY/ELBwPu4kANEsSHioIWbPRtW LQhQW7v9Bx34PIaPI3gSUzP3t/vf40c= X-Google-Smtp-Source: ACHHUZ7GVm3ekAAZ9JG49NPaYDYeyjvzdZSM3AlVtRWBXA+ihH6PY6zLLzj1NAodJ9nA/P1ZFkBENw== X-Received: by 2002:adf:ec43:0:b0:30f:aef1:2add with SMTP id w3-20020adfec43000000b0030faef12addmr5813241wrn.47.1687082356975; Sun, 18 Jun 2023 02:59:16 -0700 (PDT) Received: from guxtil.incerto.xyz (cpc100856-bagu15-2-0-cust368.1-3.cable.virginm.net. [82.25.93.113]) by smtp.gmail.com with ESMTPSA id cr4-20020a05600004e400b003063a92bbf5sm28562189wrb.70.2023.06.18.02.59.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jun 2023 02:59:16 -0700 (PDT) From: Sharlatan Hellseher Date: Sun, 18 Jun 2023 10:59:13 +0100 Message-Id: <5f3b8f3c7b74f856587c73a43f2e25d9906410f5.1687082264.git.sharlatanus@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/serialization.scm (python-msgspec): New variable. --- gnu/packages/serialization.scm | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) base-commit: 299f64adea72a4b360da54b0bffd06ee57a5517b diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm index 39954d6764..43c9473e95 100644 --- a/gnu/packages/serialization.scm +++ b/gnu/packages/serialization.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2020 Alexandros Theodotou ;;; Copyright © 2023 Alexey Abramov +;;; Copyright © 2023 Sharlatan Hellseher ;;; ;;; This file is part of GNU Guix. ;;; @@ -41,6 +42,7 @@ (define-module (gnu packages serialization) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system meson) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (gnu packages) #:use-module (gnu packages autotools) @@ -58,6 +60,8 @@ (define-module (gnu packages serialization) #:use-module (gnu packages lua) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-check) #:use-module (gnu packages python-science) #:use-module (gnu packages python-xyz) #:use-module (gnu packages perl)) @@ -613,6 +617,66 @@ (define-public capnproto RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster.") (license license:expat))) +(define-public python-msgspec + (package + (name "python-msgspec") + (version "0.16.0") + (source (origin + ;; There are no tests in the PyPI tarball. + (method git-fetch) + (uri (git-reference + (url "https://github.com/jcrist/msgspec") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "09q567klcv7ly60w9lqip2ffyhrij100ky9igh3p3vqwbml33zb3")))) + (build-system pyproject-build-system) + (arguments + (list + ;; Disable only one failing test. + ;; + ;; AssertionError: msgspec/structs.pyi:7: error: Positional-only parameters + ;; are only supported in Python 3.8 and greater + #:test-flags #~(list "-k" "not test_mypy") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'versioneer + (lambda _ + (invoke "versioneer" "install") + (substitute* "setup.py" + (("version=versioneer.get_version\\(),") + (format #f "version=~s," #$version)))))))) + ;; XXX: It might support more architectures but GitHub Actions listed only + ;; two right now. Try to build for the rest supported by Guix. + ;; See: + ;; https://github.com/jcrist/msgspec/blob/main/.github/workflows/ci.yml#L83 + (supported-systems (list "x86_64-linux" "aarch64-linux")) + (native-inputs (list python-attrs + python-gcovr + python-msgpack + python-mypy + python-pytest + python-setuptools-scm + python-versioneer)) + (propagated-inputs (list python-pyyaml python-tomli python-tomli-w)) + (home-page "https://jcristharif.com/msgspec/") + (synopsis + "Fast serialization/validation library for JSON, MessagePack, YAML, and TOML") + (description + "This package provides a fast serialization and validation library, with builtin +support for JSON, MessagePack, YAML, and TOML. It includes the following features: +@itemize +@item high performance encoders/decoders for common protocols. +@item support for a wide variety of Python types. Additional types may be +supported through extensions. +@item zero-cost schema validation using familiar Python type annotations. In +benchmarks msgspec decodes and validates JSON about 2x faster than @code{orjson} +can decode it alone. +@item a speedy Struct type for representing structured data. +@end itemize") + (license license:bsd-3))) + (define-public python-ruamel.yaml (package (name "python-ruamel.yaml")