From 579a1a8c029e97b69a7e3597ff9fd287805cf644 Mon Sep 17 00:00:00 2001 From: Troy Figiel Date: Sun, 21 Jan 2024 18:22:09 +0100 Subject: gnu: Add python-pandas-vet. * gnu/packages/python-xyz.scm (python-pandas-vet): New variable. Signed-off-by: Sharlatan Hellseher --- gnu/packages/python-check.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 37cabf4cff..dbc4321bb2 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2022 Felix Gruber ;;; Copyright © 2022 Tomasz Jeneralczyk ;;; Copyright © 2022 jgart +;;; Copyright © 2024 Troy Figiel ;;; ;;; This file is part of GNU Guix. ;;; @@ -2338,6 +2339,31 @@ (define-public python-avocado-framework @end table") (license license:gpl2))) ;some files are under GPLv2 only +(define-public python-pandas-vet + (package + (name "python-pandas-vet") + ;; Newer versions require flake8>=6.0.0. + (version "0.2.3") + (source + (origin + ;; No tests in the PyPI tarball. + (method git-fetch) + (uri (git-reference + (url "https://github.com/deppen8/pandas-vet") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1b3pqcargv68p2lpv72q49siq6mxfh3znxhz9vd91rp6fd6lf2cz")))) + (build-system pyproject-build-system) + (propagated-inputs (list python-attrs python-flake8)) + (native-inputs (list python-pytest)) + (home-page "https://github.com/deppen8/pandas-vet") + (synopsis "Opionated @code{flake8} plugin for @code{pandas} code") + (description + "This package provides a @code{flake8} plugin to lint @code{pandas} code +in an opinionated way.") + (license license:expat))) + (define-public python-parameterizedtestcase (package (name "python-parameterizedtestcase") -- cgit v1.2.3 From a3f02bc7809f3f3c8e987826e43edf7e87867a6c Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 11 Feb 2024 11:25:34 +0000 Subject: gnu: python-beartype: Simplify package. * gnu/packages/python-check.scm (python-beartype) [build-system]: Swap to pyproject-build-system. [arguments]: Use standard 'check phase and <#:test-flags>. Change-Id: I372c5be3b142f0e25d15fd2bac20fc9cd4d8030c --- gnu/packages/python-check.scm | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index dbc4321bb2..a790c66d6e 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -107,20 +107,16 @@ (define-public python-beartype (uri (pypi-uri "beartype" version)) (sha256 (base32 "0amzckgw9c93bl4jf0q6322j9wyyf3i8vl03yixfkrpllzv6kv14")))) - (build-system python-build-system) + (build-system pyproject-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")))))))) + (list + #:test-flags + #~(list + "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") -- cgit v1.2.3 From 120e2a64dadb9cc0893ab3dae51b72098715e860 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 11 Feb 2024 11:29:00 +0000 Subject: gnu: python-pytest-csv: Simplify package. * gnu/packages/python-check.scm (python-pytest-csv) [build-system]: Swap to pyproejct-build-system. [arguments]: Use standard 'check phase. Change-Id: Iae04747b117bf5b5f9fb3c8b57cd40b8822edd77 --- gnu/packages/python-check.scm | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index a790c66d6e..31827dbf4b 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -179,15 +179,7 @@ (define-public python-pytest-csv (sha256 (base32 "17518f2fn5l98lyk9p8r7215c1whi61imzrh6ahrmcksr8w0zz04")))) - (build-system python-build-system) - (arguments - `(#:phases - (modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? inputs outputs #:allow-other-keys) - (when tests? - (add-installed-pythonpath inputs outputs) - (invoke "pytest"))))))) + (build-system pyproject-build-system) (native-inputs (list python-pytest-flake8 python-pytest-xdist python-tabulate)) (propagated-inputs -- cgit v1.2.3 From bcd9a40c4951fa2f86978df888c05e003c9f7cc0 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 11 Feb 2024 11:35:46 +0000 Subject: gnu: python-pyinstrument: Update to 4.6.2. * gnu/packages/python-check.scm (python-pyinstrument): Update to 4.6.2. Change-Id: I28e147272f273c04f7221f6d4f70677aee9a3747 --- 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 31827dbf4b..90f2f4c8ae 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -320,13 +320,13 @@ (define-public python-junit-xml (define-public python-pyinstrument (package (name "python-pyinstrument") - (version "4.1.1") + (version "4.6.2") (source (origin (method url-fetch) (uri (pypi-uri "pyinstrument" version)) (sha256 - (base32 "18n3waxsxcd48pmcp8158s5rlancll2000amrdck9zfj5hfpkhhx")))) + (base32 "1xnp1pjhcj1xl4dq20yzzj9599cmiyxb2azblsyjnl6qgr8yw0h0")))) (build-system python-build-system) (native-inputs (list python-flaky -- cgit v1.2.3 From 5ccae1ae44b6f2b3f8a687611d61194a14dc1e0f Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 11 Feb 2024 11:45:41 +0000 Subject: gnu: python-pyinstrument: Enable tests. * gnu/packages/python-check.scm (python-pyinstrument) [build-system]: Swap to pyproject-build-system. [native-inputs]: Add python-greenlet. Change-Id: I1cd0c3e906fbbdc561e66bae9fe35333f61801cf --- gnu/packages/python-check.scm | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 90f2f4c8ae..315ea74459 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -327,20 +327,28 @@ (define-public python-pyinstrument (uri (pypi-uri "pyinstrument" version)) (sha256 (base32 "1xnp1pjhcj1xl4dq20yzzj9599cmiyxb2azblsyjnl6qgr8yw0h0")))) - (build-system python-build-system) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + #~(list "-k" (string-append + ;; Disable some failing tests. + "not test_script_execution_details" + " and not test_path_execution_details" + " and not test_module_execution_details" + " and not test_program_passed_as_string_execution_details")) + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'build-extensions + (lambda _ + (setenv "HOME" "/tmp") + (invoke "python" "setup.py" "build_ext" "--inplace")))))) (native-inputs (list python-flaky + python-greenlet 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 -- cgit v1.2.3 From 592a6e1cebf2213c4e24919245edc28497d0f107 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 11 Feb 2024 11:50:43 +0000 Subject: gnu: python-pytest-socket: Simplify package, enable tests. * gnu/packages/python-check.scm (python-pytest-socket) [build-system]: Swap to pyproject-build-system. [arguments] <#:test-flags>: Disable tests requiring network access. <#:phases>: Use standard phases. Change-Id: Ib7fe0b3dab4e269c00856a10b8ca23acc8c8e180 --- gnu/packages/python-check.scm | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 315ea74459..51a38bbcbe 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -426,31 +426,20 @@ (define-public python-pytest-socket (sha256 (base32 "1dkr86nxkxc0ka3rdnpmk335m8gl1zh1sy8i7w4w1jsidbf82jvw")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - ;; FIXME: Tests fail a lot, probably requiring Internet access. - (list #:tests? #f - #:phases #~(modify-phases %standard-phases - (replace 'build - (lambda _ - (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" - #$version) - (setenv "SOURCE_DATE_EPOCH" "315532800") - (invoke "python" - "-m" - "build" - "--wheel" - "--no-isolation" - "."))) - (add-before 'check 'disable-unsupported-test - (lambda _ - (substitute* "tests/test_async.py" - (("def test_asynctest") - "def __off_test_asynctest")))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python" "-m" "pytest" "-vvv"))))))) + (list + #:test-flags + #~(list "-k" (string-append + ;; Disable test requiring network access. + "not test_disable_socket_urllib" + " and not test_parametrize_with_socket_enabled_and_allow_hosts" + " and not test_global_disable_and_allow_host" + " and not test_asynctest" + " and not test_httpx_fails" + " and not test_disabled_urllib_fails" + " and not test_urllib_succeeds_by_default" + " and not test_enabled_urllib_succeeds")))) (native-inputs (list python-httpx python-poetry-core python-pypa-build -- cgit v1.2.3