From patchwork Wed Mar 20 22:28:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sharlatan Hellseher X-Patchwork-Id: 62074 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6FADF27BBEB; Wed, 20 Mar 2024 22:32:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id ABD4E27BBE2 for ; Wed, 20 Mar 2024 22:32:26 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rn4Tk-0002cc-4C; Wed, 20 Mar 2024 18:32:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rn4T7-0001kH-27 for guix-patches@gnu.org; Wed, 20 Mar 2024 18:31:38 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rn4T6-0005uw-67 for guix-patches@gnu.org; Wed, 20 Mar 2024 18:31:32 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rn4Tj-0005mz-OA for guix-patches@gnu.org; Wed, 20 Mar 2024 18:32:11 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69924] [PATCH 47/49] gnu: Add python-pytest-examples. Resent-From: Sharlatan Hellseher Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 20 Mar 2024 22:32:11 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69924 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69924@debbugs.gnu.org Cc: Sharlatan Hellseher Received: via spool by 69924-submit@debbugs.gnu.org id=B69924.171097392722156 (code B ref 69924); Wed, 20 Mar 2024 22:32:11 +0000 Received: (at 69924) by debbugs.gnu.org; 20 Mar 2024 22:32:07 +0000 Received: from localhost ([127.0.0.1]:36613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rn4Te-0005l2-JT for submit@debbugs.gnu.org; Wed, 20 Mar 2024 18:32:07 -0400 Received: from mail-lj1-f170.google.com ([209.85.208.170]:49306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rn4Sc-0005Zh-RV for 69924@debbugs.gnu.org; Wed, 20 Mar 2024 18:31:03 -0400 Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2d288bac3caso4805201fa.2 for <69924@debbugs.gnu.org>; Wed, 20 Mar 2024 15:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710973757; x=1711578557; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IbIJNBD7Hdfib15JRvxyAx4h1Q75u3yH2J8hGF+00c4=; b=CaQnCwxzhAyKhciDvpHkzGUtz7/nlGP1UW79NTemTmVAu98AFXCFEyus38Tu5UHkf2 jVPXEq5Zqa5hdi/yllwZAyNw2z9HnSNv7+eo2AaimBBnSsGan3PiDDrzST/qzaQbFE8e P+rLuCQaXRipX0MjNqg0G26mQ/d/61CiE3QlhMw21vJVkJ3v8RSVa8oqLpPT5i4R5wIC JASYHoVjbORiw6gGAebZqrDedDjm/kuDCltet2M+eTOtOM0NfsqAcgI0k87DT5V5v0lv OoXikK8uY12T+2aX+5wIXrGdpOVr3wLwdgsoMqiQzKoi9BgCW0/nW6qiaGxXdcQC4SNH UXNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710973757; x=1711578557; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IbIJNBD7Hdfib15JRvxyAx4h1Q75u3yH2J8hGF+00c4=; b=tq8odESVm/boXx2owp8DP1RsGiEGNCZyzsaL4wwAmRPLn6KJQ4Qe1eNbWq/gh2MBi0 mf2/ePFXQz70lYiYDHi+2+Gbno6RY8GX5pnPf9+t7rDUVcJ2bBe5Xc36B/7t4KRIrcWX dl5vl6dMNw2Q9Tsz8slyDFMNOsjfN0Cap7IsdX9G3XRWGUV5z3HHDEpic4AcyvTdFDOV etdQjnJciT6mIDOpLR7CM9hlACbu3+rofl7duMC9Cch7FSRQHoSJ1hmmvLCP1OXRXfbX 7CxwBoCH+hK+VT976j96A0qcNQD2RPM0WNc0rxZ/vZH8nLGsJdTsGzZM4k3Vil+U/KWZ Tgyw== X-Gm-Message-State: AOJu0Yx1bjQHWbXljcAYFNdOQRg0SPZc5ctrSQYFTgFcY7AKT8SKhquO i3XEnUMYzpUpbrT1OgsMzNGO3erWzbpo/hUFcDDj4rj/DdGmwqU07Q9hFDlTQF4= X-Google-Smtp-Source: AGHT+IGMU4s+uOCPDhl40NTfEB3e0mdSCbZNNkV/dvgh4CZ/yqMxBR8UsTSDAgty1rNzcFTiNjDrug== X-Received: by 2002:a05:651c:b08:b0:2d4:37ca:92d1 with SMTP id b8-20020a05651c0b0800b002d437ca92d1mr166462ljr.42.1710973757115; Wed, 20 Mar 2024 15:29:17 -0700 (PDT) Received: from localhost.localdomain (cpc100856-bagu15-2-0-cust368.1-3.cable.virginm.net. [82.25.93.113]) by smtp.gmail.com with ESMTPSA id fm22-20020a05600c0c1600b004147266a37dsm543921wmb.30.2024.03.20.15.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 15:29:16 -0700 (PDT) From: Sharlatan Hellseher Date: Wed, 20 Mar 2024 22:28:17 +0000 Message-ID: <36d73335b3bd72c9c94bff9b29e0a0217c9e2af5.1710967275.git.sharlatanus@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 9ce21b05ba..fee330a1ce 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -1377,6 +1377,78 @@ (define-public python-pytest-dotenv 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")