From 504dd8b6960705e032ac6fa860f57e3ce3808dba Mon Sep 17 00:00:00 2001 From: Malte Frank Gerdes Date: Thu, 7 Apr 2022 18:09:12 +0200 Subject: gnu: Add python-pyinstrument. * gnu/packages/python-check.scm (python-pyinstrument): New variable. Co-authored-by: Guillaume Le Vaillant --- gnu/packages/python-check.scm | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 5bbe544113e..02e1b5a9d71 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -11,8 +11,9 @@ ;;; Copyright © 2020 Tanguy Le Carrour ;;; Copyright © 2021 Sharlatan Hellseher ;;; Copyright © 2021 Brendan Tildesley -;;; Copyright © 2021 Guillaume Le Vaillant +;;; Copyright © 2021, 2022 Guillaume Le Vaillant ;;; Copyright © 2021 Bonface Munyoki Kilyungi +;;; Copyright © 2022 Malte Frank Gerdes ;;; ;;; This file is part of GNU Guix. ;;; @@ -244,6 +245,36 @@ nosetests, etc...) in Python projects.") result documents that can be read by tools such as Jenkins or Bamboo.") (license license:expat)))) +(define-public python-pyinstrument + (package + (name "python-pyinstrument") + (version "4.1.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pyinstrument" version)) + (sha256 + (base32 "18n3waxsxcd48pmcp8158s5rlancll2000amrdck9zfj5hfpkhhx")))) + (build-system python-build-system) + (native-inputs + (list python-flaky + python-pytest + python-pytest-asyncio + python-pytest-trio)) + (arguments + `(;; TODO: Get tests to work. + #:tests? #f + #:phases (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-vv"))))))) + (home-page "https://github.com/joerick/pyinstrument") + (synopsis "Call stack profiler for Python") + (description + "Pyinstrument is a Python profiler to help you optimize your code.") + (license license:bsd-3))) + (define-public python-vcrpy (package (name "python-vcrpy") -- cgit v1.3 From a5412de56ef5462958f6009331d967556aedd11d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 7 Apr 2022 16:47:46 +0200 Subject: gnu: Add python-parameterizedtestcase. * gnu/packages/python-check.scm (python-parameterizedtestcase): New variable. --- gnu/packages/python-check.scm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 02e1b5a9d71..2d35eb720ec 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2019, 2021 Ricardo Wurmus +;;; Copyright © 2019, 2021, 2022 Ricardo Wurmus ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2019, 2020, 2021 Efraim Flashner ;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer @@ -1993,6 +1993,25 @@ The purpose of this package is to provide an easy way to test asynchronous HTTP requests.") (license license:expat))) +(define-public python-parameterizedtestcase + (package + (name "python-parameterizedtestcase") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "parameterizedtestcase" version)) + (sha256 + (base32 "0zhjmsd16xacg4vd7zb75kw8q9khn52wvad634v1bvz7swaivk2c")))) + (build-system python-build-system) + (native-inputs (list python-setuptools)) ;for use_2to3 + (home-page + "https://github.com/msabramo/python_unittest_parameterized_test_case") + (synopsis "Parameterized tests for Python's unittest module") + (description "This package provides parameterized tests for Python's +@code{unittest} module taking inspiration from pytest.") + (license license:expat))) + (define-public python-pytest-rerunfailures (package (name "python-pytest-rerunfailures") -- cgit v1.3 From 919fdd6fcc18cd5ee68cab5b01c1dacae60bdbec Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Wed, 20 Apr 2022 17:27:57 +0000 Subject: gnu: Add python-sybil. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/python-check.scm (python-sybil): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/python-check.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 2d35eb720ec..8cf15262420 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2021, 2022 Guillaume Le Vaillant ;;; Copyright © 2021 Bonface Munyoki Kilyungi ;;; Copyright © 2022 Malte Frank Gerdes +;;; Copyright © 2022 Felix Gruber ;;; ;;; This file is part of GNU Guix. ;;; @@ -2056,3 +2057,31 @@ eliminate flaky failures.") Python objects. It tries to use the objects available in the standard @code{unittest} module.") (license license:expat))) + +(define-public python-sybil + (package + (name "python-sybil") + (version "3.0.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "sybil" version)) + (sha256 + (base32 "03ak1w93linfqx6c9lwgq5niyy3j9yblv4ip40hmlzmg0hidq0kg")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest"))))))) + (native-inputs (list python-pytest python-pytest-cov)) + (home-page "https://github.com/simplistix/sybil") + (synopsis "Automated testing for examples in code and documentation") + (description + "This library provides a way to check examples in your code and +documentation by parsing them from their source and evaluating the +parsed examples as part of your normal test run. Integration is +provided for the main Python test runners.") + (license license:expat))) -- cgit v1.3 From c29f9f72cdbdf3d3c937b4eb9f5b49cc9cd99594 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 5 Apr 2022 16:53:20 -0400 Subject: gnu: python-mypy: Update to 0.942 and fix search path. * gnu/packages/patches/python-mypy-use-sys-path.patch: New patch. * gnu/local.mk: Register it. * gnu/packages/python-check.scm (python-mypy): Update to 0.942. [source]: Apply patch. --- gnu/local.mk | 1 + .../patches/python-mypy-use-sys-path.patch | 130 +++++++++++++++++++++ gnu/packages/python-check.scm | 15 +-- 3 files changed, 139 insertions(+), 7 deletions(-) create mode 100644 gnu/packages/patches/python-mypy-use-sys-path.patch (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/local.mk b/gnu/local.mk index d7788796cc7..9c5c6896ba2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1722,6 +1722,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-waitress-fix-tests.patch \ %D%/packages/patches/python-werkzeug-tests.patch \ %D%/packages/patches/python-mypy-12332.patch \ + %D%/packages/patches/python-mypy-use-sys-path.patch \ %D%/packages/patches/qemu-build-info-manual.patch \ %D%/packages/patches/qemu-glibc-2.27.patch \ %D%/packages/patches/qemu-glibc-2.30.patch \ diff --git a/gnu/packages/patches/python-mypy-use-sys-path.patch b/gnu/packages/patches/python-mypy-use-sys-path.patch new file mode 100644 index 00000000000..1b12526456c --- /dev/null +++ b/gnu/packages/patches/python-mypy-use-sys-path.patch @@ -0,0 +1,130 @@ +This patch fixes the annotation files search of mypy on non-FHS distributions. + +Submitted upstream: https://github.com/python/mypy/pull/12530 + +diff --git a/mypy/main.py b/mypy/main.py +index 3d9836587..f9b0cbd39 100644 +--- a/mypy/main.py ++++ b/mypy/main.py +@@ -1033,10 +1033,10 @@ def process_options(args: List[str], + # Set target. + if special_opts.modules + special_opts.packages: + options.build_type = BuildType.MODULE +- egg_dirs, site_packages = get_site_packages_dirs(options.python_executable) ++ site_packages = get_site_packages_dirs(options.python_executable) + search_paths = SearchPaths((os.getcwd(),), + tuple(mypy_path() + options.mypy_path), +- tuple(egg_dirs + site_packages), ++ tuple(site_packages), + ()) + targets = [] + # TODO: use the same cache that the BuildManager will +diff --git a/mypy/modulefinder.py b/mypy/modulefinder.py +index 94d2dd34c..337a2d59b 100644 +--- a/mypy/modulefinder.py ++++ b/mypy/modulefinder.py +@@ -629,7 +629,7 @@ def get_prefixes(python_executable: Optional[str]) -> Tuple[str, str]: + + + @functools.lru_cache(maxsize=None) +-def get_site_packages_dirs(python_executable: Optional[str]) -> Tuple[List[str], List[str]]: ++def get_site_packages_dirs(python_executable: Optional[str]) -> List[str]: + """Find package directories for given python. + + This runs a subprocess call, which generates a list of the egg directories, and the site +@@ -648,51 +648,7 @@ def get_site_packages_dirs(python_executable: Optional[str]) -> Tuple[List[str], + site_packages = ast.literal_eval( + subprocess.check_output([python_executable, pyinfo.__file__, 'getsitepackages'], + stderr=subprocess.PIPE).decode()) +- return expand_site_packages(site_packages) +- +- +-def expand_site_packages(site_packages: List[str]) -> Tuple[List[str], List[str]]: +- """Expands .pth imports in site-packages directories""" +- egg_dirs: List[str] = [] +- for dir in site_packages: +- if not os.path.isdir(dir): +- continue +- pth_filenames = sorted(name for name in os.listdir(dir) if name.endswith(".pth")) +- for pth_filename in pth_filenames: +- egg_dirs.extend(_parse_pth_file(dir, pth_filename)) +- +- return egg_dirs, site_packages +- +- +-def _parse_pth_file(dir: str, pth_filename: str) -> Iterator[str]: +- """ +- Mimics a subset of .pth import hook from Lib/site.py +- See https://github.com/python/cpython/blob/3.5/Lib/site.py#L146-L185 +- """ +- +- pth_file = os.path.join(dir, pth_filename) +- try: +- f = open(pth_file, "r") +- except OSError: +- return +- with f: +- for line in f.readlines(): +- if line.startswith("#"): +- # Skip comment lines +- continue +- if line.startswith(("import ", "import\t")): +- # import statements in .pth files are not supported +- continue +- +- yield _make_abspath(line.rstrip(), dir) +- +- +-def _make_abspath(path: str, root: str) -> str: +- """Take a path and make it absolute relative to root if not already absolute.""" +- if os.path.isabs(path): +- return os.path.normpath(path) +- else: +- return os.path.join(root, os.path.normpath(path)) ++ return site_packages + + + def add_py2_mypypath_entries(mypypath: List[str]) -> List[str]: +@@ -781,7 +737,7 @@ def compute_search_paths(sources: List[BuildSource], + if options.python_version[0] == 2: + mypypath = add_py2_mypypath_entries(mypypath) + +- egg_dirs, site_packages = get_site_packages_dirs(options.python_executable) ++ site_packages = get_site_packages_dirs(options.python_executable) + base_prefix, prefix = get_prefixes(options.python_executable) + is_venv = base_prefix != prefix + for site_dir in site_packages: +@@ -801,7 +757,7 @@ def compute_search_paths(sources: List[BuildSource], + + return SearchPaths(python_path=tuple(reversed(python_path)), + mypy_path=tuple(mypypath), +- package_path=tuple(egg_dirs + site_packages), ++ package_path=tuple(site_packages), + typeshed_path=tuple(lib_path)) + + +diff --git a/mypy/pyinfo.py b/mypy/pyinfo.py +index ab2d3286b..9fb0501a1 100644 +--- a/mypy/pyinfo.py ++++ b/mypy/pyinfo.py +@@ -24,16 +24,11 @@ def getprefixes(): + + def getsitepackages(): + # type: () -> List[str] +- res = [] +- if hasattr(site, 'getsitepackages'): +- res.extend(site.getsitepackages()) + +- if hasattr(site, 'getusersitepackages') and site.ENABLE_USER_SITE: +- res.insert(0, site.getusersitepackages()) +- else: +- from distutils.sysconfig import get_python_lib +- res = [get_python_lib()] +- return res ++ # Simply return sys.path, which has already been expanded ++ # correctly via Python's site.py module, which takes care of .pth, ++ # sitecustomize.py files, etc. ++ return sys.path + + + if __name__ == '__main__': diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 8cf15262420..0a6bf423f0e 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2019, 2021, 2022 Ricardo Wurmus ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2019, 2020, 2021 Efraim Flashner -;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer +;;; Copyright © 2019, 2020, 2021, 2022 Maxim Cournoyer ;;; Copyright © 2019, 2021 Hartmut Goebel ;;; Copyright © 2020 Julien Lepiller ;;; Copyright © 2020, 2022 Marius Bakke @@ -1673,7 +1673,7 @@ supported by the MyPy typechecker.") (define-public python-mypy (package (name "python-mypy") - (version "0.931") + (version "0.942") (source (origin ;; Because of https://github.com/python/mypy/issues/9584, the @@ -1690,9 +1690,10 @@ supported by the MyPy typechecker.") (file-name (git-file-name name version)) (sha256 (base32 - "1v83flrdxh8grcp40qw04q4hzjflih9xwib64078vsxv2w36f817")) + "0hxnrqhvskiclwfj2s4gyfclzjas1dvpfxhyng8v7mq38rqps1j5")) (patches - (search-patches "python-mypy-12332.patch")))) + (search-patches "python-mypy-12332.patch" + "python-mypy-use-sys-path.patch")))) (build-system python-build-system) (arguments `(#:phases @@ -1714,10 +1715,10 @@ supported by the MyPy typechecker.") (home-page "http://www.mypy-lang.org/") (synopsis "Static type checker for Python") (description "Mypy is an optional static type checker for Python that aims -to combine the benefits of dynamic (or 'duck') typing and static typing. Mypy combines +to combine the benefits of dynamic typing and static typing. Mypy combines the expressive power and convenience of Python with a powerful type system and -compile-time type checking. Mypy type checks standard Python programs; run them using -any Python VM with basically no runtime overhead.") +compile-time type checking. Mypy type checks standard Python programs; run +them using any Python VM with basically no runtime overhead.") ;; Most of the code is under MIT license; Some files are under Python Software ;; Foundation License version 2: stdlib-samples/*, mypyc/lib-rt/pythonsupport.h and ;; mypyc/lib-rt/getargs.c -- cgit v1.3 From 529318bd22373557c95e74e1ea9c5365c403af19 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 5 Apr 2022 23:28:44 -0400 Subject: gnu: python-pytest-checkdocs: Update to 2.7.1. * gnu/packages/python-check.scm (python-pytest-checkdocs): Update to 2.7.1. --- gnu/packages/python-check.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 0a6bf423f0e..f44ab0ca9a2 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -921,18 +921,21 @@ doctest to render the object representations.") (define-public python-pytest-checkdocs (package (name "python-pytest-checkdocs") - (version "1.2.5") + (version "2.7.1") (source (origin (method url-fetch) (uri (pypi-uri "pytest-checkdocs" version)) (sha256 - (base32 "0m4kn7141i6k8qr8ak3lbmk9vim11xsrlnrggcfwczfrglc6jmia")))) + (base32 "1bn1wr3yz8avkwacffyh26za7mg20f9pajpakfk4cn7yvmgbhcrb")))) (build-system python-build-system) + (arguments (list #:tests? #f)) ;no tests in pypi archive (propagated-inputs - (list python-docutils python-importlib-metadata python-more-itertools)) - (native-inputs - (list python-setuptools-scm python-pytest)) + (list python-docutils + python-importlib-metadata + python-pep517 + python-pytest)) + (native-inputs (list python-setuptools-scm)) (home-page "https://github.com/jaraco/pytest-checkdocs") (synopsis "Check the README when running tests") (description -- cgit v1.3 From f2be0c5b2b19a4c867906f4ae1b4393d92cc4b08 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 6 Apr 2022 15:23:25 -0400 Subject: gnu: python-pytest-shutil: Adjust to use python-path. * gnu/packages/python-check.scm (python-pytest-shutil) [phases]{use-path-instead-of-path.py}: New phase. [propagated-inputs]: Replace python-path.py with python-path. --- gnu/packages/python-check.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index f44ab0ca9a2..5469200afc2 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -1080,6 +1080,12 @@ isort.") (arguments `(#:phases (modify-phases %standard-phases + (add-after 'unpack 'use-path-instead-of-path.py + ;; path.py is obsolete. + (lambda _ + (substitute* "setup.py" + (("'path.py'") + "'path'")))) (add-after 'unpack 'patch-tests (lambda _ (mkdir "/tmp/bin") @@ -1087,11 +1093,9 @@ isort.") (("dirname = '/bin'") "dirname = '/tmp/bin'") (("bindir = os.path.realpath\\('/bin'\\)") - "bindir = os.path.realpath('/tmp/bin')")) - #t))))) + "bindir = os.path.realpath('/tmp/bin')"))))))) (propagated-inputs - (list python-contextlib2 python-execnet python-pathpy - python-termcolor)) + (list python-contextlib2 python-execnet python-path python-termcolor)) (native-inputs (list python-mock python-pytest python-setuptools-git)) (home-page "https://github.com/manahl/pytest-plugins") -- cgit v1.3 From 8194b36ddf34fdae110c7feb5b3c7c3a97c6e42a Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 12 Apr 2022 23:53:54 -0400 Subject: gnu: Add python-pytest-tornado. * gnu/packages/python-check.scm (python-pytest-tornado): New variable. --- gnu/packages/python-check.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 5469200afc2..465c425a79b 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -1420,6 +1420,36 @@ also ensuring that the notebooks are running without errors.") "This package provides a pytest plugin for testing console scripts.") (license license:expat))) +(define-public python-pytest-tornado + (package + (name "python-pytest-tornado") + (version "0.8.1") + (source (origin + (method git-fetch) ;no tests in pypi archive + (uri (git-reference + (url "https://github.com/eugeniy/pytest-tornado") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "05hgq1m9g35kpc01im7ci1wd85xi1rdxnyms9izjg65c9976zn6x")))) + (build-system python-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-vv"))))))) + (propagated-inputs (list python-pytest python-setuptools python-tornado)) + (home-page "https://github.com/eugeniy/pytest-tornado") + (synopsis "Pytest plugin to ease testing tornado applications") + (description + "This package provides a py.test plugin providing fixtures and markers to +simplify testing of asynchronous tornado applications.") + (license license:asl2.0))) + (define-public python-pytest-tornasync (package (name "python-pytest-tornasync") -- cgit v1.3 From d72c53fa43a02cf7f9ddb975de01cb8514a6f806 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 13 Apr 2022 16:40:00 -0400 Subject: gnu: python-nbval: Fix build. * gnu/packages/python-check.scm (python-nbval) [phases]: Delete trailing #t. {check}: Skip newly failing 'test_conf_ignore_stderr' test. Remove INPUTS and OUTPUTS arguments. Add TESTS? and honor it. --- gnu/packages/python-check.scm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 465c425a79b..41b73172b05 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -1342,17 +1342,21 @@ new fixtures, new methods and new comparison objects.") (lambda _ ;; This test fails because of a mismatch in the output of LaTeX ;; equation environments. Seems OK to skip. - (delete-file "tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb") - #t)) + (delete-file + "tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb"))) (replace 'check - (lambda* (#:key inputs outputs #:allow-other-keys) - (add-installed-pythonpath inputs outputs) - (invoke "pytest" "-vv" "-k" - (string-append - ;; This only works with Pytest < 5. - "not nbdime_reporter" - ;; https://github.com/computationalmodelling/nbval/pull/148. - " and not test_timeouts"))))))) + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-vv" "-k" + (string-append + ;; This only works with Pytest < 5. + "not nbdime_reporter" + ;; https://github.com/computationalmodelling/nbval/pull/148. + " and not test_timeouts" + ;; It seems the output format has changed; the following + ;; test fails with "Unexpected output fields from + ;; running code: {'text/plain'}". + " and not test_conf_ignore_stderr ")))))))) (native-inputs (list python-pytest python-pytest-cov python-sympy)) (propagated-inputs -- cgit v1.3 From 50b620f119e3aea2876f4b8580a49de059fc038b Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 21 Apr 2022 23:14:29 -0400 Subject: gnu: Add python-beartype. * gnu/packages/python-check.scm (python-beartype): New variable. --- gnu/packages/python-check.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 41b73172b05..8cabd05dd58 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -70,6 +70,38 @@ Protocol (TAP) in Python. TAP is a line based test protocol for recording test data in a standard way.") (license license:bsd-3))) +(define-public python-beartype + (package + (name "python-beartype") + (version "0.10.4") + (source + (origin + (method url-fetch) + (uri (pypi-uri "beartype" version)) + (sha256 + (base32 "0amzckgw9c93bl4jf0q6322j9wyyf3i8vl03yixfkrpllzv6kv14")))) + (build-system python-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-vv" "beartype_test" + ;; These tests rely on git through the + ;; "get_main_readme_file" helper. + "-k" + (string-append "not test_doc_readme " + "and not test_sphinx " + "and not test_pep561_mypy")))))))) + (native-inputs + (list python-pytest)) + (home-page "https://github.com/beartype/beartype") + (synopsis "Fast runtime type checking for Python") + (description "Beartype aims to be a very fast runtime type checking tool +written in pure Python.") + (license license:expat))) + (define-public python-pytest-click (package (name "python-pytest-click") -- cgit v1.3 From 4d62953573ecf8a1e5616a4a7c1577d91ad9f57a Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 21 Apr 2022 23:20:23 -0400 Subject: gnu: Add python-nptyping. * gnu/packages/python-check.scm (python-nptyping): New variable. --- gnu/packages/python-check.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 8cabd05dd58..a1601d66568 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -1811,6 +1811,40 @@ them using any Python VM with basically no runtime overhead.") (delete 'ensure-no-mtimes-pre-1980)))) (native-inputs '())))) +(define-public python-nptyping + (package + (name "python-nptyping") + (version "2.0.0") + (source (origin + (method git-fetch) ;pypi only contains a binary wheel + (uri (git-reference + (url "https://github.com/ramonhagenaars/nptyping") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0839mcrv5jljq9k9124ssnl1hc1inbxwlwjk72imabsbqssjy9rb")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'build 'set-source-date-epoch + (lambda _ + ;; Otherwise the wheel building test would fail with "ZIP does + ;; not support timestamps before 1980". + (setenv "SOURCE_DATE_EPOCH" "315532800")))))) + (native-inputs + (list python-beartype + python-mypy + python-typeguard + python-wheel)) + (propagated-inputs (list python-numpy python-typing-extensions)) + (home-page "https://github.com/ramonhagenaars/nptyping") + (synopsis "Type hints for Numpy") + (description "This package provides extensive dynamic type checks for +dtypes and shapes of arrays for NumPy, extending @code{numpy.typing}.") + (license license:expat))) + (define-public python-pylama (package (name "python-pylama") -- cgit v1.3 From ba4ed74f9e9f1365cf70b6784571a75885020cae Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Wed, 27 Apr 2022 09:44:34 +0200 Subject: gnu: python-pytest-sanic: Update to 1.9.1. * gnu/packages/python-check.scm (python-pytest-sanic): Update to 1.9.1. Signed-off-by: Maxim Cournoyer --- gnu/packages/python-check.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index a1601d66568..b86f75dc1b4 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -1985,13 +1985,13 @@ help in debugging failures and optimizing the scheduler to improve speed.") (define-public python-pytest-sanic (package (name "python-pytest-sanic") - (version "1.7.0") + (version "1.9.1") (source (origin (method url-fetch) (uri (pypi-uri "pytest-sanic" version)) (sha256 (base32 - "0hm7im77dgqfk8k34qbbfhimg8hifl4zwpa2s3mgbknrjvyw5qpx")))) + "0shq1bqnydj0l3ipb73j1qh5kqcjvzkps30zk8grq3dwmh3wmnkr")))) (build-system python-build-system) (arguments ;; Tests depend on python-sanic. -- cgit v1.3 From 04ed3821cc7b15a22946ca972525626b41d71763 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 20 May 2022 09:49:23 +0200 Subject: gnu: Add python-test-utils. * gnu/packages/python-check.scm (python-test-utils): New variable. --- gnu/packages/python-check.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index b86f75dc1b4..d788935caa1 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -2166,6 +2166,24 @@ Python objects. It tries to use the objects available in the standard @code{unittest} module.") (license license:expat))) +(define-public python-test-utils + (package + (name "python-test-utils") + (version "0.1.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "test-utils" version)) + (sha256 + (base32 "0cs0gyihnkj8ya4yg3ld3ly73mpxrkn2gq9acamclhqvhxsv7zd6")))) + (build-system python-build-system) + (home-page "https://github.com/Kami/python-test-utils/") + (synopsis "Utilities for functional and integration tests") + (description + "This package provides a collection of utility functions and classes +which make writing and running functional and integration tests easier.") + (license license:asl2.0))) + (define-public python-sybil (package (name "python-sybil") -- cgit v1.3 From 1475672e5fdb6ca534762f373f0183b225d303d6 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 5 May 2022 08:18:57 -0400 Subject: gnu: Add python-avocado-framework. * gnu/packages/python-check.scm (python-avocado-framework): New variable. --- gnu/packages/python-check.scm | 82 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index d788935caa1..0803d6fed2e 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -33,9 +33,14 @@ (define-module (gnu packages python-check) #:use-module (gnu packages) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages check) + #:use-module (gnu packages docker) #:use-module (gnu packages django) #:use-module (gnu packages openstack) + #:use-module (gnu packages perl) #:use-module (gnu packages python-build) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) @@ -2102,6 +2107,83 @@ The purpose of this package is to provide an easy way to test asynchronous HTTP requests.") (license license:expat))) +(define-public python-avocado-framework + (package + (name "python-avocado-framework") + (version "96.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "avocado-framework" version)) + (sha256 + (base32 "0zhz6423p0b5gqx2mvg7dmq8m9gbsay7wqjdwzirlwcg2v3rcz0m")))) + (build-system python-build-system) + (arguments + (list + ;; The test suite hangs, due to a serious bug in Python/Avocado (see: + ;; https://github.com/avocado-framework/avocado/issues/4935). + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-paths + (lambda* (#:key native-inputs inputs #:allow-other-keys) + ;; These are runtime dependencies (inputs). + (substitute* "avocado/plugins/spawners/podman.py" + (("default='/usr/bin/podman'") + "default='podman'")) + (substitute* "avocado/utils/podman.py" + (("\"/usr/bin/env\", \"python3\"") + (format #f "~s" (search-input-file inputs "bin/python")))) + (substitute* "avocado/utils/memory.py" + (("\"sync\"") + (format #f "~s" (search-input-file inputs "bin/sync"))) + (("/bin/sh") + (search-input-file inputs "bin/sh"))) + ;; Batch process the tests modules with less care; if something + ;; is wrong, the test suite will fail. These are tests + ;; dependencies (native inputs). + (substitute* (find-files "selftests" "\\.py$") + (("#!/usr/bin/env") + (string-append "#!" (search-input-file (or native-inputs inputs) + "bin/env"))) + (("/bin/(false|true|sh|sleep|sudo)" _ name) + (search-input-file (or native-inputs inputs) + (string-append "bin/" name)))))) + (add-after 'unpack 'remove-broken-entrypoints + ;; The avocado-external-runner entry point fails to load, the + ;; 'scripts' top level package not being found (see: + ;; https://github.com/avocado-framework/avocado/issues/5370). + (lambda _ + (substitute* "setup.py" + (("'avocado-external-runner = scripts.external_runner:main'.*") + "")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (setenv "HOME" "/tmp") + (setenv "PYTHONPATH" (getcwd)) + (invoke "./selftests/check.py" "--skip" "static-checks"))))))) + (native-inputs (list bash-minimal coreutils-minimal perl sudo)) + (inputs (list bash-minimal coreutils-minimal)) + (home-page "https://avocado-framework.github.io/") + (synopsis "Tools and libraries to help with automated testing") + (description "Avocado is a set of tools and libraries to help with +automated testing, i.e. a test framework. Native tests are written in Python +and they follow the unittest pattern, but any executable can serve as a +test. The following output formats are supported: +@table @asis +@item xUnit +an XML format that contains test results in a structured form, and are used by +other test automation projects, such as Jenkins. +@item JSON +a widely used data exchange format. The JSON Avocado plugin outputs job +information, similarly to the xunit output plugin. +@item TAP +Provides the basic TAP (Test Anything Protocol) results. Unlike most existing +Avocado machine readable outputs this one is streamlined (per test results). +@end table") + (license license:gpl2))) ;some files are under GPLv2 only + (define-public python-parameterizedtestcase (package (name "python-parameterizedtestcase") -- cgit v1.3 From 937094b75c5d34c4a1a09069c7c74a28f9a8b382 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 6 Jun 2022 17:36:10 -0400 Subject: gnu: python-xunitparser: Update to 1.3.4. * gnu/packages/python-check.scm (python-xunitparser): Update to 1.3.4. --- gnu/packages/python-check.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 0803d6fed2e..cb22972d10c 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -2224,13 +2224,13 @@ eliminate flaky failures.") (define-public python-xunitparser (package (name "python-xunitparser") - (version "1.3.3") + (version "1.3.4") (source (origin (method url-fetch) (uri (pypi-uri "xunitparser" version)) (sha256 - (base32 "05amn9yik0mxg89iiprkb6lrmc7rlccgvwajrpyfi6zbp8mjdsgn")))) + (base32 "00lapxi770mg7jkw16zy3a91hbdfz4a9h43ryczdsgd3z4cl6vyf")))) (build-system python-build-system) (arguments `(#:phases -- cgit v1.3