From patchwork Fri Mar 3 14:52:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gemmaro X-Patchwork-Id: 47574 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 76CD916D34; Fri, 3 Mar 2023 14:56:18 +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=-1.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 8824D16CF7 for ; Fri, 3 Mar 2023 14:56:15 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pY6pK-0002rG-H2; Fri, 03 Mar 2023 09:56:06 -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 1pY6pH-0002pS-8w for guix-patches@gnu.org; Fri, 03 Mar 2023 09:56: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 1pY6pG-0007RR-BF for guix-patches@gnu.org; Fri, 03 Mar 2023 09:56:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pY6pG-0002dU-8c for guix-patches@gnu.org; Fri, 03 Mar 2023 09:56:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60424] [PATCH v3 2/2] gnu: Add online-judge-tools Resent-From: gemmaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Mar 2023 14:56: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.16778553118236 (code B ref 60424); Fri, 03 Mar 2023 14:56:02 +0000 Received: (at 60424) by debbugs.gnu.org; 3 Mar 2023 14:55:11 +0000 Received: from localhost ([127.0.0.1]:60059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY6oQ-00028l-Jz for submit@debbugs.gnu.org; Fri, 03 Mar 2023 09:55:11 -0500 Received: from mail-pj1-f44.google.com ([209.85.216.44]:41940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pY6oN-00027l-9T for 60424@debbugs.gnu.org; Fri, 03 Mar 2023 09:55:09 -0500 Received: by mail-pj1-f44.google.com with SMTP id p3-20020a17090ad30300b0023a1cd5065fso2533693pju.0 for <60424@debbugs.gnu.org>; Fri, 03 Mar 2023 06:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677855301; 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=vOtXCPiqQ3qQ1LDh55ESqCqiD+z+iBz7t5gsFRFvbrQ=; b=luryCVvso5MjEMeqnFOxIR6LNbWalC5Z4llsglQDdoAGJUwJKZdrVzxdo8b1AcgM3X AJZETrqKYeS7/HSEAJdfBdIHKXrsgc6/vc/LwuMpKdO9Ki+i5OX9wjkAYEO9Za2Yc7wz 99UpJHWabbX0AbzsuDNAN5BCN9/JGoASP0X6xKH/UBDIDY9IO2/ykEn4ZAWyH0xXzCOu 0ioH6/Zm3edqQamj/b9pMNwjvy8HKZdGgmbMSuG2kBDCY7xcXm5eSLl8azZUtmyJTEzO P9LH/uVGBFtRTas8y6oYsMeRWPD4ofzfINKaMUDn87cvCJzRFmYeEf/6TLgM2u5fi9gg lXUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855301; 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=vOtXCPiqQ3qQ1LDh55ESqCqiD+z+iBz7t5gsFRFvbrQ=; b=7wM/xeq4bgrKM0VqHsnXHgjh9GCQcGGl4UZsLOY2oOc6cmSBJeLc01Faqmzowgdtc5 zkrtQiDRfVaWRF4CW1Jioqb2WThxXU3NgLdzegssk4q9MTsQiEBDoZUAkVsLmi+j29bv InYVCrmEipBEC5Jx9KgK6vHcWYRn7hHc5DVrYtPCYCQQBGdMOv4nQjhyQ5DUUf3w0ybk 96UQADE6qwgCgBiiqtZtite60tRflnm/NVbA9zUVb+FD7ZFVr31f2muX4sqJf1UFTyNE 7Fc8tHWBIspm5+Dg7w0/vTHwoOPTIayb1QwnbwKnYwYbh69z2rLwPYrph6IHB5D5incj WbmQ== X-Gm-Message-State: AO0yUKW2xt8er6xCgzQEcE+z2Kej9m1b/b+VGtmzFvUm95nb5OS01SQG I6642wdZx/Yp8/SGQnBPUB7S3ic7Hrga0g== X-Google-Smtp-Source: AK7set+4QE9IDc0aYW/eLjsx/5SlWrnD28KaNy+iLsjWUwg9GDdI5KHULLjY9W9pi/hBleFmk0VkNg== X-Received: by 2002:a05:6a20:548a:b0:cb:e735:65a5 with SMTP id i10-20020a056a20548a00b000cbe73565a5mr3093243pzk.40.1677855301559; Fri, 03 Mar 2023 06:55:01 -0800 (PST) Received: from mac.gemmaro.name ([240f:74:d1f0:1:ba1:e787:c9e:b1dc]) by smtp.gmail.com with ESMTPSA id u19-20020a62ed13000000b005b0853a1a3esm1687701pfh.159.2023.03.03.06.55.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:55:01 -0800 (PST) From: gemmaro Date: Fri, 3 Mar 2023 23:52:14 +0900 Message-Id: <79f99966cac125095492fc66484ec9e5f5abefc6.1677854694.git.gemmaro.dev@gmail.com> X-Mailer: git-send-email 2.39.1 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/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 b27fc7f3f7..d440dea756 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2027,7 +2027,8 @@ dist_patch_DATA = \ %D%/packages/patches/xygrib-fix-finding-data.patch \ %D%/packages/patches/yggdrasil-extra-config.patch \ %D%/packages/patches/zig-use-system-paths.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 3b8b785849..151025e548 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -22767,6 +22767,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")