aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTroy Figiel <troy@troyfigiel.com>2024-10-20 00:46:39 +0200
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-10-26 11:11:48 +0100
commit0250eed22d4a3bb80865d7dd6caa2ea9b169c5d2 (patch)
treeaa1b2b0a63b7c5778968b119502549cd9db3f77c /gnu
parent2d08212d473a490eb0d84fa3e3c9c1ed5d897d95 (diff)
downloadguix-0250eed22d4a3bb80865d7dd6caa2ea9b169c5d2.tar.gz
guix-0250eed22d4a3bb80865d7dd6caa2ea9b169c5d2.zip
gnu: Add python-icontract.
* gnu/packages/python-check.scm (python-icontract): New variable. Change-Id: I48dc21cbed1ff68356099b1c3db351427dff60c7 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python-check.scm45
1 files changed, 45 insertions, 0 deletions
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 4eb6cb1a10..efd192ad2c 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -362,6 +362,51 @@ This package provides seamless integration with coverage.py (and thus pytest,
nosetests, etc...) in Python projects.")
(license license:expat)))
+(define-public python-icontract
+ (package
+ (name "python-icontract")
+ (version "2.7.1")
+ (source
+ (origin
+ ;; There are no tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Parquery/icontract")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1fix7wx899kn8vp9aa5m6q71la48gx3qqx4qd74535m61pb50r7f"))))
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'check 'set-icontract-slow
+ (lambda _
+ ;; Setting ICONTRACT_SLOW, does not enable a slow test suite.
+ ;; It only causes a single test to run, that checks the value of
+ ;; icontract.SLOW is set correctly.
+ (setenv "ICONTRACT_SLOW" "1"))))))
+ (build-system pyproject-build-system)
+ (native-inputs
+ (list python-astor
+ python-asyncstdlib
+ python-mypy
+ python-numpy
+ python-setuptools
+ python-typeguard-4))
+ (propagated-inputs
+ (list python-asttokens
+ python-typing-extensions))
+ (home-page "https://icontract.readthedocs.io")
+ (synopsis "Design-by-contract programming for Python")
+ (description
+ "@code{icontract} brings design-by-contract to Python with informative
+violation messages and inheritance. @code{icontract} provides two function,
+@code{require} and @code{ensure} for preconditions and postconditions
+respectively. Additionally, it provides a class decorator, @code{invariant},
+to establish class invariants.")
+ (license license:expat)))
+
(define-public python-junit-xml
;; XXX: There are no tags or PyPI releases, so take the latest commit
;; and use the version defined in setup.py.