summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-06-25 00:21:00 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-06-26 22:10:40 -0400
commitddb8635e5af4a44887e032d7df3c8914709e7a8b (patch)
tree3178d31f807edb0afe8c7ea8b0794e21bfe664b1
parentgnu: python-immutables: Update to 0.18. (diff)
downloadguix-ddb8635e5af4a44887e032d7df3c8914709e7a8b.tar.gz
guix-ddb8635e5af4a44887e032d7df3c8914709e7a8b.tar.bz2
guix-ddb8635e5af4a44887e032d7df3c8914709e7a8b.tar.xz
gnu: Add python-cattrs.
* gnu/packages/python-xyz.scm (python-cattrs): New variable.
-rw-r--r--gnu/packages/python-xyz.scm67
1 files changed, 67 insertions, 0 deletions
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
16545strings require only one extra byte in addition to the strings themselves.") 16545strings require only one extra byte in addition to the strings themselves.")
16546 (license license:asl2.0))) 16546 (license license:asl2.0)))
16547 16547
16548(define-public python-cattrs
16549 (package
16550 (name "python-cattrs")
16551 (version "22.1.0")
16552 (source (origin
16553 (method git-fetch) ;for tests
16554 (uri (git-reference
16555 (url "https://github.com/python-attrs/cattrs")
16556 (commit (string-append "v" version))))
16557 (file-name (git-file-name name version))
16558 (sha256
16559 (base32
16560 "1n0h25gj6zd02kqyl040xpdvg4hpy1j92716sz0rg019xjqqijqb"))))
16561 (build-system python-build-system)
16562 (arguments
16563 (list
16564 #:phases
16565 #~(modify-phases %standard-phases
16566 ;; XXX: PEP 517 manual build copied from python-isort.
16567 (add-after 'unpack 'adjust-for-older-attrs
16568 ;; Our older attrs package is using the 'attr' rather than 'attrs'
16569 ;; namespace.
16570 ;; TODO: Remove after python-attrs is updated to >= 21.4.0.
16571 (lambda _
16572 (substitute* (find-files "." "\\.py$")
16573 (("from attrs\\b")
16574 "from attr"))))
16575 (replace 'build
16576 (lambda _
16577 (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
16578 (replace 'install
16579 (lambda _
16580 (let ((whl (car (find-files "dist" "\\.whl$"))))
16581 (invoke "pip" "--no-cache-dir" "--no-input"
16582 "install" "--no-deps" "--prefix" #$output whl))))
16583 (replace 'check
16584 (lambda* (#:key tests? #:allow-other-keys)
16585 (when tests?
16586 ;; Do not use the 'pytest' binary as it hard-codes an older
16587 ;; python-hypothesis version near the beginning of its
16588 ;; GUIX_PYTHONPATH.
16589 (invoke "python" "-m" "pytest" "-vv" "-c" "/dev/null" "tests"
16590 "-n" (number->string (parallel-job-count))
16591 ;; This test requires orjson, which needs the maturin
16592 ;; build system and new Rust dependencies.
16593 "--ignore" "tests/test_preconf.py")))))))
16594 (native-inputs
16595 (list python-hypothesis-next
16596 python-immutables
16597 python-msgpack
16598 python-poetry-core
16599 python-pymongo ;for the bson module
16600 python-pypa-build
16601 python-pytest
16602 python-pytest-xdist))
16603 (propagated-inputs
16604 (list python-attrs
16605 python-exceptiongroup
16606 python-typing-extensions))
16607 (home-page "https://github.com/python-attrs/cattrs")
16608 (synopsis "Python library for structuring and unstructuring data")
16609 (description "@code{cattrs} is an Python library for structuring and
16610unstructuring data. @code{cattrs} works best with @code{attrs} classes,
16611@code{dataclasses} and the usual Python collections, but other kinds of
16612classes can also be supported by manually registering converters.")
16613 (license license:expat)))
16614
16548(define-public python-cachy 16615(define-public python-cachy
16549 (package 16616 (package
16550 (name "python-cachy") 16617 (name "python-cachy")