From patchwork Tue Jul 21 11:56:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanguy LE CARROUR X-Patchwork-Id: 23295 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 A0B0227BBE3; Tue, 21 Jul 2020 12:58:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 57A8F27BBE1 for ; Tue, 21 Jul 2020 12:58:17 +0100 (BST) Received: from localhost ([::1]:51638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jxquW-0004yp-TY for patchwork@mira.cbaines.net; Tue, 21 Jul 2020 07:58:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jxquJ-0004gy-3K for guix-patches@gnu.org; Tue, 21 Jul 2020 07:58:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jxquI-0007Ku-Qu for guix-patches@gnu.org; Tue, 21 Jul 2020 07:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jxquI-0001tV-QU for guix-patches@gnu.org; Tue, 21 Jul 2020 07:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42465] [PATCH 05/10] gnu: Add python-libcst. Resent-From: Tanguy Le Carrour Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Jul 2020 11:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42465 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42465@debbugs.gnu.org Cc: Tanguy Le Carrour Received: via spool by 42465-submit@debbugs.gnu.org id=B42465.15953326407159 (code B ref 42465); Tue, 21 Jul 2020 11:58:02 +0000 Received: (at 42465) by debbugs.gnu.org; 21 Jul 2020 11:57:20 +0000 Received: from localhost ([127.0.0.1]:38382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jxqtY-0001rE-AU for submit@debbugs.gnu.org; Tue, 21 Jul 2020 07:57:19 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:40257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jxqtW-0001ql-88 for 42465@debbugs.gnu.org; Tue, 21 Jul 2020 07:57:14 -0400 X-Originating-IP: 176.159.32.89 Received: from rafflesia.easter-eggs.fr (176-159-32-89.abo.bbox.fr [176.159.32.89]) (Authenticated sender: tanguy@bioneland.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPA id 708261BF203; Tue, 21 Jul 2020 11:57:08 +0000 (UTC) From: Tanguy Le Carrour Date: Tue, 21 Jul 2020 13:56:28 +0200 Message-Id: <20200721115633.6088-5-tanguy@bioneland.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200721115633.6088-1-tanguy@bioneland.org> References: <20200721115633.6088-1-tanguy@bioneland.org> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-xyz.scm (python-libcst): New variable. --- gnu/packages/python-xyz.scm | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 2293a16ecc..6b462a42f0 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -12274,6 +12274,61 @@ in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.") (license license:expat))) +(define-public python-libcst + (package + (name "python-libcst") + (version "0.3.7") + (source (origin + (method url-fetch) + (uri (pypi-uri "libcst" version)) + (sha256 + (base32 + "1wfd5m9jhk5x2qpz29pjhm9ypp5h3nlbk6xv4vzn4f45xdf5bv9x")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'remove-failing-tests + (lambda _ + ;; Reported upstream: . + (delete-file "libcst/tests/test_fuzz.py") + ;; Reported upstream: . + (delete-file "libcst/tests/test_pyre_integration.py") + (delete-file "libcst/codemod/tests/test_codemod_cli.py") + (delete-file "libcst/metadata/tests/test_full_repo_manager.py") + (delete-file "libcst/metadata/tests/test_type_inference_provider.py") + #t)) + (replace 'check + (lambda _ + (setenv "PYTHONPATH" (string-append (getcwd) ":" (getenv "PYTHONPATH"))) + (invoke "python" "-m" "libcst.codegen.generate" "visitors") + (invoke "python" "-m" "libcst.codegen.generate" "return_types") + (invoke "python" "-m" "unittest") + #t))))) + (native-inputs + `(("python-black" ,python-black) + ("python-hypothesis" ,python-hypothesis) + ("python-isort" ,python-isort))) + (propagated-inputs + `(("python-typing-extensions" ,python-typing-extensions) + ("python-typing-inspect" ,python-typing-inspect) + ("python-pyyaml" ,python-pyyaml))) + (home-page "https://github.com/Instagram/LibCST") + (synopsis "A Concrete Syntax Tree (CST) parser and serializer library for Python") + (description + "LibCST parses Python 3.0, 3.1, 3.3, 3.5, 3.6, 3.7 or 3.8 source code as a CST tree +that keeps all formatting details (comments, whitespaces, parentheses, etc). It's useful +for building automated refactoring (codemod) applications and linters. LibCST creates +a compromise between an Abstract Syntax Tree (AST) and a traditional Concrete Syntax +Tree (CST). By carefully reorganizing and naming node types and fields, we've created +a lossless CST that looks and feels like an AST.") + (license (list license:expat + ;; Some files unde libcst/_parser/ are under Python Software + ;; Foundation license (see LICENSE file for details) + license:psfl + ;; libcst/_add_slots.py + license:asl2.0)))) + (define-public python-typing-inspect (package (name "python-typing-inspect")