From patchwork Wed May 3 04:39:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gemmaro X-Patchwork-Id: 49762 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 6CEEB27BBE9; Wed, 3 May 2023 05:43:33 +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=-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 E694D27BBE2 for ; Wed, 3 May 2023 05:43:30 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu4KX-0000Lq-7f; Wed, 03 May 2023 00:43:05 -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 1pu4KV-0000L2-Dn for guix-patches@gnu.org; Wed, 03 May 2023 00:43:03 -0400 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 1pu4KU-0002XF-Sp for guix-patches@gnu.org; Wed, 03 May 2023 00:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pu4KU-00023n-JJ; Wed, 03 May 2023 00:43:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#60424] [PATCH v4 2/2] gnu: Add online-judge-tools Resent-From: gemmaro Original-Sender: "Debbugs-submit" Resent-CC: dev@jpoiret.xyz, guix-patches@gnu.org Resent-Date: Wed, 03 May 2023 04:43: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 , dev@jpoiret.xyz X-Debbugs-Original-Xcc: dev@jpoiret.xyz Received: via spool by 60424-submit@debbugs.gnu.org id=B60424.16830889357857 (code B ref 60424); Wed, 03 May 2023 04:43:02 +0000 Received: (at 60424) by debbugs.gnu.org; 3 May 2023 04:42:15 +0000 Received: from localhost ([127.0.0.1]:45420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pu4Ji-00022e-HZ for submit@debbugs.gnu.org; Wed, 03 May 2023 00:42:15 -0400 Received: from mail-pl1-f179.google.com ([209.85.214.179]:55484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pu4Jg-00022T-5Z for 60424@debbugs.gnu.org; Wed, 03 May 2023 00:42:12 -0400 Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1aaf2ede38fso32797105ad.2 for <60424@debbugs.gnu.org>; Tue, 02 May 2023 21:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683088926; x=1685680926; 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=hBydoiwy/qN5TPuDcYZPEwXWhJczZhhGF+uYrCRD6G0=; b=MCdJX/0dJkA37bZrMIMjwZ/OUiubh4xHFZFP0zxSow0X8k0H6uteLFJq3705bTIpUC 4SIyjDH9itB/3MGpOGfj6LmS7UmsemkqoDSZnaGBfhVNcbqAUXuVqpgzUfIZSyXguasB sfs0UGReuUYR1kGQ8rB3ip0KjtnIg0CX+F4MKHbj/66pgT+17ZhcqQog84iCvDb+l4d9 F39bLvbQxeLQmIVfL8KJ7q6FNc1N9mMXouLZF1M+0HXZs9FWg5iW9qG296iUKpjhXVpd SLZtZTetAqLW0MERmPvaF7Ct1EvnKElUpT1L3atx3OVN4ViU7E27jdC+RnIP/ZuUnN+R t7BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683088926; x=1685680926; 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=hBydoiwy/qN5TPuDcYZPEwXWhJczZhhGF+uYrCRD6G0=; b=dTUOis/31fbDefVamcWgMk2fm42bnWim6w3vnjsqsa1LECR+b+qZdV9SGwEh5GmEoh joenIV1VainDwuemYaiaZ8kvj8ZoK136GKYjtpAn8xCVYW6TqAH0dTu0r2U4QmcFkrSu vElSEbdwfnGWJD6TWM2HvPMSzu1CGLj1IymwhzB2xLif4CEVLd2xkPLgH0ad7sxaas4l BM9vIrc91ReiAI339NiisYyN5FLJbdIB5eLaMNXhh7sa55weIGY0qiIa63xFnio1giTU Ar6qSK3oQTTk+z4Fdvjj7SZeJhUpmSs1znpQXtE6uuzTHF7VZPKKuGBCPFv0bTBIgBp9 tyyw== X-Gm-Message-State: AC+VfDxYNzIma7tXyC9sUZwY8lwRAHlS4XcXXE8EPFEPgR0e8Woq96HD aAR+s9/2B7ccfg3JN/KQjc54/PSYh/24ew== X-Google-Smtp-Source: ACHHUZ5QQI2R00eBtXC2Ojcv1imyRfkj3nFK1RTULscGFFPw3iWTmoNF6QCI0IFTeLSbidQjb+w3bw== X-Received: by 2002:a17:902:ec90:b0:1a9:4fa1:2747 with SMTP id x16-20020a170902ec9000b001a94fa12747mr1072825plg.47.1683088926465; Tue, 02 May 2023 21:42:06 -0700 (PDT) Received: from mac.gemmaro.name ([240f:74:d1f0:1:ba1:e787:c9e:b1dc]) by smtp.gmail.com with ESMTPSA id jd18-20020a170903261200b001a1d4a985eesm5383733plb.228.2023.05.02.21.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 21:42:06 -0700 (PDT) From: gemmaro Date: Wed, 3 May 2023 13:39:54 +0900 Message-Id: X-Mailer: git-send-email 2.39.2 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 0c2b198b6a5..24efd2ab161 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2074,7 +2074,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 00000000000..9e016d7104e --- /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 c54c4269d85..d3dcab2f146 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -22999,6 +22999,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")