From 0250eed22d4a3bb80865d7dd6caa2ea9b169c5d2 Mon Sep 17 00:00:00 2001 From: Troy Figiel Date: Sun, 20 Oct 2024 00:46:39 +0200 Subject: gnu: Add python-icontract. * gnu/packages/python-check.scm (python-icontract): New variable. Change-Id: I48dc21cbed1ff68356099b1c3db351427dff60c7 Signed-off-by: Sharlatan Hellseher --- gnu/packages/python-check.scm | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'gnu') 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. -- cgit v1.2.3