From patchwork Sat Jan 7 09:33:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gemmaro X-Patchwork-Id: 45901 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 06B4527BBE9; Sat, 7 Jan 2023 09:36:14 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,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 04DB627BBEB for ; Sat, 7 Jan 2023 09:36:12 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pE5cV-0005cT-U7; Sat, 07 Jan 2023 04:36:07 -0500 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 1pE5cR-0005bd-7O for guix-patches@gnu.org; Sat, 07 Jan 2023 04:36:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pE5cQ-0007pQ-VL for guix-patches@gnu.org; Sat, 07 Jan 2023 04:36:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pE5cQ-0001Uf-QX for guix-patches@gnu.org; Sat, 07 Jan 2023 04:36:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60424] [PATCH 2/2] gnu: Add online-judge-tools Resent-From: gemmaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Jan 2023 09:36:02 +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 Received: via spool by 60424-submit@debbugs.gnu.org id=B60424.16730841565714 (code B ref 60424); Sat, 07 Jan 2023 09:36:02 +0000 Received: (at 60424) by debbugs.gnu.org; 7 Jan 2023 09:35:56 +0000 Received: from localhost ([127.0.0.1]:56478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE5cJ-0001U1-ES for submit@debbugs.gnu.org; Sat, 07 Jan 2023 04:35:56 -0500 Received: from mail-pg1-f175.google.com ([209.85.215.175]:46833) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE5aJ-0001QD-Ax for 60424@debbugs.gnu.org; Sat, 07 Jan 2023 04:33:51 -0500 Received: by mail-pg1-f175.google.com with SMTP id d10so2709372pgm.13 for <60424@debbugs.gnu.org>; Sat, 07 Jan 2023 01:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=i0r2Xhjgup871rdoIyEEFdmK9P8xSxhtH7dyK8p3P/k=; b=cF0adBGQmeF/z3J9Q/1rpMbNZyrrDPgQZFQwCkVRnw10dyfiPTB759KyQDMgK+QFWI 1wMyZmQ+61pEBZUwO5BMffMnPOBcv2isRmcjLB8MmrHQ4G1R85Lo88BKRz8aMuXXc+Km pM7JQiBcWBdhzTGhQ7QJT2VglKnIF+4cuAv0Ol/83dq2Za2/ZmuSx/bO2PAMJIEk4ISz 6JrXDCdjq6w4pBGCNMxImu2BSK9xjmzGobVy++Vh2ZTlxTgEZY6w91lHT0Lqnfx+fVOY h02kaA8weiFKtfpNncv+oz6aD0OeBQCKLbI8gh9POIH0dHzCfswCRlPyKGcdH2dXBsar VIVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=i0r2Xhjgup871rdoIyEEFdmK9P8xSxhtH7dyK8p3P/k=; b=ACZENj5Si7CjO0jHSiTbaiN8RFILSfQtJMooFV+wYaofh3ce2kqBN5K3lVoxKDPbYI RJZDFHd+Hmb7Mw1dvE6jci+K7horLOb1wS1uBQbzSPhNtfFsKSzC9/70Lhgc0+gGySip UKdbDtm1WuWNfjT47MzM3ips3XaLhxJ3QWPnAwj5CIZjNN3zv4dlioxUr0TLZT+JT2Xh AQ6afDYGHgN/v4diManypeK7bu4Y0t72KHqhTjLMh5IyjRlHBAMek0gleTlvNO3kvSul qhzF5NiLT/9Y/VRlHGQEW03h/Hy52Rs0qSXMo2w6vv5CQzVFV6sCA83oh9S2Q3KSJK2m Qp7w== X-Gm-Message-State: AFqh2krDjxbSf1so8jnMW9RBHiQ79m40DNSwkg+YABIPAUf3dq6qrsbb fjOQXoTgLAb6lJgBZrnw9mg+KxpeJyMMnQ== X-Google-Smtp-Source: AMrXdXssLw9XkLCoW8z6cggUreJ8LzwiTgx0tm/Rx1jV/uXXsj68nmkPId5aMd0X0H8vFJ9LF+v0nw== X-Received: by 2002:a05:6a00:80e:b0:581:f9d3:c9fc with SMTP id m14-20020a056a00080e00b00581f9d3c9fcmr37383369pfk.19.1673084025719; Sat, 07 Jan 2023 01:33:45 -0800 (PST) Received: from mac.gemmaro.name ([240f:74:d1f0:1:ba1:e787:c9e:b1dc]) by smtp.gmail.com with ESMTPSA id 63-20020a621942000000b0056d98e359a5sm2412454pfz.165.2023.01.07.01.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 01:33:45 -0800 (PST) From: gemmaro Date: Sat, 7 Jan 2023 18:33:10 +0900 Message-Id: <33d8f859b0038a570951442621fe816242dc8f73.1673081398.git.gemmaro.dev@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 07 Jan 2023 04:35:52 -0500 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 | 62 +++++++++++++++++++ gnu/packages/python-xyz.scm | 35 +++++++++++ 2 files changed, 97 insertions(+) create mode 100644 gnu/packages/patches/online-judge-tools.patch 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 831a14f3e9..c24afbfd32 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -22749,6 +22749,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 + `(#: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")