[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/08: gnu: Add python-cattrs.
From: |
guix-commits |
Subject: |
06/08: gnu: Add python-cattrs. |
Date: |
Sun, 26 Jun 2022 22:35:25 -0400 (EDT) |
apteryx pushed a commit to branch master
in repository guix.
commit ddb8635e5af4a44887e032d7df3c8914709e7a8b
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Sat Jun 25 00:21:00 2022 -0400
gnu: Add python-cattrs.
* gnu/packages/python-xyz.scm (python-cattrs): New variable.
---
gnu/packages/python-xyz.scm | 67 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8cb9cb4c6a..1d43049776 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16545,6 +16545,73 @@ smaller. Small integers are encoded into a single
byte, and typical short
strings require only one extra byte in addition to the strings themselves.")
(license license:asl2.0)))
+(define-public python-cattrs
+ (package
+ (name "python-cattrs")
+ (version "22.1.0")
+ (source (origin
+ (method git-fetch) ;for tests
+ (uri (git-reference
+ (url "https://github.com/python-attrs/cattrs")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1n0h25gj6zd02kqyl040xpdvg4hpy1j92716sz0rg019xjqqijqb"))))
+ (build-system python-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; XXX: PEP 517 manual build copied from python-isort.
+ (add-after 'unpack 'adjust-for-older-attrs
+ ;; Our older attrs package is using the 'attr' rather than 'attrs'
+ ;; namespace.
+ ;; TODO: Remove after python-attrs is updated to >= 21.4.0.
+ (lambda _
+ (substitute* (find-files "." "\\.py$")
+ (("from attrs\\b")
+ "from attr"))))
+ (replace 'build
+ (lambda _
+ (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
+ (replace 'install
+ (lambda _
+ (let ((whl (car (find-files "dist" "\\.whl$"))))
+ (invoke "pip" "--no-cache-dir" "--no-input"
+ "install" "--no-deps" "--prefix" #$output whl))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ ;; Do not use the 'pytest' binary as it hard-codes an older
+ ;; python-hypothesis version near the beginning of its
+ ;; GUIX_PYTHONPATH.
+ (invoke "python" "-m" "pytest" "-vv" "-c" "/dev/null" "tests"
+ "-n" (number->string (parallel-job-count))
+ ;; This test requires orjson, which needs the maturin
+ ;; build system and new Rust dependencies.
+ "--ignore" "tests/test_preconf.py")))))))
+ (native-inputs
+ (list python-hypothesis-next
+ python-immutables
+ python-msgpack
+ python-poetry-core
+ python-pymongo ;for the bson module
+ python-pypa-build
+ python-pytest
+ python-pytest-xdist))
+ (propagated-inputs
+ (list python-attrs
+ python-exceptiongroup
+ python-typing-extensions))
+ (home-page "https://github.com/python-attrs/cattrs")
+ (synopsis "Python library for structuring and unstructuring data")
+ (description "@code{cattrs} is an Python library for structuring and
+unstructuring data. @code{cattrs} works best with @code{attrs} classes,
+@code{dataclasses} and the usual Python collections, but other kinds of
+classes can also be supported by manually registering converters.")
+ (license license:expat)))
+
(define-public python-cachy
(package
(name "python-cachy")
- branch master updated (8d0e696243 -> 97766323bc), guix-commits, 2022/06/26
- 01/08: gnu: python-setuptools-scm: Move to (gnu packages python-build)., guix-commits, 2022/06/26
- 02/08: gnu: Add python-flit-scm., guix-commits, 2022/06/26
- 04/08: gnu: python-pymongo: Update to 4.1.1., guix-commits, 2022/06/26
- 03/08: gnu: Add python-exceptiongroup., guix-commits, 2022/06/26
- 05/08: gnu: python-immutables: Update to 0.18., guix-commits, 2022/06/26
- 07/08: gnu: Add python-statmake., guix-commits, 2022/06/26
- 06/08: gnu: Add python-cattrs.,
guix-commits <=
- 08/08: gnu: font-abattis-cantarell: Build from source., guix-commits, 2022/06/26