From unknown Thu Aug 21 12:11:39 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#51493 <51493@debbugs.gnu.org> To: bug#51493 <51493@debbugs.gnu.org> Subject: Status: [PATCH 0/5] Improvements to the pypi, cran, and "print" importers Reply-To: bug#51493 <51493@debbugs.gnu.org> Date: Thu, 21 Aug 2025 19:11:39 +0000 retitle 51493 [PATCH 0/5] Improvements to the pypi, cran, and "print" impor= ters reassign 51493 guix-patches submitter 51493 Ludovic Court=C3=A8s severity 51493 normal tag 51493 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 17:30:02 2021 Received: (at submit) by debbugs.gnu.org; 29 Oct 2021 21:30:02 +0000 Received: from localhost ([127.0.0.1]:56121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZRq-000617-1n for submit@debbugs.gnu.org; Fri, 29 Oct 2021 17:30:02 -0400 Received: from lists.gnu.org ([209.51.188.17]:51950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZRo-00060Y-7f for submit@debbugs.gnu.org; Fri, 29 Oct 2021 17:30:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZRn-000823-Vd for guix-patches@gnu.org; Fri, 29 Oct 2021 17:30:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZRn-00080F-8K; Fri, 29 Oct 2021 17:29:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=CVFiMYlhBWcQELWdBUEgnpyg5RrNdIqIexdFErioOuM=; b=q/Wjh8VOl2cNFC k+KAdnl2kau3KHcOmlyQwdNQuu8f+dU3LhRSfQtX23nkg+Oj/ClMsdmGoF6zdwgrUwMRfghh4KxMf OlUctpUCyhUN9vS+WsMcopYDShlK2+gtUceELyMQxV8mLQ3np6F5xLyEQhC77Fx4fYBhML80hUMSk h1LxJkboIgQ0THyScYhXIgaPWkBapzDpeRPWd0u1JGSoazEpgirTwBzIQui9/EMtFubyozilE8NY8 34nBuaKZ68m9QGRaD170WuBIqAZiLbRvxurTCdpAK3dUJ+hXylB9+sTimpjaRgsKMLr2CpFbfiods jBzaLSO/Z6OcI4T/i4ig==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55460 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgZRm-0001XP-PY; Fri, 29 Oct 2021 17:29:59 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 0/5] Improvements to the pypi, cran, and "print" importers Date: Fri, 29 Oct 2021 23:29:48 +0200 Message-Id: <20211029212948.30148-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -3.3 (---) Hi! These changes were prompted by the need to be able to import specific versions of packages so I could estimate importer/repository accuracy: https://lists.gnu.org/archive/html/guix-devel/2021-10/msg00258.html Feedback welcome! Ludo’. Ludovic Courtès (5): import: pypi: Allow imports of a specific version. import: cran: Allow imports of a specific version. import: print: Properly render packages with origins as inputs. import: print: Correctly handle URI lists. import: print: Handle patches that are origins. doc/guix.texi | 16 ++++++- guix/import/cran.scm | 89 +++++++++++++++++++++++------------- guix/import/print.scm | 36 ++++++++++++--- guix/import/pypi.scm | 47 ++++++++++--------- guix/scripts/import/cran.scm | 35 +++++++------- guix/scripts/import/pypi.scm | 32 +++++++------ tests/print.scm | 61 ++++++++++++++++++++++++ tests/pypi.scm | 12 +++-- 8 files changed, 232 insertions(+), 96 deletions(-) base-commit: 7dbd5339d7e9c572afa0aa051dd304abe702cb7d -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 17:35:56 2021 Received: (at 51493) by debbugs.gnu.org; 29 Oct 2021 21:35:56 +0000 Received: from localhost ([127.0.0.1]:56145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZXX-0006DT-Mk for submit@debbugs.gnu.org; Fri, 29 Oct 2021 17:35:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZXV-0006Cw-Nv for 51493@debbugs.gnu.org; Fri, 29 Oct 2021 17:35:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58438) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZXQ-0002LI-Fg; Fri, 29 Oct 2021 17:35:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=g5oP/WKVa2AYyiThuh/XN36U+/IDk/o2TGL0xURENy8=; b=q9mezrU1jXUmdJUYQmLK vV/etAv//+u1uly1YsvGh23Fhte5LOjRhXN4I/6fUeHkp0lHo91NCHmiLytfC4hUfY/yY8N12tKQ+ glKTJ8dUNlLKvdSTLnVR/RoMdIfQnJRkq1w9xfYsp94tPg11jvksnX7cq+JRdJuXC9ERhoeypxbrA tucwznZXdU37qCx/2QEXO2aNrKT04r1xrHq9A9zVjkZxAi96qdup2iPRhcIBInoXjLnLRrL6GLXSL PAroEqwbelHqcFwqgT33kfslvAi3ZtJa6QYZtsXzr9pTXlKNdj2JWk5cCO8qZ1V8tpIFo/pYb6Tn3 2OuwfVL6FWldjA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55462 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgZXQ-0002gP-2O; Fri, 29 Oct 2021 17:35:48 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51493@debbugs.gnu.org Subject: [PATCH 2/5] import: cran: Allow imports of a specific version. Date: Fri, 29 Oct 2021 23:35:36 +0200 Message-Id: <20211029213539.30291-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211029213539.30291-1-ludo@gnu.org> References: <20211029213539.30291-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51493 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -3.3 (---) * guix/import/cran.scm (download): Handle the case where URL is a list. (fetch-description-from-tarball): New procedure. (fetch-description): Add #:version parameter. Honor it when REPOSITORY is 'cran. Use 'fetch-description-from-tarball' when REPOSITORY is 'bioconductor. (description->package): SOURCE-URL may now be a list. (cran->guix-package): Pass VERSION to 'fetch-description'. (cran-recursive-import): Add #:version parameter. * guix/scripts/import/cran.scm (guix-import-cran): Expect a spec rather than a mere package name. * doc/guix.texi (Invoking guix import): Document it. --- doc/guix.texi | 6 +++ guix/import/cran.scm | 89 +++++++++++++++++++++++------------- guix/scripts/import/cran.scm | 35 +++++++------- 3 files changed, 83 insertions(+), 47 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index b742a4808a..7645f6f01a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11833,6 +11833,12 @@ The command command below imports metadata for the Cairo R package: guix import cran Cairo @end example +You can also ask for a specific version: + +@example +guix import cran rasterVis@@0.50.3 +@end example + When @option{--recursive} is added, the importer will traverse the dependency graph of the given upstream package recursively and generate package expressions for all those packages that are not yet in Guix. diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 5f5f73cbf4..22fae5d7cb 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -229,26 +229,61 @@ (define download (let ((store-directory (add-to-store store (basename url) #t "sha256" dir))) (values store-directory changeset))))))) - (else (download-to-store store url))))))) + (else + (match url + ((? string?) + (download-to-store store url)) + ((urls ...) + ;; Try all the URLs. A use case where this is useful is when one + ;; of the URLs is the /Archive CRAN URL. + (any (cut download-to-store store <>) urls))))))))) -(define (fetch-description repository name) +(define (fetch-description-from-tarball url) + "Fetch the tarball at URL, extra its 'DESCRIPTION' file, parse it, and +return the resulting alist." + (match (download url) + (#f #f) + (tarball + (call-with-temporary-directory + (lambda (dir) + (parameterize ((current-error-port (%make-void-port "rw+")) + (current-output-port (%make-void-port "rw+"))) + (and (zero? (system* "tar" "--wildcards" "-x" + "--strip-components=1" + "-C" dir + "-f" tarball "*/DESCRIPTION")) + (description->alist + (call-with-input-file (string-append dir "/DESCRIPTION") + read-string))))))))) + +(define* (fetch-description repository name #:optional version) "Return an alist of the contents of the DESCRIPTION file for the R package -NAME in the given REPOSITORY, or #f in case of failure. NAME is +NAME at VERSION in the given REPOSITORY, or #f in case of failure. NAME is case-sensitive." (case repository ((cran) - (let ((url (string-append %cran-url name "/DESCRIPTION"))) - (guard (c ((http-get-error? c) - (warning (G_ "failed to retrieve package information \ + (guard (c ((http-get-error? c) + (warning (G_ "failed to retrieve package information \ from ~a: ~a (~a)~%") - (uri->string (http-get-error-uri c)) - (http-get-error-code c) - (http-get-error-reason c)) - #f)) - (let* ((port (http-fetch url)) - (result (description->alist (read-string port)))) - (close-port port) - result)))) + (uri->string (http-get-error-uri c)) + (http-get-error-code c) + (http-get-error-reason c)) + #f)) + ;; When VERSION is true, we have to download the tarball to get at its + ;; 'DESCRIPTION' file; only the latest one is directly accessible over + ;; HTTP. + (if version + (let ((urls (list (string-append "mirror://cran/src/contrib/" + name "_" version ".tar.gz") + (string-append "mirror://cran/src/contrib/Archive/" + name "/" + name "_" version ".tar.gz")))) + (fetch-description-from-tarball urls)) + (let* ((url (string-append %cran-url name "/DESCRIPTION")) + (port (http-fetch url)) + (result (description->alist (read-string port)))) + (close-port port) + result)))) ((bioconductor) ;; Currently, the bioconductor project does not offer a way to access a ;; package's DESCRIPTION file over HTTP, so we determine the version, @@ -257,22 +292,13 @@ (define (fetch-description repository name) (and (latest-bioconductor-package-version name) #t) (and (latest-bioconductor-package-version name 'annotation) 'annotation) (and (latest-bioconductor-package-version name 'experiment) 'experiment))) + ;; TODO: Honor VERSION. (version (latest-bioconductor-package-version name type)) (url (car (bioconductor-uri name version type))) - (tarball (download url))) - (call-with-temporary-directory - (lambda (dir) - (parameterize ((current-error-port (%make-void-port "rw+")) - (current-output-port (%make-void-port "rw+"))) - (and (zero? (system* "tar" "--wildcards" "-x" - "--strip-components=1" - "-C" dir - "-f" tarball "*/DESCRIPTION")) - (and=> (description->alist (with-input-from-file - (string-append dir "/DESCRIPTION") read-string)) - (lambda (meta) - (if (boolean? type) meta - (cons `(bioconductor-type . ,type) meta)))))))))) + (meta (fetch-description-from-tarball url))) + (if (boolean? type) + meta + (cons `(bioconductor-type . ,type) meta)))) ((git) (and (string-prefix? "http" name) ;; Download the git repository at "NAME" @@ -485,7 +511,7 @@ (define (description->package repository meta) ((bioconductor) (list (assoc-ref meta 'bioconductor-type))) (else '()))) - ((url rest ...) url) + ((urls ...) urls) ((? string? url) url) (_ #f))))) (git? (assoc-ref meta 'git)) @@ -592,7 +618,7 @@ (define cran->guix-package (lambda* (package-name #:key (repo 'cran) version) "Fetch the metadata for PACKAGE-NAME from REPO and return the `package' s-expression corresponding to that package, or #f on failure." - (let ((description (fetch-description repo package-name))) + (let ((description (fetch-description repo package-name version))) (if description (description->package repo description) (case repo @@ -610,8 +636,9 @@ (define cran->guix-package (&message (message "couldn't find meta-data for R package"))))))))))) -(define* (cran-recursive-import package-name #:key (repo 'cran)) +(define* (cran-recursive-import package-name #:key (repo 'cran) version) (recursive-import package-name + #:version version #:repo repo #:repo->guix-package cran->guix-package #:guix-name cran-guix-name)) diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm index 3e4b038cc4..2934d4300a 100644 --- a/guix/scripts/import/cran.scm +++ b/guix/scripts/import/cran.scm @@ -27,8 +27,8 @@ (define-module (guix scripts import cran) #:use-module (guix import utils) #:use-module (guix scripts import) #:use-module (srfi srfi-1) - #:use-module (srfi srfi-11) #:use-module (srfi srfi-37) + #:use-module (srfi srfi-71) #:use-module (ice-9 match) #:use-module (ice-9 format) #:export (guix-import-cran)) @@ -98,21 +98,24 @@ (define (parse-options) (reverse opts)))) (parameterize ((%input-style (assoc-ref opts 'style))) (match args - ((package-name) - (if (assoc-ref opts 'recursive) - ;; Recursive import - (with-error-handling - (map package->definition - (filter identity - (cran-recursive-import package-name - #:repo (or (assoc-ref opts 'repo) 'cran))))) - ;; Single import - (let ((sexp (cran->guix-package package-name - #:repo (or (assoc-ref opts 'repo) 'cran)))) - (unless sexp - (leave (G_ "failed to download description for package '~a'~%") - package-name)) - sexp))) + ((spec) + (let ((name version (package-name->name+version spec))) + (if (assoc-ref opts 'recursive) + ;; Recursive import + (with-error-handling + (map package->definition + (filter identity + (cran-recursive-import name + #:version version + #:repo (or (assoc-ref opts 'repo) 'cran))))) + ;; Single import + (let ((sexp (cran->guix-package name + #:version version + #:repo (or (assoc-ref opts 'repo) 'cran)))) + (unless sexp + (leave (G_ "failed to download description for package '~a'~%") + name)) + sexp)))) (() (leave (G_ "too few arguments~%"))) ((many ...) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 17:35:56 2021 Received: (at 51493) by debbugs.gnu.org; 29 Oct 2021 21:35:56 +0000 Received: from localhost ([127.0.0.1]:56149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZXY-0006Db-Bv for submit@debbugs.gnu.org; Fri, 29 Oct 2021 17:35:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZXW-0006Cy-Bj for 51493@debbugs.gnu.org; Fri, 29 Oct 2021 17:35:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58440) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZXR-0002LS-3t; Fri, 29 Oct 2021 17:35:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=5rhw3BGgjnCC/1I96MdYzoPr5bwwelqFxUt+gHDrjb4=; b=C6dF2cWdlZ7FeEq9C8ir mxdqYSJORVCO4Mh9DKAo5b6gSJFnnk1apCI4aQEcQsN7jzwJO3cT/y81WkCdXC/xlQl4MwFAGCOyP Uf4vBaUJGv11y+izZW17pwsG0qOexue2yvBCeTR9TNI0hjoNghda6SDyn3RGojAOmxAqLEDGvE/N3 8MG2z1J0LzzD8gqt4cVgfCjBwwaJVl4b16ig6KpsyrYFrZyj3ezohtsMWWuR1S4kC2ISX2mPGB3Kg Nxp+b8JVL1uDGvyoKUwSN63J+8GGbPbudPRKoO3FICrTNaK0KWFK5mkO+l3ntbsmjcI+ehWO4bnA5 qZ3bS6YLG/n8qQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55462 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgZXQ-0002gP-Nu; Fri, 29 Oct 2021 17:35:48 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51493@debbugs.gnu.org Subject: [PATCH 3/5] import: print: Properly render packages with origins as inputs. Date: Fri, 29 Oct 2021 23:35:37 +0200 Message-Id: <20211029213539.30291-3-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211029213539.30291-1-ludo@gnu.org> References: <20211029213539.30291-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51493 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -3.3 (---) * guix/import/print.scm (package->code)[source->code]: Check whether VERSION is true before calling 'factorize-uri'. [package-lists->code]: Add clause for inputs that are origins. * tests/print.scm (pkg-with-origin-input, pkg-with-origin-input-source): New variables. ("package with origin input"): New test. --- guix/import/print.scm | 14 +++++++++----- tests/print.scm | 28 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/guix/import/print.scm b/guix/import/print.scm index 0310739b3a..8acf5d52f6 100644 --- a/guix/import/print.scm +++ b/guix/import/print.scm @@ -89,9 +89,11 @@ (define (source->code source version) (guix hg-download) (guix svn-download))) (procedure-name method))) - (uri (string-append ,@(match (factorize-uri uri version) - ((? string? uri) (list uri)) - (factorized factorized)))) + (uri ,(if version + `(string-append ,@(match (factorize-uri uri version) + ((? string? uri) (list uri)) + (factorized factorized))) + uri)) ,(if (equal? (content-hash-algorithm hash) 'sha256) `(sha256 (base32 ,(bytevector->nix-base32-string (content-hash-value hash)))) @@ -109,7 +111,7 @@ (define (package-lists->code lsts) (map (match-lambda ((? symbol? s) (list (symbol->string s) (list 'unquote s))) - ((label pkg . out) + ((label (? package? pkg) . out) (let ((mod (package-module-name pkg))) (cons* label ;; FIXME: using '@ certainly isn't pretty, but it @@ -117,7 +119,9 @@ (define (package-lists->code lsts) ;; modules. (list 'unquote (list '@ mod (variable-name pkg mod))) - out)))) + out))) + ((label (? origin? origin)) + (list label (list 'unquote (source->code origin #f))))) lsts))) (let ((name (package-name package)) diff --git a/tests/print.scm b/tests/print.scm index 3386590d3a..ad19f4573a 100644 --- a/tests/print.scm +++ b/tests/print.scm @@ -67,6 +67,30 @@ (define-with-source pkg-with-inputs pkg-with-inputs-source (description "This is a dummy package.") (license license:gpl3+))) +(define-with-source pkg-with-origin-input pkg-with-origin-input-source + (package + (name "test") + (version "1.2.3") + (source (origin + (method url-fetch) + (uri (string-append "file:///tmp/test-" + version ".tar.gz")) + (sha256 + (base32 + "070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) + (build-system (@ (guix build-system gnu) gnu-build-system)) + (inputs + `(("o" ,(origin + (method url-fetch) + (uri "http://example.org/somefile.txt") + (sha256 + (base32 + "0000000000000000000000000000000000000000000000000000")))))) + (home-page "http://gnu.org") + (synopsis "Dummy") + (description "This is a dummy package.") + (license license:gpl3+))) + (test-equal "simple package" `(define-public test ,pkg-source) (package->code pkg)) @@ -75,4 +99,8 @@ (define-with-source pkg-with-inputs pkg-with-inputs-source `(define-public test ,pkg-with-inputs-source) (package->code pkg-with-inputs)) +(test-equal "package with origin input" + `(define-public test ,pkg-with-origin-input-source) + (package->code pkg-with-origin-input)) + (test-end "print") -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 17:35:57 2021 Received: (at 51493) by debbugs.gnu.org; 29 Oct 2021 21:35:57 +0000 Received: from localhost ([127.0.0.1]:56151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZXY-0006Di-OK for submit@debbugs.gnu.org; Fri, 29 Oct 2021 17:35:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZXV-0006Cv-4Q for 51493@debbugs.gnu.org; Fri, 29 Oct 2021 17:35:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZXP-0002L9-QD; Fri, 29 Oct 2021 17:35:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=pKGuDFabDBtnXQYf2yviDMuNMQmTqaqIOY4EbLsxxKc=; b=SoGpErlVPww7VM kRhSa6oVODD7uR/eKwFIaATvGUXy99q3p8aKhFGa4SxKp+uLcGBUK0tGMVywKW8tRJ82nxRMxfMLv 7q8JDjoxP4yxxKH5hnx30ijMuk74shg0z0+chum1x/f6w8/Gs1+/gfDT00CbMGrNbhuljPQGbnZ/0 TAWc5zmKt7PwrEXlABWz4ESAZ7Ua/1ZLiW991TbBVYQjmjHYc8KiNN5E6DdA05pLrq8Nx/EP6EX/x K/RWMb6jhmTQx6ALCEZlcLSGZpx1QRmf/s2Fn0m7KlXDjAeONX3gU/XbgAYigSWDfIXBq8vTtLA7J s8ZbkIQ1U/4AJrysMnYg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55462 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgZXP-0002gP-DN; Fri, 29 Oct 2021 17:35:47 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51493@debbugs.gnu.org Subject: [PATCH 1/5] import: pypi: Allow imports of a specific version. Date: Fri, 29 Oct 2021 23:35:35 +0200 Message-Id: <20211029213539.30291-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51493 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -3.3 (---) * guix/import/pypi.scm (latest-version): New procedure. (latest-source-release): Rename to... (source-release): ... this. Add 'version' parameter. (latest-wheel-release): Rename to... (wheel-release): ... this. Add 'version' parameter. (pypi->guix-package): Honor 'version' parameter. (pypi-recursive-import): Add 'version' parameter and honor it. * guix/scripts/import/pypi.scm (guix-import-pypi): Expect a spec. Pass it to 'package-name->name+version'. Pass the 'version' parameter. * tests/pypi.scm ("pypi->guix-package, no wheel"): Exercise the #:version parameter. * doc/guix.texi (Invoking guix import): Document it. --- doc/guix.texi | 10 ++++++-- guix/import/pypi.scm | 47 +++++++++++++++++++----------------- guix/scripts/import/pypi.scm | 32 ++++++++++++------------ tests/pypi.scm | 12 ++++++--- 4 files changed, 59 insertions(+), 42 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 22215214e0..b742a4808a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11723,13 +11723,19 @@ information, including package dependencies. For maximum efficiency, it is recommended to install the @command{unzip} utility, so that the importer can unzip Python wheels and gather data from them. -The command below imports metadata for the @code{itsdangerous} Python -package: +The command below imports metadata for the latest version of the +@code{itsdangerous} Python package: @example guix import pypi itsdangerous @end example +You can also ask for a specific version: + +@example +guix import pypi itsdangerous@@1.1.0 +@end example + @table @code @item --recursive @itemx -r diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index f908136481..418a3556ec 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -128,27 +128,30 @@ (define-condition-type &missing-source-error &error missing-source-error? (package missing-source-error-package)) -(define (latest-source-release pypi-package) - "Return the latest source release for PYPI-PACKAGE." - (let ((releases (assoc-ref (pypi-project-releases pypi-package) - (project-info-version - (pypi-project-info pypi-package))))) +(define (latest-version project) + "Return the latest version of PROJECT, a record." + (project-info-version (pypi-project-info project))) + +(define* (source-release pypi-package + #:optional (version (latest-version pypi-package))) + "Return the source release of VERSION for PYPI-PACKAGE, a +record, by default the latest version." + (let ((releases (or (assoc-ref (pypi-project-releases pypi-package) version) + '()))) (or (find (lambda (release) (string=? "sdist" (distribution-package-type release))) releases) (raise (condition (&missing-source-error (package pypi-package))))))) -(define (latest-wheel-release pypi-package) +(define* (wheel-release pypi-package + #:optional (version (latest-version pypi-package))) "Return the url of the wheel for the latest release of pypi-package, or #f if there isn't any." - (let ((releases (assoc-ref (pypi-project-releases pypi-package) - (project-info-version - (pypi-project-info pypi-package))))) - (or (find (lambda (release) - (string=? "bdist_wheel" (distribution-package-type release))) - releases) - #f))) + (let ((releases (assoc-ref (pypi-project-releases pypi-package) version))) + (find (lambda (release) + (string=? "bdist_wheel" (distribution-package-type release))) + releases))) (define (python->package-name name) "Given the NAME of a package on PyPI, return a Guix-compliant name for the @@ -484,18 +487,17 @@ (define pypi->guix-package "Fetch the metadata for PACKAGE-NAME from pypi.org, and return the `package' s-expression corresponding to that package, or #f on failure." (let* ((project (pypi-fetch package-name)) - (info (and project (pypi-project-info project)))) + (info (and=> project pypi-project-info)) + (version (or version (and=> project latest-version)))) (and project (guard (c ((missing-source-error? c) (let ((package (missing-source-error-package c))) (leave (G_ "no source release for pypi package ~a ~a~%") - (project-info-name info) - (project-info-version info))))) - (make-pypi-sexp (project-info-name info) - (project-info-version info) - (and=> (latest-source-release project) + (project-info-name info) version)))) + (make-pypi-sexp (project-info-name info) version + (and=> (source-release project version) distribution-url) - (and=> (latest-wheel-release project) + (and=> (wheel-release project version) distribution-url) (project-info-home-page info) (project-info-summary info) @@ -503,8 +505,9 @@ (define pypi->guix-package (string->license (project-info-license info))))))))) -(define (pypi-recursive-import package-name) +(define* (pypi-recursive-import package-name #:optional version) (recursive-import package-name + #:version version #:repo->guix-package pypi->guix-package #:guix-name python->package-name)) @@ -538,7 +541,7 @@ (define (latest-release package) (let* ((info (pypi-project-info pypi-package)) (version (project-info-version info)) (url (distribution-url - (latest-source-release pypi-package)))) + (source-release pypi-package)))) (upstream-source (urls (list url)) (input-changes diff --git a/guix/scripts/import/pypi.scm b/guix/scripts/import/pypi.scm index 9170a0b359..a52cd95c93 100644 --- a/guix/scripts/import/pypi.scm +++ b/guix/scripts/import/pypi.scm @@ -27,6 +27,7 @@ (define-module (guix scripts import pypi) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (srfi srfi-37) + #:use-module (srfi srfi-71) #:use-module (ice-9 match) #:use-module (ice-9 format) #:export (guix-import-pypi)) @@ -83,21 +84,22 @@ (define (parse-options) (_ #f)) (reverse opts)))) (match args - ((package-name) - (if (assoc-ref opts 'recursive) - ;; Recursive import - (map (match-lambda - ((and ('package ('name name) . rest) pkg) - `(define-public ,(string->symbol name) - ,pkg)) - (_ #f)) - (pypi-recursive-import package-name)) - ;; Single import - (let ((sexp (pypi->guix-package package-name))) - (unless sexp - (leave (G_ "failed to download meta-data for package '~a'~%") - package-name)) - sexp))) + ((spec) + (let ((name version (package-name->name+version spec))) + (if (assoc-ref opts 'recursive) + ;; Recursive import + (map (match-lambda + ((and ('package ('name name) . rest) pkg) + `(define-public ,(string->symbol name) + ,pkg)) + (_ #f)) + (pypi-recursive-import name version)) + ;; Single import + (let ((sexp (pypi->guix-package name #:version version))) + (unless sexp + (leave (G_ "failed to download meta-data for package '~a'~%") + name)) + sexp)))) (() (leave (G_ "too few arguments~%"))) ((many ...) diff --git a/tests/pypi.scm b/tests/pypi.scm index 70f4298a90..ad869ac31f 100644 --- a/tests/pypi.scm +++ b/tests/pypi.scm @@ -260,9 +260,15 @@ (define test-metadata-with-extras-jedi "\ ('synopsis "summary") ('description "summary") ('license 'license:lgpl2.0)) - (string=? (bytevector->nix-base32-string - test-source-hash) - hash)) + (and (string=? (bytevector->nix-base32-string + test-source-hash) + hash) + (equal? (pypi->guix-package "foo" #:version "1.0.0") + (pypi->guix-package "foo")) + (catch 'quit + (lambda () + (pypi->guix-package "foo" #:version "42")) + (const #t)))) (x (pk 'fail x #f)))))) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 17:36:06 2021 Received: (at 51493) by debbugs.gnu.org; 29 Oct 2021 21:36:06 +0000 Received: from localhost ([127.0.0.1]:56156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZXi-0006Em-BM for submit@debbugs.gnu.org; Fri, 29 Oct 2021 17:36:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZXX-0006Cz-2O for 51493@debbugs.gnu.org; Fri, 29 Oct 2021 17:35:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZXR-0002Ll-Qp; Fri, 29 Oct 2021 17:35:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=zKkZ8FFV++01i/tetLce2XBA/9nwKRcGk/8k3D8XA2I=; b=HJzH0wQlOL3XNfhFfUrZ pR4NXs441GcaGEngh+GnXyp9IOmEsMaCzJSA1QydREIkgLFJ+YRXlgK1D0fpiKwesiEashWuerRoR p0PI6g/lmybobrCOzITILBb+hDE5ZU1Ns9bsIk2I9g27tAjgCTFXcjmbEIiiYzy27XI6VbM1hlezv 7bLs3KtlK7gskkMfFwhCeSg7svY4Eg/wTlpeJpN/6VMYaUCWCqMYZTP7IT0DM8eJToGXJ7OWPbRjC 2FNGxPABa9u+s7VZ5SsmoBLZeE8gpbctG9HhHe6P9w7+Ls2aDvdfoJ9CoSo3P4ioZDsJwX/QTpptH xkF+jnm1YSnCmg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55462 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgZXR-0002gP-Cd; Fri, 29 Oct 2021 17:35:49 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51493@debbugs.gnu.org Subject: [PATCH 4/5] import: print: Correctly handle URI lists. Date: Fri, 29 Oct 2021 23:35:38 +0200 Message-Id: <20211029213539.30291-4-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211029213539.30291-1-ludo@gnu.org> References: <20211029213539.30291-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51493 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -3.3 (---) * guix/import/print.scm (package->code)[factorized-uri-code]: New procedure. [source->code]: Use it, and factorize URI when it's a list. * tests/print.scm (pkg-with-origin-input): Check origin URI to a list. --- guix/import/print.scm | 15 ++++++++++++--- tests/print.scm | 6 ++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/guix/import/print.scm b/guix/import/print.scm index 8acf5d52f6..4e65d18bc3 100644 --- a/guix/import/print.scm +++ b/guix/import/print.scm @@ -25,6 +25,7 @@ (define-module (guix import print) #:use-module (guix build-system) #:use-module (gnu packages) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (guix import utils) #:use-module (ice-9 control) #:use-module (ice-9 match) @@ -72,6 +73,11 @@ (define (search-path-specification->code spec) (file-type (quote ,(search-path-specification-file-type spec))) (file-pattern ,(search-path-specification-file-pattern spec)))) + (define (factorized-uri-code uri version) + (match (factorize-uri uri version) + ((? string? uri) uri) + ((factorized ...) `(string-append ,@factorized)))) + (define (source->code source version) (let ((uri (origin-uri source)) (method (origin-method source)) @@ -90,9 +96,12 @@ (define (source->code source version) (guix svn-download))) (procedure-name method))) (uri ,(if version - `(string-append ,@(match (factorize-uri uri version) - ((? string? uri) (list uri)) - (factorized factorized))) + (match uri + ((? string? uri) + (factorized-uri-code uri version)) + ((lst ...) + `(list + ,@(map (cut factorized-uri-code <> version) uri)))) uri)) ,(if (equal? (content-hash-algorithm hash) 'sha256) `(sha256 (base32 ,(bytevector->nix-base32-string diff --git a/tests/print.scm b/tests/print.scm index ad19f4573a..7f4c8ccdd1 100644 --- a/tests/print.scm +++ b/tests/print.scm @@ -73,8 +73,10 @@ (define-with-source pkg-with-origin-input pkg-with-origin-input-source (version "1.2.3") (source (origin (method url-fetch) - (uri (string-append "file:///tmp/test-" - version ".tar.gz")) + (uri (list (string-append "file:///tmp/test-" + version ".tar.gz") + (string-append "http://example.org/test-" + version ".tar.gz"))) (sha256 (base32 "070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 17:36:07 2021 Received: (at 51493) by debbugs.gnu.org; 29 Oct 2021 21:36:07 +0000 Received: from localhost ([127.0.0.1]:56158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZXi-0006Eo-OG for submit@debbugs.gnu.org; Fri, 29 Oct 2021 17:36:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZXX-0006D1-NJ for 51493@debbugs.gnu.org; Fri, 29 Oct 2021 17:35:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZXS-0002M0-Fh; Fri, 29 Oct 2021 17:35:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=xsG1veVdeP2XPSH7aHhnL8Ri2+GH+W/RqpnnaWbOQGQ=; b=OfyDuEj+mlmm/XBujCHk yvrKLYzRYtsSQPisS18L3ixnVCvFLXemZFCXePTI1szVToukWCooPvuHpZ1Z5/6xTkVRFGL7xdxeU jeiIUqLokRDoyXuqkTQoTlkRRFQsHZhEucwQ9mBwc/MkMO5/T0Y6JbiBVRd9q50OXmktE2B6VUwNJ j1S6YGYrpMGtmQWFRukrYAEB6uzOpQTx7FKIwe3a/BMzH4rb4V1/sM4LU2CovK+QXcHyWBEwD39nJ WvwtB1H9dhZRpI63YFJQGQw9Oe9/xCWaiDCt9yPQ5QBDUhreLjxGHtj9i3E7eiRsZSNRnG+ahnA49 haYx1nqVgWjXsg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55462 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgZXS-0002gP-3Q; Fri, 29 Oct 2021 17:35:50 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51493@debbugs.gnu.org Subject: [PATCH 5/5] import: print: Handle patches that are origins. Date: Fri, 29 Oct 2021 23:35:39 +0200 Message-Id: <20211029213539.30291-5-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211029213539.30291-1-ludo@gnu.org> References: <20211029213539.30291-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51493 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 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: -3.3 (---) * guix/import/print.scm (package->code)[source->code]: Handle patches that are origins. * tests/print.scm (pkg-with-origin-input): Add 'patches' field. (pkg-with-origin-patch, pkg-with-origin-patch-source): New variables. ("package with origin patch"): New test. --- guix/import/print.scm | 13 +++++++++++-- tests/print.scm | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/guix/import/print.scm b/guix/import/print.scm index 4e65d18bc3..e04a6647b4 100644 --- a/guix/import/print.scm +++ b/guix/import/print.scm @@ -112,8 +112,17 @@ (define (source->code source version) ;; FIXME: in order to be able to throw away the directory prefix, ;; we just assume that the patch files can be found with ;; "search-patches". - ,@(if (null? patches) '() - `((patches (search-patches ,@(map basename patches)))))))) + ,@(cond ((null? patches) + '()) + ((every string? patches) + `((patches (search-patches ,@(map basename patches))))) + (else + `((patches (list ,@(map (match-lambda + ((? string? file) + `(search-patch ,file)) + ((? origin? origin) + (source->code origin #f))) + patches))))))))) (define (package-lists->code lsts) (list 'quasiquote diff --git a/tests/print.scm b/tests/print.scm index 7f4c8ccdd1..ff0db469ab 100644 --- a/tests/print.scm +++ b/tests/print.scm @@ -22,6 +22,7 @@ (define-module (test-print) #:use-module (guix download) #:use-module (guix packages) #:use-module ((guix licenses) #:prefix license:) + #:use-module ((gnu packages) #:select (search-patches)) #:use-module (srfi srfi-64)) (define-syntax-rule (define-with-source object source expr) @@ -79,7 +80,9 @@ (define-with-source pkg-with-origin-input pkg-with-origin-input-source version ".tar.gz"))) (sha256 (base32 - "070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")))) + "070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")) + (patches (search-patches "guile-linux-syscalls.patch" + "guile-relocatable.patch")))) (build-system (@ (guix build-system gnu) gnu-build-system)) (inputs `(("o" ,(origin @@ -93,6 +96,30 @@ (define-with-source pkg-with-origin-input pkg-with-origin-input-source (description "This is a dummy package.") (license license:gpl3+))) +(define-with-source pkg-with-origin-patch pkg-with-origin-patch-source + (package + (name "test") + (version "1.2.3") + (source (origin + (method url-fetch) + (uri (string-append "file:///tmp/test-" + version ".tar.gz")) + (sha256 + (base32 + "070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah")) + (patches + (list (origin + (method url-fetch) + (uri "http://example.org/x.patch") + (sha256 + (base32 + "0000000000000000000000000000000000000000000000000000"))))))) + (build-system (@ (guix build-system gnu) gnu-build-system)) + (home-page "http://gnu.org") + (synopsis "Dummy") + (description "This is a dummy package.") + (license license:gpl3+))) + (test-equal "simple package" `(define-public test ,pkg-source) (package->code pkg)) @@ -105,4 +132,8 @@ (define-with-source pkg-with-origin-input pkg-with-origin-input-source `(define-public test ,pkg-with-origin-input-source) (package->code pkg-with-origin-input)) +(test-equal "package with origin patch" + `(define-public test ,pkg-with-origin-patch-source) + (package->code pkg-with-origin-patch)) + (test-end "print") -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 10 18:26:59 2021 Received: (at 51493-done) by debbugs.gnu.org; 10 Nov 2021 23:27:00 +0000 Received: from localhost ([127.0.0.1]:39425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkwzb-0005Nj-KF for submit@debbugs.gnu.org; Wed, 10 Nov 2021 18:26:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkwzZ-0005NU-Sl for 51493-done@debbugs.gnu.org; Wed, 10 Nov 2021 18:26:58 -0500 Received: from [2001:470:142:3::e] (port=58250 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkwzU-0002Jj-MM for 51493-done@debbugs.gnu.org; Wed, 10 Nov 2021 18:26:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=menyEho/OYZ4Kq4PYmjqVJN4OQexO4+ozmIGznqIWyQ=; b=VFWGtQPSbPbmm7s8L8/n nmAhPbZ8Q3J/u9XHyZzyaBzeuvbnylcq51VPhxly0Zgqgqmx94MC0JOEr8Yk5spqOO5fA0LgTYb35 x9BtBKny3U/CgwO9BRhTxT1AAicb8SU+WaVoxNsbUVoOqG+rKLCOlQe7+6OgVXA9q4kRgwjO+7Rlo kfFIhLjdO9AXv5u3gqkK4CEHkUP/6VjwDy3XKNgXJsPSOSsfmWDnfnMK8VGF7UHOwt4G7P56Z/S1M RM73JzNteEc3bU6xxhZUJhqHjpEWK3vD8nzLgv3lkh5kLu6hCzpHCsgcpc0SduElZ6kLXEPczf2tV 8u6TDx4TpMYM5g==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:59249 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkwzU-0003kE-8y for 51493-done@debbugs.gnu.org; Wed, 10 Nov 2021 18:26:52 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 51493-done@debbugs.gnu.org Subject: Re: bug#51493: [PATCH 0/5] Improvements to the pypi, cran, and "print" importers References: <20211029212948.30148-1-ludo@gnu.org> Date: Thu, 11 Nov 2021 00:26:50 +0100 In-Reply-To: <20211029212948.30148-1-ludo@gnu.org> ("Ludovic =?utf-8?Q?Cou?= =?utf-8?Q?rt=C3=A8s=22's?= message of "Fri, 29 Oct 2021 23:29:48 +0200") Message-ID: <87lf1vfv7p.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51493-done 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: -3.3 (---) Ludovic Court=C3=A8s skribis: > import: pypi: Allow imports of a specific version. > import: cran: Allow imports of a specific version. > import: print: Properly render packages with origins as inputs. > import: print: Correctly handle URI lists. > import: print: Handle patches that are origins. Pushed as b2ed40c29f578d46d42cb1c5e99bd797cea3aba0, topped with this extra commit in the same vein: 3756ce3267 import: print: Replace packages and origins in 'arguments'. I=E2=80=99ll have to take care of the merge conflicts with =E2=80=98core-up= dates-frozen=E2=80=99 in print.scm=E2=80=A6 Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 12 05:28:28 2021 Received: (at 51493) by debbugs.gnu.org; 12 Nov 2021 10:28:28 +0000 Received: from localhost ([127.0.0.1]:43532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlTnI-0001KJ-0L for submit@debbugs.gnu.org; Fri, 12 Nov 2021 05:28:28 -0500 Received: from mail-wr1-f49.google.com ([209.85.221.49]:44031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlTnE-0001K5-UR for 51493@debbugs.gnu.org; Fri, 12 Nov 2021 05:28:26 -0500 Received: by mail-wr1-f49.google.com with SMTP id t30so14602300wra.10 for <51493@debbugs.gnu.org>; Fri, 12 Nov 2021 02:28:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=bZ1vN9xapvZ1KkarV2GKiLUMCjWzIEq6RG16bD3ybxg=; b=oruZPUzyCb+oJL6xW0R4lnDWh1IZ3dblYVdDb3alqRu8OH1J0RPhT0rMovw00zPKjx xG92Htyj8p26bkch+XUhRVQOV8r01Y1mdsZ5n8kjazSVbPF0ZZu6Tr++9Ou9/44MH6jh Ne/N+Y2a0p9huzDvGfnnBhF+t/13CSgaSkoJDnDCpzkjdbwrGzcWL/umpFcUifx8uc0k HTf6w8LeBVejPi7Ajliw2wozt3yWsK6iDgnj+8RdJZ6f3rzX5Djc9Csta8EKqmWdtfZ7 9S7uRIjAWbZUCDWl1lDFzXDnI/rtZLWHqpq80iuvvcR3ApchRFn1GO70/yTfWaSYACWu +0eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=bZ1vN9xapvZ1KkarV2GKiLUMCjWzIEq6RG16bD3ybxg=; b=laDm/7AlNcuOhTjOrn4GQVLqHS59cXKe/+ECsqT1O8f91yFzM0xJ7Y3bPK97aRel5/ Cs1h9ypTeVkfLAkDD6X/a85MFrTv4iYTY6GFfTCeIfU1yJn2EV6ZNiqTqOYkHc6aUTft SgEQsW4tlVYWQ8y7YFudXGYyL3Bu/oZOWo6xydqWW7F7wh65WmmMtULN2aJhxvm5dhr4 ec+YrIgQr+pSDTkl8KnF88W7zyV31wiRwzLQY+m357HQmjx7K/wBx/m7Rj3z8jZxEc3Z OHsZeyY3DQMFKrCs6G01N5uafH70vcdXoeE9s2zWrjCyawMxPhHbE3TT9HDT+R0FUkEC bTqQ== X-Gm-Message-State: AOAM530DfcGXU5RbpOdW2/9z6Gdxq5zEBXSRSlyEPVDSldkdWGQo/i5b 7tGj5mesOWNyD4g6J+pJtRo= X-Google-Smtp-Source: ABdhPJy8iqMBv+umW0GF1BK1MIFV1KhpKVGfjjhespsa8Jdpf/3hzxk4E0DdhcntENL3kCVdgqdsOA== X-Received: by 2002:a5d:4492:: with SMTP id j18mr17865911wrq.397.1636712899009; Fri, 12 Nov 2021 02:28:19 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id p19sm5764699wmq.4.2021.11.12.02.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 02:28:18 -0800 (PST) From: zimoun To: Ludovic =?utf-8?Q?Court=C3=A8s?= , 51493@debbugs.gnu.org Subject: Re: [bug#51493] [PATCH 1/5] import: pypi: Allow imports of a specific version. In-Reply-To: <20211029213539.30291-1-ludo@gnu.org> References: <20211029212948.30148-1-ludo@gnu.org> <20211029213539.30291-1-ludo@gnu.org> Date: Fri, 12 Nov 2021 11:18:48 +0100 Message-ID: <86h7chpth3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51493 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= 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 (-) Hi Ludo, I am late to the party. I just have one bikeshedding question about double =E2=80=99@=E2=80=99 for specifying the version=E2=80=A6 On Fri, 29 Oct 2021 at 23:35, Ludovic Court=C3=A8s wrote: > +You can also ask for a specific version: > + > +@example > +guix import pypi itsdangerous@@1.1.0 > +@end example =E2=80=A6as here. Is doubling =E2=80=99@=E2=80=99 mandatory for technical = reasons? Because usually, Guix uses simple =E2=80=99@=E2=80=99 when referring to a specific = version. BTW, patch#51545 [1] adds similar features for egg importer. 1: Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 12 05:50:06 2021 Received: (at 51493) by debbugs.gnu.org; 12 Nov 2021 10:50:06 +0000 Received: from localhost ([127.0.0.1]:43564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlU8D-0001v1-RO for submit@debbugs.gnu.org; Fri, 12 Nov 2021 05:50:06 -0500 Received: from tobias.gr ([80.241.217.52]:42714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlU88-0001uT-TA for 51493@debbugs.gnu.org; Fri, 12 Nov 2021 05:50:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=BCW0ETmkiCUSn +TM4sTG94OGS0+MXjBCiYywDpMtakM=; h=references:in-reply-to:subject:cc: to:from:date; d=tobias.gr; b=fQVipTqqzG0Sg1zX7dwnJBp4XyN4810/TeJB4GrIK DUYCNBckTBcd4HVwY+WLfvrbDY2vhP+z87DbCI2+zbBldcY4TzYk5AchXGj5SULTqSJgCu t2Fa5rVo6WQn85uXwQrY8srGdn0H2rkoAPTHnvrd1TkG3PAo2nyGQIdJAYLIiH27WLXrmG 0BpMN4Zzzk26pUjo+1b3bnv3nCfq2WuIhNvv0q1Yrv8RQ87P22XPTjnH4xTTHLv8NVzG2K MJ/lzINez6nJX+GuRbDgs9tuhDRik8JBdXokewUGmJih3uldnwd3VEtfK0fQCT1dT8Dwx2 G876cBtn9Wi4gj6DZB/0g== Received: by submission.tobias.gr (OpenSMTPD) with ESMTP id 097a7460; Fri, 12 Nov 2021 10:49:57 +0000 (UTC) MIME-Version: 1.0 Date: Fri, 12 Nov 2021 11:49:56 +0100 From: Tobias Geerinckx-Rice To: zimoun Subject: Re: [bug#51493] [PATCH 1/5] import: pypi: Allow imports of a specific version. In-Reply-To: <86h7chpth3.fsf@gmail.com> References: <20211029212948.30148-1-ludo@gnu.org> <20211029213539.30291-1-ludo@gnu.org> <86h7chpth3.fsf@gmail.com> Message-ID: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51493 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , 51493@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 (-) Simon, On 2021-11-12 11:18, zimoun wrote: > …as here. Is doubling ’@’ mandatory for technical reasons? Because > usually, Guix uses simple ’@’ when referring to a specific version. @ is special in Texinfo: >> @example '@@' encodes a literal '@'. Kind regards, T G-R Sent from a Web browser. Excuse or enjoy my brevity. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 12 06:11:04 2021 Received: (at 51493) by debbugs.gnu.org; 12 Nov 2021 11:11:04 +0000 Received: from localhost ([127.0.0.1]:43569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlUSW-0002Rj-Kd for submit@debbugs.gnu.org; Fri, 12 Nov 2021 06:11:04 -0500 Received: from mail-il1-f169.google.com ([209.85.166.169]:44560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlUSS-0002R9-7B for 51493@debbugs.gnu.org; Fri, 12 Nov 2021 06:11:03 -0500 Received: by mail-il1-f169.google.com with SMTP id h2so8583622ili.11 for <51493@debbugs.gnu.org>; Fri, 12 Nov 2021 03:11:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jt+/Ay4ex2zorm4EXcsPYY6uYHKYoVbn4CtHwVBrGdA=; b=IR42y3y6xF1nIVY6gJ62zX3GKLk9txzkUIT8jj0WepauktH1nF20NBS5GF6QH2Sc8s QDTuBPZVaq1wDujWr+4tZ6HC2J5pnUtvsX3QLTZ+35fBwTpI70QXBBe1C+eDTpjcisqt OWHw8MPaOKLgSCFzRqeP7xaj++x0asMNNm18fx0lYhXC0O9OJ51Qcg33mN6DULUEB01N 7XUtRhiuwnz8/LEHcfZ5epPVpVEanALcNLB9+EHZlCaooJ0uH9kJAqLs8kwh1/idXU/x lRWw0gJOERD9qlOLGw5KZmeuE48XpHMRiRBNI96lLdNpRJeFEfnL3yg4k8uSSG90Vwyu KzVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jt+/Ay4ex2zorm4EXcsPYY6uYHKYoVbn4CtHwVBrGdA=; b=5/TEDIbOBLa3aiDbJN7NjXGPb6539UjIAUbOQkNT4iH65gyNZh9e3IygwG9rBnjZAq zneD6cXpw6WAclLVF2iSlT/DDbAXb2nnWg90eMy0i+VHO8Y4QBW2pwKegpUgursVnEnQ Rg0hg+ySYVDWAwDkdp0oP4DPHQ+8TI0G5HpjJoHLYJcY4OcE9CVOhZCaJENQiErNKlOR ePR5ivZZUfZEge7ng3fX5Q6k0y/J2Mo8jVs2YSkMtebktdrsoFAv9+Z4v+J4x1eDdjNl ivJmVxDEl2YAk0L804X9OBrJ6jBF0AxwXA1kD9CHSK9K2YJ/UMuRuLScbAbsTlKMXXaW Mycw== X-Gm-Message-State: AOAM5314ffZuHYyvP1oZLaCb3kHh0nasDBMbB4FRG89vnuh140xMj8gE dpQO2PYqVjGvfAD112eZa4IiUlxsoXgq41zspKI= X-Google-Smtp-Source: ABdhPJxtCCfsWzRHh8RBNSYP23xCfTWqrq04zKPN96UfG6fBdzFpq5fcaRgV4TarRJ2eA5zB8wh8TSS5VH1CXlWD54Q= X-Received: by 2002:a05:6e02:1210:: with SMTP id a16mr9039933ilq.75.1636715454499; Fri, 12 Nov 2021 03:10:54 -0800 (PST) MIME-Version: 1.0 References: <20211029212948.30148-1-ludo@gnu.org> <20211029213539.30291-1-ludo@gnu.org> <86h7chpth3.fsf@gmail.com> In-Reply-To: From: zimoun Date: Fri, 12 Nov 2021 12:10:43 +0100 Message-ID: Subject: Re: [bug#51493] [PATCH 1/5] import: pypi: Allow imports of a specific version. To: Tobias Geerinckx-Rice Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51493 Cc: =?UTF-8?Q?Ludovic_Court=C3=A8s?= , 51493@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 (-) Re, On Fri, 12 Nov 2021 at 11:50, Tobias Geerinckx-Rice wrote: > @ is special in Texinfo: Rah, obviously! Sorry for the noise. Cheers, simon From unknown Thu Aug 21 12:11:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 10 Dec 2021 12:24:14 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator