guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: gnu: Add python-typed-ast.


From: guix-commits
Subject: 01/04: gnu: Add python-typed-ast.
Date: Wed, 26 Jun 2019 00:08:19 -0400 (EDT)

apteryx pushed a commit to branch master
in repository guix.

commit dae2eb1c127c636226ba11d05ec638f113a3c831
Author: Maxim Cournoyer <address@hidden>
Date:   Mon May 20 23:33:47 2019 -0400

    gnu: Add python-typed-ast.
    
    * gnu/packages/python-xyz.scm (python-typed-ast): New variable.
---
 gnu/packages/python-xyz.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d09e107..cb3a695 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -14036,6 +14036,51 @@ source bytes using the UTF-8 encoding and then 
rewrites Python 3.6 style
 @code{f} strings.")
     (license license:expat)))
 
+(define-public python-typed-ast
+  (package
+    (name "python-typed-ast")
+    (version "1.3.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "typed-ast" version))
+       (sha256
+        (base32
+         "1m7pr6qpana3cvqwiw7mlvrgvmw27ch5mx1592572xhlki8g85ak"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:modules ((guix build utils)
+                  (guix build python-build-system)
+                  (ice-9 ftw)
+                  (srfi srfi-1)
+                  (srfi srfi-26))
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (let ((cwd (getcwd)))
+               (setenv "PYTHONPATH"
+                       (string-append cwd "/build/"
+                                      (find (cut string-prefix? "lib" <>)
+                                            (scandir (string-append cwd 
"/build")))
+                                      ":"
+                                      (getenv "PYTHONPATH"))))
+             (invoke "pytest")
+             #t)))))
+    (native-inputs `(("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/python/typed_ast";)
+    (synopsis "Fork of Python @code{ast} modules with type comment support")
+    (description "This package provides a parser similar to the standard
+@code{ast} library.  Unlike @code{ast}, the parsers in @code{typed_ast}
+include PEP 484 type comments and are independent of the version of Python
+under which they are run.  The @code{typed_ast} parsers produce the standard
+Python AST (plus type comments), and are both fast and correct, as they are
+based on the CPython 2.7 and 3.7 parsers.")
+    ;; See the file "LICENSE" for the details.
+    (license (list license:psfl
+                   license:asl2.0
+                   license:expat))))    ;ast27/Parser/spark.py
+
 (define-public python-typing
   (package
     (name "python-typing")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]