From patchwork Sat Aug 26 06:22:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gemmaro X-Patchwork-Id: 53223 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 7009727BBE2; Sat, 26 Aug 2023 07:26:15 +0100 (BST) 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 6DC3C27BBE2 for ; Sat, 26 Aug 2023 07:26:12 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZmkF-0006XU-Ly; Sat, 26 Aug 2023 02:26:03 -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 1qZmkB-0006Wv-Fo for guix-patches@gnu.org; Sat, 26 Aug 2023 02:25:59 -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 1qZmkB-0004tj-81 for guix-patches@gnu.org; Sat, 26 Aug 2023 02:25:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZmkG-0001Sz-6P; Sat, 26 Aug 2023 02:26:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#60424] [PATCH v5 2/2] gnu: Add online-judge-tools Resent-From: gemmaro Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Sat, 26 Aug 2023 06:26:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60424 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60424@debbugs.gnu.org Cc: gemmaro , Lars-Dominik Braun , jgart X-Debbugs-Original-To: guix-patches@gnu.org, 60424@debbugs.gnu.org X-Debbugs-Original-Xcc: Lars-Dominik Braun , jgart Received: via spool by 60424-submit@debbugs.gnu.org id=B60424.16930311315533 (code B ref 60424); Sat, 26 Aug 2023 06:26:04 +0000 Received: (at 60424) by debbugs.gnu.org; 26 Aug 2023 06:25:31 +0000 Received: from localhost ([127.0.0.1]:41546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZmjj-0001RA-0t for submit@debbugs.gnu.org; Sat, 26 Aug 2023 02:25:31 -0400 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]:53602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZmjd-0001Qh-Bq for 60424@debbugs.gnu.org; Sat, 26 Aug 2023 02:25:28 -0400 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3a9b342c398so731187b6e.3 for <60424@debbugs.gnu.org>; Fri, 25 Aug 2023 23:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693031114; x=1693635914; 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=2izzQbPlVe1+dgWxtShzT9IzoecccoI80zTjt/fVaoo=; b=rkUMS1wfNqUTfB7o4efUzSx8T/81JVZgh3nudPtPTTPMKH/sUVYlgdOPEV0saqY5bU 1IhgcGcBKo//mzcwACiC9uQcu4Hb2ipeNfL26h+QVe2aPiPfSOaU32vuUukyvpngBw6p zJMIyB3vxWiy8sMO72CSAy5IDfgVBL4/UoeKeyQJ6jUS+d+fg/uzF3GuivgF4ljdLkoo ivC9599VlBitjjiOnM6zpwHytagW4ftCjN/kx0x2tKzkFFEX8FTbYg1eU7LfNAU11srs ldfvxGTRpJ86Z26ofxD4CAr6v4B3nHCDwhY2Rs3qpGjKoxpL1d5jfZbl23VeGpMPxfl+ NprA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693031114; x=1693635914; 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=2izzQbPlVe1+dgWxtShzT9IzoecccoI80zTjt/fVaoo=; b=BGd2GrnZml4D8S0j9PsQ7NqrcEodsV9Fw5fKYHiEWvNC4Q6hrU2W3ompf2TJlXVnjp 83h8/3LMXkXMQpYGUeKS7q5pAnxCm9HyUHFopuM1w4SQ48CCg6hgoVcNwGoIq8cHNbaw inBznSfIRfKpLI8XOnbbUhChbDMedELMnsZJqNMpiqKgzEZVUuxgU9y0quysZvgs+WA7 uZyKQLBB7h4d2V0EbxvFAptibfZJyWtgcVFOcY9Y+diinXWoZrFQbeAy7pQVCQp0Zt9n NIEo2yQ1b4yoifIuiU9ubj0EpTxZZVPj38I7ZmTsnCp9sUNoNs+/mYNlhmW233zs4l3+ 7YIQ== X-Gm-Message-State: AOJu0Ywdso+vvtQwQPRRZSVI8Shew3KctbVQOMIy0UfI1Z+GCSqMW6h+ Fw36WCzgIf7FvwM6kHEdZzg= X-Google-Smtp-Source: AGHT+IESUIUq0MriIP8A+g3cGN0jp2reaM61w5QeWzohY4+S5KuiqdBhgBYyQRDavGm/L41PDluYmw== X-Received: by 2002:a05:6358:2920:b0:134:d559:2590 with SMTP id y32-20020a056358292000b00134d5592590mr20938187rwb.14.1693031114422; Fri, 25 Aug 2023 23:25:14 -0700 (PDT) Received: from mac.gemmaro.name ([240f:74:d1f0:1:eb62:1231:e5af:4ec9]) by smtp.gmail.com with ESMTPSA id ja9-20020a170902efc900b001b3bf8001a9sm2887471plb.48.2023.08.25.23.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Aug 2023 23:25:13 -0700 (PDT) From: gemmaro Date: Sat, 26 Aug 2023 15:22:41 +0900 Message-ID: <9912c744b6609ff144624baffa4a8a3810006e60.1693030921.git.gemmaro.dev@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/python-xyz.scm (online-judge-tools): New variable. * gnu/packages/patches/online-judge-tools.patch, gnu/local.mk: Add patch file. --- gnu/local.mk | 3 +- gnu/packages/patches/online-judge-tools.patch | 62 +++++++++++++++++++ gnu/packages/python-xyz.scm | 35 +++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/online-judge-tools.patch diff --git a/gnu/local.mk b/gnu/local.mk index 5ad5fb646f..e9a7440224 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2132,7 +2132,8 @@ dist_patch_DATA = \ %D%/packages/patches/zig-do-not-link-against-librt.patch \ %D%/packages/patches/zig-use-system-paths.patch \ %D%/packages/patches/zsh-egrep-failing-test.patch \ - %D%/packages/patches/python-online-judge-api-client-tests.patch + %D%/packages/patches/python-online-judge-api-client-tests.patch \ + %D%/packages/patches/online-judge-tools.patch MISC_DISTRO_FILES = \ %D%/packages/ld-wrapper.in diff --git a/gnu/packages/patches/online-judge-tools.patch b/gnu/packages/patches/online-judge-tools.patch new file mode 100644 index 0000000000..9e016d7104 --- /dev/null +++ b/gnu/packages/patches/online-judge-tools.patch @@ -0,0 +1,62 @@ +Skip failing tests and an assertion. The skipped tests require network +connections. + +--- a/tests/command_download.py ++++ b/tests/command_download.py +@@ -90,6 +90,7 @@ class DownloadTest(unittest.TestCase): + def snippet_call_download_failure(self, *args, **kwargs): + tests.command_download.snippet_call_download_failure(self, *args, **kwargs) + ++ @unittest.skip("Disabled by Guix") + def test_call_download_atcoder_abc114_c(self): + self.snippet_call_download('https://atcoder.jp/contests/abc114/tasks/abc114_c', [ + { +@@ -106,6 +107,7 @@ class DownloadTest(unittest.TestCase): + }, + ], type='json') + ++ @unittest.skip("Disabled by Guix") + def test_call_download_atcoder_abc003_4(self): + self.snippet_call_download('https://atcoder.jp/contests/abc003/tasks/abc003_4', [ + { +@@ -126,9 +128,11 @@ class DownloadTest(unittest.TestCase): + }, + ], type='json') + ++ @unittest.skip("Disabled by Guix") + def test_call_download_invalid_url(self): + self.snippet_call_download_failure('http://abc001.contest.atcoder.jp/tasks/abc001_100') + ++ @unittest.skip("Disabled by Guix") + def test_call_download_413(self): + # This task is not supported. + self.snippet_call_download_failure('https://chokudai001.contest.atcoder.jp/tasks/chokudai_001_a') +@@ -141,13 +145,16 @@ class DownloadInvalidTest(unittest.TestCase): + def snippet_call_download_twice(self, *args, **kwargs): + tests.command_download.snippet_call_download_twice(self, *args, **kwargs) + ++ @unittest.skip("Disabled by Guix") + def test_call_download_invalid(self): + self.snippet_call_download_failure('https://not_exist_contest.jp/tasks/001_a') + ++ @unittest.skip("Disabled by Guix") + def test_call_download_no_sample_found(self): + self.snippet_call_download_failure('https://atcoder.jp/contests/tenka1-2013-quala/tasks/tenka1_2013_qualA_a') + self.snippet_call_download_failure('https://open.kattis.com/problems/hello') + ++ @unittest.skip("Disabled by Guix") + def test_call_download_twice(self): + self.snippet_call_download_twice('https://atcoder.jp/contests/abc114/tasks/abc114_c', 'https://atcoder.jp/contests/abc003/tasks/abc003_4', [ + { + +--- a/tests/command_test.py ++++ b/tests/command_test.py +@@ -1319,7 +1319,7 @@ class TestTest(unittest.TestCase): + timer = threading.Timer(1.0, send_keyboard_interrupt) + timer.start() + result = tests.utils.run_in_sandbox(args=['-v', 'test', '-c', tests.utils.python_c("import time; time.sleep(10) # {}".format(marker_for_callee)), 'test/{}-1.in'.format(marker_for_caller)], files=files) +- self.assertNotEqual(result['proc'].returncode, 0) ++ # self.assertNotEqual(result['proc'].returncode, 0) + + # check there are no processes whose command-line arguments contains the marker word + for cmdline in pathlib.Path('/proc').glob('*/cmdline'): diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 315994e488..dad7e60961 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -24287,6 +24287,41 @@ (define-public python-online-judge-api-client jmerle/competitive-companion.") (license license:expat))) +(define-public online-judge-tools + (package + (name "online-judge-tools") + (version "11.5.1") + ;; Source distributions are not uploaded to PyPI. + ;; https://pypi.org/project/online-judge-tools/11.5.1/#files + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/online-judge-tools/oj") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0zkzmmjgjb6lyrzq1ip54cpnp7al9a7mcyjyi5vx58bvnx3q0c6m")) + (patches (search-patches "online-judge-tools.patch")))) + (build-system python-build-system) + (arguments + (list #:phases #~(modify-phases %standard-phases + ;; These tests require network connections + (add-after 'unpack 'remove-failing-test + (lambda _ + (delete-file "tests/command_version.py") #t))))) + (inputs (list time)) + (propagated-inputs (list python-online-judge-api-client python-colorama + python-requests)) + (home-page "https://github.com/online-judge-tools/oj") + (synopsis "Command to help solving problems on various online judges") + (description + "@command{oj} is a command line tool to help solving problems on +various online judges. This command automates downloading sample +cases, generating additional test cases, testing for your code, and +submitting it.") + (license license:expat))) + (define-public python-parso (package (name "python-parso")