* [bug#68391] [PATCH 1/3] gnu: Add python-typeguard-4.
2024-01-11 21:35 [bug#68391] [PATCH 0/3] Add python-pandera Troy Figiel
@ 2024-01-11 20:54 ` Troy Figiel
2024-01-11 20:58 ` [bug#68391] [PATCH 2/3] gnu: Add python-pandas-stubs Troy Figiel
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Troy Figiel @ 2024-01-11 20:54 UTC (permalink / raw)
To: 68391
* gnu/packages/python-xyz.scm (python-typeguard-4): New variable.
---
gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 46a5e81cb4..d7bbdbdb13 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -24804,6 +24804,24 @@ (define-public python-typeguard
with PEP 484 argument (and return) type annotations.")
(license license:expat)))
+(define-public python-typeguard-4
+ (package
+ (inherit python-typeguard)
+ (name "python-typeguard")
+ ;; This is the latest version we can use, becaue python-typeguard >= 4.0.1
+ ;; requires python-typing-extensions >= 4.7.0.
+ (version "4.0.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "typeguard" version))
+ (sha256
+ (base32 "11yrc7pv2fajmicwiyc92sb5gphlw3zbxww8f2prrsh6rgdv6kqr"))))
+ (build-system pyproject-build-system)
+ (arguments
+ '())
+ (propagated-inputs (list python-typing-extensions))))
+
(define-public bpython
(package
(name "bpython")
--
2.42.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#68391] [PATCH 2/3] gnu: Add python-pandas-stubs.
2024-01-11 21:35 [bug#68391] [PATCH 0/3] Add python-pandera Troy Figiel
2024-01-11 20:54 ` [bug#68391] [PATCH 1/3] gnu: Add python-typeguard-4 Troy Figiel
@ 2024-01-11 20:58 ` Troy Figiel
2024-01-11 21:17 ` [bug#68391] [PATCH 3/3] gnu: Add python-pandera Troy Figiel
2024-01-11 22:05 ` [bug#68391] Small description adjustment Troy Figiel
3 siblings, 0 replies; 6+ messages in thread
From: Troy Figiel @ 2024-01-11 20:58 UTC (permalink / raw)
To: 68391
* gnu/packages/python-science.scm (python-pandas-stubs): New variable.
---
gnu/packages/python-science.scm | 58 +++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 8065de0e99..d8e0b343fb 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -561,6 +561,64 @@ (define-public python-pandas
doing practical, real world data analysis in Python.")
(license license:bsd-3)))
+(define-public python-pandas-stubs
+ (package
+ (name "python-pandas-stubs")
+ ;; The versioning follows that of Pandas and uses the date of the
+ ;; python-pandas-stubs release. This is the latest version of
+ ;; python-pandas-stubs for python-pandas 1.4.4.
+ (version "1.4.4.220919")
+ (source
+ (origin
+ ;; No tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/pandas-dev/pandas-stubs")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "14fhj1y71akwl41ws7cpazsbq5b8wf4rwaydqq2h39q7gylpcp99"))))
+ (build-system pyproject-build-system)
+ (arguments
+ '(#:phases (modify-phases %standard-phases
+ (add-before 'check 'prepare-x
+ (lambda _
+ (system "Xvfb &")
+ (setenv "DISPLAY" ":0")
+ ;; xsel needs to write a log file.
+ (setenv "HOME"
+ (getcwd)))))))
+ (propagated-inputs (list python-types-pytz))
+ ;; Add python-fastparquet to native inputs once it has been packaged. Its
+ ;; tests will be skipped for now.
+ (native-inputs (list python-lxml
+ python-matplotlib
+ python-pandas
+ python-poetry-core
+ python-pyarrow
+ python-pyreadstat
+ python-pytest
+ python-scipy
+ python-sqlalchemy
+ python-tables
+ python-tabulate
+ python-xarray
+ ;; Needed to test clipboard support.
+ which
+ xclip
+ xorg-server-for-tests
+ xsel))
+ (home-page "https://pandas.pydata.org")
+ (synopsis "Type annotations for pandas")
+ (description
+ "This package contains public type stubs for @code{python-pandas},
+following the convention of providing stubs in a separate package, as
+specified in @acronym{PEP, Python Enhancement Proposal} 561. The stubs cover
+the most typical use cases of @code{python-pandas}. In general, these stubs
+are narrower than what is possibly allowed by pandas, but follow a convention
+of suggesting best recommended practices for using @code{python-pandas}.")
+ (license license:bsd-3)))
+
(define-public python-pythran
(package
(name "python-pythran")
--
2.42.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#68391] [PATCH 3/3] gnu: Add python-pandera.
2024-01-11 21:35 [bug#68391] [PATCH 0/3] Add python-pandera Troy Figiel
2024-01-11 20:54 ` [bug#68391] [PATCH 1/3] gnu: Add python-typeguard-4 Troy Figiel
2024-01-11 20:58 ` [bug#68391] [PATCH 2/3] gnu: Add python-pandas-stubs Troy Figiel
@ 2024-01-11 21:17 ` Troy Figiel
2024-01-11 22:05 ` [bug#68391] Small description adjustment Troy Figiel
3 siblings, 0 replies; 6+ messages in thread
From: Troy Figiel @ 2024-01-11 21:17 UTC (permalink / raw)
To: 68391
* gnu/packages/python-science.scm (python-pandera): New variable.
---
gnu/packages/python-science.scm | 75 +++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index d8e0b343fb..f82cbdb79c 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -619,6 +619,81 @@ (define-public python-pandas-stubs
of suggesting best recommended practices for using @code{python-pandas}.")
(license license:bsd-3)))
+(define-public python-pandera
+ (package
+ (name "python-pandera")
+ (version "0.17.2")
+ (source
+ (origin
+ ;; No tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/unionai-oss/pandera")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1mnqk583z90k1n0z3lfa4rd0ng40v7hqfk7phz5gjmxlzfjbxa1x"))
+ (modules '((guix build utils)))
+ ;; These tests require PySpark. We need to remove the entire directory,
+ ;; since the conftest.py in this directory contains a PySpark import.
+ ;; (See: https://github.com/pytest-dev/pytest/issues/7452)
+ (snippet '(delete-file-recursively "tests/pyspark"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:test-flags '(list "-k"
+ (string-append
+ ;; Needs python-pandas >= 1.5
+ "not test_python_std_list_dict_generics"
+ " and not test_python_std_list_dict_empty_and_none"
+ " and not test_pandas_modules_importable"))))
+ ;; 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
+ ;; skip the pyspark and io tests due to missing packages python-pyspark
+ ;; and python-frictionless.
+ (propagated-inputs (list python-hypothesis ;strategies extra
+ python-multimethod
+ python-numpy
+ python-packaging
+ python-pandas
+ python-pandas-stubs ;mypy extra
+ python-pydantic
+ python-scipy ;hypotheses extra
+ python-typeguard-4
+ python-typing-inspect
+ python-wrapt))
+ (native-inputs (list python-dask ;dask extra
+ python-fastapi ;fastapi extra
+ python-geopandas ;geopandas extra
+ python-modin ;modin extra
+ python-pyarrow ;needed to run fastapi tests
+ python-pytest
+ python-pytest-asyncio
+ python-sphinx
+ python-uvicorn)) ;needed to run fastapi tests
+ (home-page "https://github.com/unionai-oss/pandera")
+ (synopsis "Perform data validation on dataframe-like objects")
+ (description
+ "@code{python-pandera} provides a flexible and expressive API for
+performing data validation on dataframe-like objects to make data processing
+pipelines more readable and robust. Dataframes contain information that
+@code{python-pandera} explicitly validates at runtime. This is useful in
+production-critical data pipelines or reproducible research settings. With
+@code{python-pandera}, you can:
+
+@itemize
+@item Define a schema once and use it to validate different dataframe types.
+@item Check the types and properties of columns.
+@item Perform more complex statistical validation like hypothesis testing.
+@item Seamlessly integrate with existing data pipelines via function decorators.
+@item Define dataframe models with the class-based API with pydantic-style syntax.
+@item Synthesize data from schema objects for property-based testing.
+@item Lazily validate dataframes so that all validation rules are executed.
+@item Integrate with a rich ecosystem of tools like @code{python-pydantic},
+@code{python-fastapi} and @code{python-mypy}.
+@end itemize")
+ (license license:expat)))
+
(define-public python-pythran
(package
(name "python-pythran")
--
2.42.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#68391] [PATCH 0/3] Add python-pandera
@ 2024-01-11 21:35 Troy Figiel
2024-01-11 20:54 ` [bug#68391] [PATCH 1/3] gnu: Add python-typeguard-4 Troy Figiel
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Troy Figiel @ 2024-01-11 21:35 UTC (permalink / raw)
To: 68391
This patch series adds python-pandera and its dependencies.
Unfortunately, directly upgrading python-typeguard to a more recent
version breaks a variety of packages (it has 300+ dependents). For that
reason, python-typeguard-4 has been introduced.
Troy Figiel (3):
gnu: Add python-typeguard-4.
gnu: Add python-pandas-stubs.
gnu: Add python-pandera.
gnu/packages/python-science.scm | 133 ++++++++++++++++++++++++++++++++
gnu/packages/python-xyz.scm | 18 +++++
2 files changed, 151 insertions(+)
base-commit: 637b72e2b83a6332849218ef1f193124fa8239eb
--
2.42.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [bug#68391] Small description adjustment
2024-01-11 21:35 [bug#68391] [PATCH 0/3] Add python-pandera Troy Figiel
` (2 preceding siblings ...)
2024-01-11 21:17 ` [bug#68391] [PATCH 3/3] gnu: Add python-pandera Troy Figiel
@ 2024-01-11 22:05 ` Troy Figiel
2024-01-17 10:05 ` bug#68391: " Mathieu Othacehe
3 siblings, 1 reply; 6+ messages in thread
From: Troy Figiel @ 2024-01-11 22:05 UTC (permalink / raw)
To: 68391
I just noticed there is a single `pandas' I did not rewrite as
`@code{python-pandas}' in the description of `python-pandas-stubs'. If
the patches look good as they are, I kindly ask a committer to make that
small adjustment before applying them, as to keep the look of the
description uniform.
Thanks!
Troy
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#68391: Small description adjustment
2024-01-11 22:05 ` [bug#68391] Small description adjustment Troy Figiel
@ 2024-01-17 10:05 ` Mathieu Othacehe
0 siblings, 0 replies; 6+ messages in thread
From: Mathieu Othacehe @ 2024-01-17 10:05 UTC (permalink / raw)
To: Troy Figiel; +Cc: 68391-done
Hey,
> I just noticed there is a single `pandas' I did not rewrite as
> `@code{python-pandas}' in the description of `python-pandas-stubs'. If
> the patches look good as they are, I kindly ask a committer to make that
> small adjustment before applying them, as to keep the look of the
> description uniform.
Fixed that and a typo in the first patch before applying,
Thanks,
Mathieu
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-01-17 10:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11 21:35 [bug#68391] [PATCH 0/3] Add python-pandera Troy Figiel
2024-01-11 20:54 ` [bug#68391] [PATCH 1/3] gnu: Add python-typeguard-4 Troy Figiel
2024-01-11 20:58 ` [bug#68391] [PATCH 2/3] gnu: Add python-pandas-stubs Troy Figiel
2024-01-11 21:17 ` [bug#68391] [PATCH 3/3] gnu: Add python-pandera Troy Figiel
2024-01-11 22:05 ` [bug#68391] Small description adjustment Troy Figiel
2024-01-17 10:05 ` bug#68391: " Mathieu Othacehe
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.