gnu: python-pandera: Fix tests.

* gnu/packages/python-science.scm (python-pandera) [source] <snippet>:
Remove tests deletion and ignore them with pytest options which are
working now.
[arguments] <test-flags> Skip some more tests; run tests in parallel up
to 8 thread, supported upstream.
[propagated-inputs]: Remove python-hypothesis; add
python-hypothesis-next and python-modin.
[native-inputs]: Add python-pytest-xdist.

Change-Id: I45482203519ceb2208a330d91c07d12b65e6ee53
This commit is contained in:
Sharlatan Hellseher 2025-04-24 12:36:32 +01:00
parent fdf07c14d4
commit 201d30fb4f
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -1995,6 +1995,8 @@ idea of the remaining amount of computation to be done.")
(define-public python-pandera (define-public python-pandera
(package (package
(name "python-pandera") (name "python-pandera")
;; FIXME: The latest version requires hypothesis >= 6.92.7, which can't be
;; picked from python-hypothesis-next for some reason.
(version "0.18.0") (version "0.18.0")
(source (source
(origin (origin
@ -2005,34 +2007,43 @@ idea of the remaining amount of computation to be done.")
(commit (string-append "v" version)))) (commit (string-append "v" version))))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "14b5aij5zjkwvsimg0v00qvp59mhhq7ljim4qghcn432vkg9gh47")) (base32 "14b5aij5zjkwvsimg0v00qvp59mhhq7ljim4qghcn432vkg9gh47"))))
(modules '((guix build utils)))
;; These tests require PySpark and Modin. We need to remove the entire
;; directory, since the conftest.py in these directories contain
;; imports. (See: https://github.com/pytest-dev/pytest/issues/7452)
(snippet '(begin
(delete-file-recursively "tests/pyspark")
(delete-file-recursively "tests/modin")))))
(build-system pyproject-build-system) (build-system pyproject-build-system)
(arguments (arguments
(list (list
#:test-flags '(list "-k" #:test-flags
(string-append #~(list "--numprocesses" (number->string (min 8 (parallel-job-count)))
;; Mypy functionality is experimental and relying "--ignore=tests/pyspark"
;; on pandas-stubs can lead to false "-k" (string-join
;; positives. These tests currently fail. ;; Failed: DID NOT RAISE <class 'pandera.errors.SchemaError'>
"not test_python_std_list_dict_generics" (list "not test_from_records_validates_the_schema"
" and not test_python_std_list_dict_empty_and_none" "test_init_pandas_dataframe_errors"
" and not test_pandas_modules_importable" "test_schema_dtype_crs_without_coerce"
" and not test_check_groups" "test_schema_from_dataframe"
;; This is a test failure due to unexpected error "test_schema_model"
;; message format. It is harmless. "test_validate_coerce_on_init"
" and not test_pandas_stubs_false_positives")))) ;; multimethod.DispatchError: ('str_length: 0
;; methods found', (<class
;; 'pandas.core.series.Series'>, <class 'NoneType'>,
;; <class 'int'>), [])
"test_succeeding"
"test_failing"
"test_failing_with_none"
;; pandera.errors.SchemaError: Error while executing
;; check function: KeyError("foo")
"test_check_groups"
;; [pandas_series.py-plugin_mypy.ini-expected_errors13]
;; - assert 1 == 2
"test_pandas_stubs_false_positives"
;; TypeError: type 'Series' is not subscriptable
"test_pandas_modules_importable")
" and not "))))
;; Pandera comes with a lot of extras. We test as many as possible, but do ;; Pandera comes with a lot of extras. We test as many as possible, but do
;; not include all of them in the propagated-inputs. Currently, we have to ;; not include all of them in the propagated-inputs. Currently, we have to
;; skip the pyspark and io tests due to missing packages python-pyspark ;; skip the pyspark and io tests due to missing packages python-pyspark
;; and python-frictionless. ;; and python-frictionless.
(propagated-inputs (list python-hypothesis ;strategies extra (propagated-inputs (list python-hypothesis-next ;strategies extra
python-modin
python-multimethod python-multimethod
python-numpy python-numpy
python-packaging python-packaging
@ -2049,6 +2060,7 @@ idea of the remaining amount of computation to be done.")
python-pyarrow ;needed to run fastapi tests python-pyarrow ;needed to run fastapi tests
python-pytest python-pytest
python-pytest-asyncio python-pytest-asyncio
python-pytest-xdist
python-setuptools python-setuptools
python-sphinx python-sphinx
python-uvicorn ;needed to run fastapi tests python-uvicorn ;needed to run fastapi tests