[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
47/49: gnu: Add python-pytest-examples.
From: |
guix-commits |
Subject: |
47/49: gnu: Add python-pytest-examples. |
Date: |
Fri, 29 Mar 2024 11:15:29 -0400 (EDT) |
sharlatan pushed a commit to branch master
in repository guix.
commit 90b636e4b33a00f8c730e64df052fe2924cb5764
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Mon Mar 18 14:46:33 2024 +0000
gnu: Add python-pytest-examples.
* gnu/packages/check.scm (python-pytest-examples): New variable.
Change-Id: I8199a7d7294c3b04134474f9f116468ac327cba8
---
gnu/packages/check.scm | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index d0fd975487..99990a8980 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -1399,6 +1399,78 @@ supports coverage of subprocesses.")
from a .env file before running tests.")
(license license:expat)))
+(define-public python-pytest-examples
+ (package
+ (name "python-pytest-examples")
+ (version "0.0.10")
+ (source
+ (origin
+ ;; No tests in the PyPI tarball.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/pydantic/pytest-examples")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0lwxgyfj6lnkhmrvb6kzfskpwfz70kxnhnjvyl3l65k568c4wb4c"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:test-flags
+ #~(list "-k"
+ (string-append
+ ;; Disable tests requiring pthon-ruff.
+ "not test_ruff"
+ " and not test_ruff_config"
+ " and not test_ruff_offset"
+ " and not test_ruff_ok"
+ " and not test_ruff_error"
+ " and not test_update_files"
+ " and not test_cases_update[simple.md]"
+ " and not test_cases_update[dataclass_indent.md]"
+ " and not test_cases_update[long_python_lines.py]"
+ " and not test_cases_update[simple.py]"
+ " and not test_cases_update[python_class.py]"
+ " and not test_cases_update[call_twice.md]"
+ " and not test_insert_print[example/README.md:3-33]"
+ " and not test_insert_print[example/README.md:37-40]"
+ " and not test_insert_print[example/README.md:44-47]"
+ " and not test_insert_print[example/README.md:49-66]"
+ " and not test_python_self[example/test_example.py:28-31]"
+ " and not test_python_self[example/test_example.py:40-43]"
+ " and not
test_python_self_change_docstyle[example/test_example.py:28-31]"
+ " and not
test_python_self_change_docstyle[example/test_example.py:40-43]"))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'relax-requirements
+ (lambda _
+ (substitute* "pyproject.toml"
+ ;; XXX: Removing ruff from required packages to pass Sanity
+ ;; check, add it back when it's available.
+ (("'ruff>=0.0.258',") "")
+ ;; black>=23
+ ((">=23") ">22")))))))
+ (propagated-inputs
+ ;; TODO: Add python-ruff once it has been packaged.
+ (list python-black python-pytest))
+ (native-inputs
+ (list python-hatchling))
+ (home-page "https://pypi.org/project/pytest-examples/")
+ (synopsis "Pytest plugin for testing examples in docstrings and markdown
files")
+ (description
+ "Pytest-examples provides functionality for testing Python code examples
+in docstrings and markdown files, with its main features being:
+
+@itemize
+@item lint code examples using ruff and black
+@item run code examples
+@item run code examples and check print statements are inlined correctly in
+the code
+@item It can also update code examples in place to format them and insert or
+update print statements
+@end itemize")
+ (license license:expat)))
+
(define-public python-pytest-httpserver
(package
(name "python-pytest-httpserver")
- 25/49: gnu: python-asdf-wcs-schemas: Update to 0.4.0., (continued)
- 25/49: gnu: python-asdf-wcs-schemas: Update to 0.4.0., guix-commits, 2024/03/29
- 34/49: gnu: python-glymur: Update to 0.12.9., guix-commits, 2024/03/29
- 22/49: gnu: python-asdf-transform-schemas: Update to 0.5.0., guix-commits, 2024/03/29
- 15/49: gnu: python-glymur: Speed up tests., guix-commits, 2024/03/29
- 27/49: gnu: python-pyvo: Update to 1.5.1., guix-commits, 2024/03/29
- 29/49: gnu: python-gwcs: Update to 0.21.0., guix-commits, 2024/03/29
- 31/49: gnu: python-suntime: Update to 1.3.2., guix-commits, 2024/03/29
- 32/49: gnu: python-suntime: Refresh package style., guix-commits, 2024/03/29
- 35/49: gnu: python-specutils: Update to 1.13.0., guix-commits, 2024/03/29
- 37/49: gnu: python-stcal: Enable sanity check., guix-commits, 2024/03/29
- 47/49: gnu: Add python-pytest-examples.,
guix-commits <=
- 42/49: gnu: Add python-asdf-compression., guix-commits, 2024/03/29
- 49/49: gnu: python-hvpy: Update to 1.1.0., guix-commits, 2024/03/29
- 03/49: gnu: python-blosc: Move to python-compression., guix-commits, 2024/03/29
- 28/49: gnu: python-astroquery: Update to 0.4.7., guix-commits, 2024/03/29
- 38/49: gnu: python-stdatamodels: Update to 1.10.0., guix-commits, 2024/03/29
- 41/49: gnu: Add python-asdf-zarr., guix-commits, 2024/03/29
- 46/49: gnu: Add python-cmyt., guix-commits, 2024/03/29
- 20/49: gnu: python-asdf-unit-schemas: Update to 0.2.0., guix-commits, 2024/03/29
- 19/49: gnu: python-cdflib: Enable all tests., guix-commits, 2024/03/29
- 23/49: gnu: python-asdf: Update to 3.1.0., guix-commits, 2024/03/29