From unknown Fri Aug 15 22:18:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#65545] [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:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65545 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65545@debbugs.gnu.org, 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 submit@debbugs.gnu.org id=B.16930311435573 (code B ref -1); Sat, 26 Aug 2023 06:26:03 +0000 Received: (at submit) by debbugs.gnu.org; 26 Aug 2023 06:25:43 +0000 Received: from localhost ([127.0.0.1]:41552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZmju-0001Rp-Of for submit@debbugs.gnu.org; Sat, 26 Aug 2023 02:25:43 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZmjs-0001RI-0H for submit@debbugs.gnu.org; Sat, 26 Aug 2023 02:25:41 -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 1qZmjX-0006PU-Bj for guix-patches@gnu.org; Sat, 26 Aug 2023 02:25:21 -0400 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZmjU-0004h8-JT for guix-patches@gnu.org; Sat, 26 Aug 2023 02:25:19 -0400 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-573449a364fso711664eaf.1 for ; Fri, 25 Aug 2023 23:25:16 -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=cjngxV17BP+8jZauLwxdAjXt4MMYtXrmyKbBup2F7qRdJyqOzWfSUIas67Bu4ZBm5Z fxsEUXGBc1zuOaG/qjlZFBz4wCF5P9ic5W5oa9DcN0p5yKb+NSEnmGbxNYlep3ftNFP0 utjoMfQCIE/yQ0y4VFCccPLoDF78sz4AX9iAwxtGZPomOutiHz3d6ia+JLWsR5hL2NlR iO8esGkXUGy9qe0vClIG2KqzUkbP4VgMgzKtLh+9ilGd8NCbqI0WcqtznIq97bv2qNc/ GMZZMpwG9CC55Ew5lCRlPnNq1uLojYv/ibYNvs2f3Z2EguJVYBkQPtfpAazoRzNczVx1 mNxQ== X-Gm-Message-State: AOJu0YxdLlEsCdmWJP+TJW8/e9pMwz+piJdC2L5Ho+nkxRAQUmDTB5tB Tle7CxTktleajb6wc5nej0oStCOIF+aWzA== 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 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::c2e; envelope-from=gemmaro.dev@gmail.com; helo=mail-oo1-xc2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * 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") -- 2.41.0 From unknown Fri Aug 15 22:18:05 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: gemmaro Subject: bug#65545: closed (Re: [bug#65545] [PATCH v5 2/2] gnu: Add online-judge-tools) Message-ID: References: <87il6oxs8p.fsf@cbaines.net> <9912c744b6609ff144624baffa4a8a3810006e60.1693030921.git.gemmaro.dev@gmail.com> X-Gnu-PR-Message: they-closed 65545 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 65545@debbugs.gnu.org Date: Mon, 30 Oct 2023 11:32:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1698665522-27455-1" This is a multi-part message in MIME format... ------------=_1698665522-27455-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #65545: [PATCH v5 2/2] gnu: Add online-judge-tools which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 65545@debbugs.gnu.org. --=20 65545: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D65545 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1698665522-27455-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 65545-done) by debbugs.gnu.org; 30 Oct 2023 11:31:08 +0000 Received: from localhost ([127.0.0.1]:44368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxQU6-00075h-TH for submit@debbugs.gnu.org; Mon, 30 Oct 2023 07:31:07 -0400 Received: from mira.cbaines.net ([212.71.252.8]:42986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxQTq-0006Zo-O7 for 65545-done@debbugs.gnu.org; Mon, 30 Oct 2023 07:31:05 -0400 Received: from localhost (pd95b13b0.dip0.t-ipconnect.de [217.91.19.176]) by mira.cbaines.net (Postfix) with ESMTPSA id 047D627BBE2; Mon, 30 Oct 2023 11:30:16 +0000 (GMT) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id ea996010; Mon, 30 Oct 2023 11:30:15 +0000 (UTC) References: <9912c744b6609ff144624baffa4a8a3810006e60.1693030921.git.gemmaro.dev@gmail.com> User-agent: mu4e 1.10.5; emacs 28.2 From: Christopher Baines To: gemmaro Subject: Re: [bug#65545] [PATCH v5 2/2] gnu: Add online-judge-tools Date: Mon, 30 Oct 2023 11:28:59 +0000 In-reply-to: <9912c744b6609ff144624baffa4a8a3810006e60.1693030921.git.gemmaro.dev@gmail.com> Message-ID: <87il6oxs8p.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65545-done Cc: 65545-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain gemmaro writes: > * 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 Hey, I'm not a big fan of the "big patch to disable tests" approach here, but it works, so I've gone ahead and pushed these two patches to master as 789ef6837f9794c02bc53a854aacfdf04d3384cf. It would be good to see if the patches could be removed in the future though. Thanks, Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmU/k8ZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xd4Og//ddWxiOSuKhnOSMzqE1xjtGd6ve1zD6zv 4Xm7Lxk6odT5Zq6FDVh+UdeUP7kAyxdLZZevGccZaB1LAodyU1nmOC+OANKwCfY3 ODvFe3oVOOkqjgb/HZ/XXKOHWoePf+Qplwmf3URe2Ls1/Mab3WvRsMlMk0/ky5es nbndCvJ0K86yn6+LTh4yKrifeM7X4b7BFt3bA0WvE5mdDp3pBNF5zl1TgWJEwbNk 2PBsklS4fc1z1660qGvMjGme6m2IHrEWSLRuw79WK8q6a1eYcoY5iTFLg4l/yH5T EGS0yRqopnDbCMq5xC907l+0swTfwUq4Ut+BXaRIjmwh0cWSDJXaxuQVj+Xy2Ch0 KVqvQ7y89b8KimIxe9oyUWnc1UcP6peYniaxKv0geP82Xpji6VL5kD7c06tIEmgq FMKO+CEOM2JIIXcwKoi+1+SdAZEIKgKxzqou9LBSqa4wAltMr+WlzXb/C4aaVMuh Xe/izzEpdr/iB1y6RCHuL5cD/jWh5HJ6XCZcJ4mag+imrArV3MpS5avE+FDht0x2 Xp0xQWlJaju1rFQN9wIqvdtZxwnywyM0mvEzMK3YcWx7PQmR/nbHDwBYVscSDEU1 g0c6JKQ7QDlcFG+LLXgDuMopYdCR7w9RNepckT2H5m0rfUgWsM+aNpAH00BI+lgc sQTY9W4uu7c= =aLr3 -----END PGP SIGNATURE----- --=-=-=-- ------------=_1698665522-27455-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Aug 2023 06:25:43 +0000 Received: from localhost ([127.0.0.1]:41552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZmju-0001Rp-Of for submit@debbugs.gnu.org; Sat, 26 Aug 2023 02:25:43 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZmjs-0001RI-0H for submit@debbugs.gnu.org; Sat, 26 Aug 2023 02:25:41 -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 1qZmjX-0006PU-Bj for guix-patches@gnu.org; Sat, 26 Aug 2023 02:25:21 -0400 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZmjU-0004h8-JT for guix-patches@gnu.org; Sat, 26 Aug 2023 02:25:19 -0400 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-573449a364fso711664eaf.1 for ; Fri, 25 Aug 2023 23:25:16 -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=cjngxV17BP+8jZauLwxdAjXt4MMYtXrmyKbBup2F7qRdJyqOzWfSUIas67Bu4ZBm5Z fxsEUXGBc1zuOaG/qjlZFBz4wCF5P9ic5W5oa9DcN0p5yKb+NSEnmGbxNYlep3ftNFP0 utjoMfQCIE/yQ0y4VFCccPLoDF78sz4AX9iAwxtGZPomOutiHz3d6ia+JLWsR5hL2NlR iO8esGkXUGy9qe0vClIG2KqzUkbP4VgMgzKtLh+9ilGd8NCbqI0WcqtznIq97bv2qNc/ GMZZMpwG9CC55Ew5lCRlPnNq1uLojYv/ibYNvs2f3Z2EguJVYBkQPtfpAazoRzNczVx1 mNxQ== X-Gm-Message-State: AOJu0YxdLlEsCdmWJP+TJW8/e9pMwz+piJdC2L5Ho+nkxRAQUmDTB5tB Tle7CxTktleajb6wc5nej0oStCOIF+aWzA== 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 To: guix-patches@gnu.org, 60424@debbugs.gnu.org Subject: [PATCH v5 2/2] gnu: Add online-judge-tools 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-Debbugs-Cc: Lars-Dominik Braun , jgart Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::c2e; envelope-from=gemmaro.dev@gmail.com; helo=mail-oo1-xc2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: gemmaro X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * 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") -- 2.41.0 ------------=_1698665522-27455-1--