From patchwork Thu Jul 18 11:00:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 66316 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 D4C6A27BBE9; Thu, 18 Jul 2024 12:03:17 +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 2423C27BBEA for ; Thu, 18 Jul 2024 12:03:16 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sUOui-0003mx-C3; Thu, 18 Jul 2024 07:03:08 -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 1sUOuY-0003WH-Vt for guix-patches@gnu.org; Thu, 18 Jul 2024 07:02: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 1sUOuY-0005rw-No for guix-patches@gnu.org; Thu, 18 Jul 2024 07:02:58 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sUOuc-0004Ay-7J for guix-patches@gnu.org; Thu, 18 Jul 2024 07:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71697] [PATCH v4 1/2] scripts: lint: Add 'dry-run' option. Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 18 Jul 2024 11:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71697 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: Josselin Poiret , Maxim Cournoyer , Mathieu Othacehe , Tobias Geerinckx-Rice , Florian Pelz , 71697@debbugs.gnu.org, Christopher Baines , Matthew Trzcinski Received: via spool by 71697-submit@debbugs.gnu.org id=B71697.172130052915991 (code B ref 71697); Thu, 18 Jul 2024 11:03:02 +0000 Received: (at 71697) by debbugs.gnu.org; 18 Jul 2024 11:02:09 +0000 Received: from localhost ([127.0.0.1]:37060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sUOtk-00049r-TV for submit@debbugs.gnu.org; Thu, 18 Jul 2024 07:02:09 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:41930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sUOti-00049I-Q8 for 71697@debbugs.gnu.org; Thu, 18 Jul 2024 07:02:07 -0400 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-426744ca29bso219115e9.3 for <71697@debbugs.gnu.org>; Thu, 18 Jul 2024 04:02:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721300457; x=1721905257; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xdpc0sdonv3HwTLhOi/AsdtXS/5uy/UQ9ViCFeEQXCw=; b=flXSQMIfWRvs2I1+znqk6Z7+X0T7iBpEYSMTHEKDojn/TGXrdVFbHywi/54fIJJTkp cPl1pyCgP3F6SJ4ppRXIH5wLgs4ahAkWMv0gG9XNHjHYELPSqBpOcdYWnfnFZcqWJRb3 2Xahp8Yk8b3G3wS87hP/duhFdLJtTqHSfUgyM5t8ZWaBdxmvmFqUCtfvzSPgxDtawQLK olEikVf1xCRlmvu9aw7SBDNXBQiXqQOg3bYRnU+pTXeQ5nay0SW76MX6Q6JSs7MCcf5i 7dQYGf5bku5+l2HjLdE7EzyKe8igRulDbDEs9jkagUgnmB61+YwzNTZPDJozPNY/Ymeu X8nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721300457; x=1721905257; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xdpc0sdonv3HwTLhOi/AsdtXS/5uy/UQ9ViCFeEQXCw=; b=UGjqxq7pi9a/EEuztEQ1mwuCZPPeeFy4ooU96OJ0ZUsEHx9B03uyFwj6OHB4dlndV+ +Rg5yKG/YoyQ/tnZZ8PBXBF4IdoZdYbCeCGSXTnMaVMQWXwBr/80dalpZWdsWfE4F9BP Ah3PBl+rbIBO5CXaNv9SCqkRxs72iPIhiJEJqHmDTgCkj/mULCmaxS2PMLyMOtwg3Km6 m2iK2n7MVY4Q9y9Syq4Y83EsyfuGJSjFdKpVpKiieBjKNrl5yBi1K6tYNQ793yUfWzgz zVAREdbxdbvAIuWUKTxIa+PUPb9Fb8OFgu8B4TCZ3okrKKrfqeglCVNPj92VfO3SB2Rg 1ACg== X-Forwarded-Encrypted: i=1; AJvYcCXpzDkkKtJ2RkGL+HO+ADtI9IC2C9tkEPZO3p+HKHU2pJd6qPS00OU4D2xkJ+8IvxvUdA94ZFGaMGjfkHoSSawPDQHlsMU= X-Gm-Message-State: AOJu0Yzxa05UEcoktIjj3KN5dVmZHZdwtTy6Wxrm2PznveafSGzxXkKV NQernDdtGSKGvOBiWXNm7siWEJVBLKhIWN7/LciI9wBbcHI5HYvX X-Google-Smtp-Source: AGHT+IFx9GaJ0kTEgFn1yNPc7gHnH1VHlz4e7ES9ifIlCBNjJx/dgk8XOk8DmMNlBCSteKyPXuHyfA== X-Received: by 2002:a05:600c:4743:b0:427:9f6f:4914 with SMTP id 5b1f17b1804b1-427d2aac236mr2439845e9.6.1721300457023; Thu, 18 Jul 2024 04:00:57 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:9178:6406:86a:4268]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427d2a3c0fasm8507025e9.7.2024.07.18.04.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 04:00:56 -0700 (PDT) From: Simon Tournier In-Reply-To: <87zfqfvyz9.fsf@gnu.org> References: <8cb162bcde91d3b39453de576caadb9a6f8f8733.1718990517.git.zimon.toutoune@gmail.com> <9971c126670cd0f49a647d538aaf206d5b963322.1720804839.git.zimon.toutoune@gmail.com> <87zfqfvyz9.fsf@gnu.org> Date: Thu, 18 Jul 2024 13:00:46 +0200 Message-ID: <87a5ifklr5.fsf@gmail.com> 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 Hi, On Thu, 18 Jul 2024 at 11:19, Ludovic Courtès wrote: > That said, I find ‘--dry-run’ > in this case not so useful because it would just print the same thing on > and on for each and every package. No, it’s different; or can be. For instance, ’archival’ is listed for one but not for the other. --8<---------------cut here---------------start------------->8--- $ git diff $ ./pre-inst-env guix lint hello python-scikit-learn --dry-run hello@2.12.1 checked by archival compiler-for-target cve derivation description formatting github-url gnu-description haskell-stackage home-page input-labels inputs-should-be-native inputs-should-not-be-input license mirror-url name optional-tests patch-file-names patch-headers profile-collisions refresh source source-file-name source-unstable-tarball synopsis tests-true wrapper-inputs. python-scikit-learn@1.4.2 checked by compiler-for-target cve derivation description formatting github-url gnu-description haskell-stackage home-page input-labels inputs-should-be-native inputs-should-not-be-input license mirror-url optional-tests patch-file-names patch-headers profile-collisions refresh source source-file-name source-unstable-tarball tests-true wrapper-inputs. --8<---------------cut here---------------end--------------->8--- Well, the aim is to know which checker applies to which package just before they are indeed applied. Initially, I thought something like: --8<---------------cut here---------------start------------->8--- modified guix/scripts/lint.scm @@ -223,6 +223,11 @@ (define-command (guix-lint . args) (when (assoc-ref opts 'list?) (list-checkers-and-exit checkers)) + (when (assoc-ref opts 'dry-run?) + (if (null? args) + (show-checkers-and-exit) + (show-packages-checkers-and-exit args checkers))) + (with-error-handling (let ((any-lint-checker-requires-store? (any lint-checker-requires-store? checkers))) --8<---------------cut here---------------end--------------->8--- where ’show-checkers-and-exit’ takes into account only option ’-c’ or option ’-x’, displaying something as: “The following checkers would run for all packages:” and the list of checkers. And ’show-packages-checkers-and-exit’ would display: --8<---------------cut here---------------start------------->8--- The following checkers would run for packages: <"short“ "list of package@X.Y> + list of all common checkers The following checkers would be excluded for packages: <"short“ "list of package@X.Y> + list of excluded checkers --8<---------------cut here---------------end--------------->8--- But then I concluded that would not be a true dry-run. ;-) For the comments, thanks! That’s better. Cheers, simon diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 3680cab044..5a22f7a865 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1775,6 +1775,7 @@ (define-public python-scikit-learn python-pytest-xdist)) (propagated-inputs (list python-numpy python-threadpoolctl python-scipy python-joblib)) + (properties '((lint-excluded-checkers . (archival name synopsis)))) (home-page "https://scikit-learn.org/") (synopsis "Machine Learning in Python") (description