gnu: Add python-icontract.

* gnu/packages/python-check.scm (python-icontract): New variable.

Change-Id: I48dc21cbed1ff68356099b1c3db351427dff60c7
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Troy Figiel 2024-10-20 00:46:39 +02:00 committed by Sharlatan Hellseher
parent 2d08212d47
commit 0250eed22d
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -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.