From bb3b4b4ee98d15273c34a8bd7bf8e8a3a07d7390 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Mon, 20 Feb 2017 01:37:35 -0500 Subject: gnu: Add python-attrs. * gnu/packages/python.scm (python-attrs, python2-attrs): New variables. Co-authored-by: Ricardo Wurmus --- gnu/packages/python.scm | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 93bfe18526..f4010b6928 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -22,7 +22,7 @@ ;;; Copyright © 2016 Hartmut Goebel ;;; Copyright © 2016 Daniel Pimentel ;;; Copyright © 2016 Sou Bunnbu -;;; Copyright © 2016 Troy Sankey +;;; Copyright © 2016, 2017 Troy Sankey ;;; Copyright © 2016, 2017 ng0 ;;; Copyright © 2016 Dylan Jeffers ;;; Copyright © 2016 David Craven @@ -14228,6 +14228,32 @@ Python. It is based on Parsing Expression Grammars, PEG. With pyPEG you can parse many formal languages.") (license license:gpl2))) +(define-public python-attrs + (package + (name "python-attrs") + (version "17.2.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "attrs" version)) + (sha256 + (base32 + "04gx08ikpk26wnq22f7l42gapcvk8iz1512r927k6sadz6cinkax")))) + (build-system python-build-system) + (native-inputs + `(("python-pytest" ,python-pytest) + ("python-hypothesis" ,python-hypothesis) + ("python-zope-interface" ,python-zope-interface) + ("python-six" ,python-six))) + (home-page "https://github.com/python-attrs/attrs/") + (synopsis "Attributes without boilerplate") + (description "@code{attrs} is a Python package with class decorators that +ease the chores of implementing the most common attribute-related object +protocols.") + (license license:expat))) + +(define-public python2-attrs + (package-with-python2 python-attrs)) + (define-public python2-cliapp (package (name "python2-cliapp") -- cgit v1.3 From 9074bac1391b4db5cf33f3cb9f86f38061e97ae9 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Tue, 21 Feb 2017 14:17:41 -0500 Subject: gnu: Add python-constantly. * gnu/packages/python.scm (python-constantly, python2-constantly): New variables. Signed-off-by: Ricardo Wurmus --- gnu/packages/python.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index f4010b6928..3adab71d12 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -14228,6 +14228,27 @@ Python. It is based on Parsing Expression Grammars, PEG. With pyPEG you can parse many formal languages.") (license license:gpl2))) +(define-public python-constantly + (package + (name "python-constantly") + (version "15.1.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "constantly" version)) + (sha256 + (base32 + "0dgwdla5kfpqz83hfril716inm41hgn9skxskvi77605jbmp4qsq")))) + (build-system python-build-system) + (home-page "https://github.com/twisted/constantly") + (synopsis "Symbolic constants in Python") + (description "Constantly is a Python library that provides symbolic +constant support. It includes collections and constants with text, numeric, +and bit flag values.") + (license license:expat))) + +(define-public python2-constantly + (package-with-python2 python-constantly)) + (define-public python-attrs (package (name "python-attrs") -- cgit v1.3 From fd8ff99aa7d0a6a3dbc13dd3a1d183fdd52fa452 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Tue, 21 Feb 2017 14:18:29 -0500 Subject: gnu: Add python-m2r. * gnu/packages/python.scm (python-m2r, python2-m2r): New variables. Co-authored-by: Ricardo Wurmus --- gnu/packages/python.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 3adab71d12..5b77a25095 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -14228,6 +14228,32 @@ Python. It is based on Parsing Expression Grammars, PEG. With pyPEG you can parse many formal languages.") (license license:gpl2))) +(define-public python-m2r + (package + (name "python-m2r") + (version "0.1.12") + (source (origin + (method url-fetch) + (uri (pypi-uri "m2r" version)) + (sha256 + (base32 + "1axrwnf425sz4qz3c0qc7yhhki4myzb8rki7pczcsgzznzmqdyxd")))) + (build-system python-build-system) + (propagated-inputs + `(("python-docutils" ,python-docutils) + ("python-mistune" ,python-mistune))) + (native-inputs + `(("python-pygments" ,python-pygments) + ("python-mock" ,python-mock))) + (home-page "https://github.com/miyakogi/m2r") + (synopsis "Markdown to reStructuredText converter") + (description "M2R converts a markdown file including reST markups to valid +reST format.") + (license license:expat))) + +(define-public python2-m2r + (package-with-python2 python-m2r)) + (define-public python-constantly (package (name "python-constantly") -- cgit v1.3 From 96cb5ca1f2418871a53c6993aae6209016681ce1 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Tue, 21 Feb 2017 14:19:52 -0500 Subject: gnu: Add python-automat. * gnu/packages/python.scm (python-automat, python2-automat): New variables. Co-authored-by: Ricardo Wurmus --- gnu/packages/python.scm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 5b77a25095..c9e52c9e5e 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -14228,6 +14228,39 @@ Python. It is based on Parsing Expression Grammars, PEG. With pyPEG you can parse many formal languages.") (license license:gpl2))) +(define-public python-automat + (package + (name "python-automat") + (version "0.6.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "Automat" version)) + (sha256 + (base32 + "1a7nsrljysfmdqmpn2apfa1gg6rfah4y9sizvns8gb08rx7d07rw")))) + (build-system python-build-system) + ;; We disable the tests because they require python-twisted, while + ;; python-twisted depends on python-automat. Twisted is optional, but the + ;; tests fail if it is not available. Also see + ;; . + (arguments '(#:tests? #f)) + (native-inputs + `(("python-m2r" ,python-m2r) + ("python-setuptools-scm" ,python-setuptools-scm) + ("python-graphviz" ,python-graphviz))) + (propagated-inputs + `(("python-six" ,python-six) + ("python-attrs" ,python-attrs))) + (home-page "https://github.com/glyph/Automat") + (synopsis "Self-service finite-state machines") + (description "Automat is a library for concise, idiomatic Python +expression of finite-state automata (particularly deterministic finite-state +transducers).") + (license license:expat))) + +(define-public python2-automat + (package-with-python2 python-automat)) + (define-public python-m2r (package (name "python-m2r") -- cgit v1.3 From 0cd83b4e000df50f93f00b3b77691852afe57b7f Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Mon, 20 Feb 2017 01:37:40 -0500 Subject: gnu: Add python-incremental. * gnu/packages/python.scm (python-incremental, python2-incremental): New variables. Co-authored-by: Ricardo Wurmus --- gnu/packages/python.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index c9e52c9e5e..1414979378 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -14228,6 +14228,27 @@ Python. It is based on Parsing Expression Grammars, PEG. With pyPEG you can parse many formal languages.") (license license:gpl2))) +(define-public python-incremental + (package + (name "python-incremental") + (version "17.5.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "incremental" version)) + (sha256 + (base32 + "1cylxdz1cnkm5g3pklna3h2n0i0rks95ir1pnpxfnvpkmab1cxbv")))) + (build-system python-build-system) + (home-page "https://github.com/hawkowl/incremental") + (synopsis "Library for versioning Python projects") + (description "Incremental is a small library that versions your Python +projects.") + (license license:expat))) + +(define-public python2-incremental + (package-with-python2 python-incremental)) + (define-public python-automat (package (name "python-automat") -- cgit v1.3 From c1578ad0632ecb4567d502ee9144ed6bb72ebb60 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Tue, 10 Oct 2017 22:55:42 +0200 Subject: gnu: python-twisted: Update to 17.1.0. * gnu/packages/python.scm (python-twisted): Update to 17.1.0. Signed-off-by: Ricardo Wurmus --- gnu/packages/python.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 1414979378..84e9ece25d 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -11745,13 +11745,13 @@ format.") (define-public python-twisted (package (name "python-twisted") - (version "16.2.0") + (version "17.1.0") (source (origin (method url-fetch) (uri (pypi-uri "Twisted" version ".tar.bz2")) (sha256 (base32 - "0ydxrp9myw1mvsz3qfzx5579y5llmqa82pxvqchgp5syczffi450")))) + "1p245mg15hkxp7hy5cyq2fgvlgjkb4cg0gwkwd148nzy1bbi3wnv")))) (build-system python-build-system) (arguments '(#:tests? #f)) ; FIXME: Some tests are failing. @@ -11761,7 +11761,10 @@ format.") ;; (lambda _ ;; (zero? (system* "./bin/trial" "twisted"))))) (propagated-inputs - `(("python-zope-interface" ,python-zope-interface))) + `(("python-zope-interface" ,python-zope-interface) + ("python-incremental" ,python-incremental) + ("python-constantly" ,python-constantly) + ("python-automat" ,python-automat))) (home-page "https://twistedmatrix.com/") (synopsis "Asynchronous networking framework written in Python") (description -- cgit v1.3 From 22d1060eff9df7086beef8ea3aa2158106f97de7 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 11 Oct 2017 11:04:05 +0200 Subject: gnu: python-rpy2: Ignore test results. * gnu/packages/python.scm (python-rpy2)[arguments]: Ignore test failures. --- gnu/packages/python.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 84e9ece25d..1509f7046a 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -4512,7 +4512,8 @@ operators such as union, intersection, and difference.") (scandir (string-append cwd "/build"))) ":" (getenv "PYTHONPATH")))) - (zero? (system* "python" "-m" "rpy2.tests" "-v"))))))) + ;; FIXME: Even when all tests pass, the check phase will fail. + (system* "python" "-m" "rpy2.tests" "-v")))))) (propagated-inputs `(("python-six" ,python-six) ("python-jinja2" ,python-jinja2) -- cgit v1.3 From ee8aab1f8db79e73612530a9fa4c32f252099e3e Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 10 Oct 2017 23:31:57 +0100 Subject: gnu: Add python-jupyter-console as input to python-ipython. This fixes running ipython console and ipython3 console, as the jupyter_console package is missing. As python-ipython is an input to python-jupyter-console, use a modified version of the package which doesn't have this input. * gnu/packages/python.scm (python-jupyter-console-minimal): New variable. (python-ipython)[propagated-inputs]: Replace python-jupyter-console with python-jupyter-console-minimal. --- gnu/packages/python.scm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 1509f7046a..f436023b48 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -5855,6 +5855,12 @@ tools for mocking system commands and recording calls to those.") ("python-numpy" ,python-numpy) ("python-numpydoc" ,python-numpydoc) ("python-jinja2" ,python-jinja2) + ("python-jupyter-console" + ;; The python-ipython and python-jupyter-console require each + ;; other. To get the functionality in both packages working, strip + ;; down the python-jupyter-console package when using it as an input + ;; to python-ipython. + ,python-jupyter-console-minimal) ("python-mistune" ,python-mistune) ("python-pexpect" ,python-pexpect) ("python-pickleshare" ,python-pickleshare) @@ -8560,6 +8566,31 @@ Jupyter kernels such as IJulia and IRKernel.") (define-public python2-jupyter-console (package-with-python2 python-jupyter-console)) +;; The python-ipython and python-jupyter-console require each other. To get +;; the functionality in both packages working, strip down the +;; python-jupyter-console package when using it as an input to python-ipython. +(define python-jupyter-console-minimal + (package + (inherit python-jupyter-console) + (arguments + (substitute-keyword-arguments + (package-arguments python-jupyter-console) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'install 'delete-bin + (lambda* (#:key outputs #:allow-other-keys) + ;; Delete the bin files, to avoid conflicts in profiles + ;; where python-ipython and python-jupyter-console are + ;; both present. + (delete-file-recursively + (string-append + (assoc-ref outputs "out") "/bin")))))))) + ;; Remove the python-ipython propagated input, to avoid the cycle + (propagated-inputs + (alist-delete + "python-ipython" + (package-propagated-inputs python-jupyter-console))))) + (define-public jupyter (package (name "jupyter") -- cgit v1.3 From 4e169fc67aa6bb24403e28a8cd02bf77dc37b1da Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 12 Oct 2017 23:39:03 +0300 Subject: gnu: python-psycopg2: Use postgresql@9.6. * gnu/packages/python.scm (python-psycopg2)[inputs]: Replace postgresql with postgresql@9.6. --- gnu/packages/python.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index f436023b48..12d4dd21a7 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -10829,7 +10829,7 @@ introspection of @code{zope.interface} instances in code.") ;; and a running postgresql database management service. `(#:tests? #f)) ; TODO re-enable after providing a test-db. (inputs - `(("postgresql" ,postgresql))) ; libpq + `(("postgresql" ,postgresql-9.6))) ; libpq (home-page "http://initd.org/psycopg/") (synopsis "Python PostgreSQL adapter") (description -- cgit v1.3 From e37415917c4758142c052cae46b3d84517b54ec2 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 12 Oct 2017 23:56:11 +0300 Subject: gnu: python-psycopg2: Update to 2.7.3.1. * gnu/packages/python.scm (python-psycopg2): Update to 2.7.3.1. [inputs]: Replace postgresql@9.6 with postgresql. --- gnu/packages/python.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 12d4dd21a7..44504e3833 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -10815,21 +10815,21 @@ introspection of @code{zope.interface} instances in code.") (define-public python-psycopg2 (package (name "python-psycopg2") - (version "2.6.2") + (version "2.7.3.1") (source (origin (method url-fetch) (uri (pypi-uri "psycopg2" version)) (sha256 (base32 - "0p60z2gwfcal30y2w8gprflchp1kcg9qblc5rn782p4wxl90wjbh")))) + "0rda1j02ds6s28752fhmpwg761sh6jsxi1gpczqkrd28cki1cywv")))) (build-system python-build-system) (arguments ;; Tests would require a postgresql database "psycopg2_test" ;; and a running postgresql database management service. `(#:tests? #f)) ; TODO re-enable after providing a test-db. (inputs - `(("postgresql" ,postgresql-9.6))) ; libpq + `(("postgresql" ,postgresql))) ; libpq (home-page "http://initd.org/psycopg/") (synopsis "Python PostgreSQL adapter") (description -- cgit v1.3 From a4593cc95bb45878ad44b9761d6b6962532da409 Mon Sep 17 00:00:00 2001 From: ng0 Date: Wed, 20 Sep 2017 11:31:51 +0000 Subject: gnu: python-fonttools: Update to 3.15.1. * gnu/packages/python.scm (python-fonttools): Update to 3.15.1. (source)[uri]: Use 'pypi-uri'. (native-inputs): Add unzip. Signed-off-by: Christopher Baines --- gnu/packages/python.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 44504e3833..1b62668904 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -7421,15 +7421,13 @@ add functionality and customization to your projects with their own plugins.") (define-public python-fonttools (package (name "python-fonttools") - (version "2.5") + (version "3.15.1") (source (origin (method url-fetch) - (uri (string-append - "https://pypi.python.org/packages/source/F/FontTools/" - "fonttools-" version ".tar.gz")) + (uri (pypi-uri "fonttools" version ".zip")) (sha256 (base32 - "08ay3x4ijarwhl60gqx2i9jzq6pxs20p4snc2d1q5jagh4rn39lb")))) + "1hhj97izwliy0vybmza72d90l5d4mcn50y8akq7kyccfl82vdx4d")))) (build-system python-build-system) (arguments '(#:test-target "check" @@ -7443,6 +7441,8 @@ add functionality and customization to your projects with their own plugins.") (substitute* "setup.py" (("^[ \t]*extra_path *= *'FontTools',") "")) #t))))) + (native-inputs + `(("unzip" ,unzip))) (home-page "https://github.com/behdad/fonttools") (synopsis "Tools to manipulate font files") (description -- cgit v1.3 From b35936880d4823be3702bd4a7df9e9675446cca8 Mon Sep 17 00:00:00 2001 From: ng0 Date: Wed, 11 Oct 2017 10:38:46 +0000 Subject: gnu: Add python-pyqrcode. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/python.scm (python-pyqrcode): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/python.scm | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 1b62668904..1b1be11c68 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -23,7 +23,7 @@ ;;; Copyright © 2016 Daniel Pimentel ;;; Copyright © 2016 Sou Bunnbu ;;; Copyright © 2016, 2017 Troy Sankey -;;; Copyright © 2016, 2017 ng0 +;;; Copyright © 2016, 2017 ng0 ;;; Copyright © 2016 Dylan Jeffers ;;; Copyright © 2016 David Craven ;;; Copyright © 2016, 2017 Marius Bakke @@ -6613,6 +6613,26 @@ providing a clean and modern domain specific specification language (DSL) in Python style, together with a fast and comfortable execution environment.") (license license:expat))) +(define-public python-pyqrcode + (package + (name "python-pyqrcode") + (version "1.2.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "PyQRCode" version)) + (sha256 + (base32 + "1m9ln8k9v7dfbh1i81225hx5mdsh8mpf9g7r4wpbfmiyfcs7dgzx")))) + (build-system python-build-system) + (home-page + "https://github.com/mnooner256/pyqrcode") + (synopsis "QR code generator") + (description + "Pyqrcode is a QR code generator written purely in Python with +SVG, EPS, PNG and terminal output.") + (license license:bsd-3))) + (define-public python-seaborn (package (name "python-seaborn") -- cgit v1.3 From a1add5b7fb0fc56aa340fa97170ba1b56784f8f6 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 15 Oct 2017 09:32:21 +0300 Subject: gnu: python-cffi: Disable test that fails on aarch64. * gnu/packages/python.cm (python-cffi)[arguments]: Disable test that is known to fail on aarch64. --- gnu/packages/python.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 1b1be11c68..69802355ec 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -5180,6 +5180,13 @@ a front-end for C compilers or analysis tools.") (substitute* "testing/cffi0/test_ownlib.py" (("'cc testownlib") "'gcc testownlib")) (zero? (system* "py.test" "-v" "c/" "testing/")))) + (add-before 'check 'disable-failing-test + ;; This is assumed to be a libffi issue: + ;; https://bitbucket.org/cffi/cffi/issues/312/tests-failed-with-armv8 + (lambda _ + (substitute* "testing/cffi0/test_ownlib.py" + (("ret.left") "ownlib.left")) + #t)) (add-after 'install 'install-doc (lambda* (#:key outputs #:allow-other-keys) (let* ((data (string-append (assoc-ref outputs "doc") "/share")) -- cgit v1.3 From cca55d571cea4ee5c16d556ef52ddfa2d68ce80d Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 15 Oct 2017 09:32:54 +0300 Subject: gnu: python-cffi: Update to 1.11.2. * gnu/packages/python.scm (python-cffi): Update to 1.11.2. [home-page]: Use 'https'. --- gnu/packages/python.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 69802355ec..1cfd988f88 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -5137,13 +5137,13 @@ a front-end for C compilers or analysis tools.") (define-public python-cffi (package (name "python-cffi") - (version "1.10.0") + (version "1.11.2") (source (origin (method url-fetch) (uri (pypi-uri "cffi" version)) (sha256 - (base32 "1mffyilq4qycm8gs4wkgb18rnqil8a9blqq77chdlshzxc8jkc5k")))) + (base32 "19h0wwz9cww74gw8cyq0izj8zkhjyzjw2d3ks1c3f1y4q28xv1xb")))) (build-system python-build-system) (outputs '("out" "doc")) (inputs @@ -5198,7 +5198,7 @@ a front-end for C compilers or analysis tools.") (copy-recursively "build/html" html)) (copy-file "LICENSE" (string-append doc "/LICENSE")) #t)))))) - (home-page "http://cffi.readthedocs.org") + (home-page "https://cffi.readthedocs.org") (synopsis "Foreign function interface for Python") (description "Foreign Function Interface for Python calling C code.") -- cgit v1.3 From 0751fddd919d4cd7017500c155e5b24d4023d621 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 15 Oct 2017 10:34:12 +0300 Subject: gnu: python-cffi: Move to libffi.scm * gnu/packages/python.scm (python-cffi): Move from here ... * gnu/packages/libffi.scm: ... to here. * gnu/packages/crypto.scm, gnu/packages/password-utils.scm: Adjust module imports. --- gnu/packages/crypto.scm | 1 + gnu/packages/libffi.scm | 81 ++++++++++++++++++++++++++++++++++++++++- gnu/packages/password-utils.scm | 1 + gnu/packages/python.scm | 73 ------------------------------------- 4 files changed, 81 insertions(+), 75 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm index 8e3956a354..427318d455 100644 --- a/gnu/packages/crypto.scm +++ b/gnu/packages/crypto.scm @@ -35,6 +35,7 @@ #:use-module (gnu packages image) #:use-module (gnu packages pkg-config) #:use-module (gnu packages libbsd) + #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages nettle) #:use-module (gnu packages password-utils) diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index 16475affe6..cc7297a47d 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -1,6 +1,8 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; Copyright © 2016 Efraim Flashner +;;; Copyright © 2014 Federico Beffa +;;; Copyright © 2016, 2017 Efraim Flashner +;;; Copyright © 2017 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,7 +24,10 @@ #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) - #:use-module (guix build-system gnu)) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (guix build-system gnu) + #:use-module (guix build-system python)) (define-public libffi (let ((post-install-phase @@ -66,3 +71,75 @@ conversions for values passed between the two languages.") ;; See . (license expat)))) +(define-public python-cffi + (package + (name "python-cffi") + (version "1.11.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "cffi" version)) + (sha256 + (base32 "19h0wwz9cww74gw8cyq0izj8zkhjyzjw2d3ks1c3f1y4q28xv1xb")))) + (build-system python-build-system) + (outputs '("out" "doc")) + (inputs + `(("libffi" ,libffi))) + (propagated-inputs ; required at run-time + `(("python-pycparser" ,python-pycparser))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python-sphinx" ,python-sphinx) + ("python-pytest" ,python-pytest))) + (arguments + `(#:modules ((ice-9 ftw) + (srfi srfi-26) + (guix build utils) + (guix build python-build-system)) + #:phases + (modify-phases %standard-phases + (replace 'check + (lambda _ + (setenv "PYTHONPATH" + (string-append + (getenv "PYTHONPATH") + ":" (getcwd) "/build/" + (car (scandir "build" (cut string-prefix? "lib." <>))))) + + ;; XXX The "normal" approach of setting CC and friends does + ;; not work here. Is this the correct way of doing things? + (substitute* "testing/embedding/test_basic.py" + (("c = distutils\\.ccompiler\\.new_compiler\\(\\)") + (string-append "c = distutils.ccompiler.new_compiler();" + "c.set_executables(compiler='gcc'," + "compiler_so='gcc',linker_exe='gcc'," + "linker_so='gcc -shared')"))) + (substitute* "testing/cffi0/test_ownlib.py" + (("'cc testownlib") "'gcc testownlib")) + (zero? (system* "py.test" "-v" "c/" "testing/")))) + (add-before 'check 'disable-failing-test + ;; This is assumed to be a libffi issue: + ;; https://bitbucket.org/cffi/cffi/issues/312/tests-failed-with-armv8 + (lambda _ + (substitute* "testing/cffi0/test_ownlib.py" + (("ret.left") "ownlib.left")) + #t)) + (add-after 'install 'install-doc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((data (string-append (assoc-ref outputs "doc") "/share")) + (doc (string-append data "/doc/" ,name "-" ,version)) + (html (string-append doc "/html"))) + (with-directory-excursion "doc" + (system* "make" "html") + (mkdir-p html) + (copy-recursively "build/html" html)) + (copy-file "LICENSE" (string-append doc "/LICENSE")) + #t)))))) + (home-page "https://cffi.readthedocs.org") + (synopsis "Foreign function interface for Python") + (description + "Foreign Function Interface for Python calling C code.") + (license expat))) + +(define-public python2-cffi + (package-with-python2 python-cffi)) diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm index 52689a71d5..df6103f6a1 100644 --- a/gnu/packages/password-utils.scm +++ b/gnu/packages/password-utils.scm @@ -46,6 +46,7 @@ #:use-module (gnu packages gtk) #:use-module (gnu packages guile) #:use-module (gnu packages kerberos) + #:use-module (gnu packages libffi) #:use-module (gnu packages linux) #:use-module (gnu packages man) #:use-module (gnu packages multiprecision) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 1cfd988f88..cab910be7d 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -5134,79 +5134,6 @@ a front-end for C compilers or analysis tools.") (define-public python2-pycparser (package-with-python2 python-pycparser)) -(define-public python-cffi - (package - (name "python-cffi") - (version "1.11.2") - (source - (origin - (method url-fetch) - (uri (pypi-uri "cffi" version)) - (sha256 - (base32 "19h0wwz9cww74gw8cyq0izj8zkhjyzjw2d3ks1c3f1y4q28xv1xb")))) - (build-system python-build-system) - (outputs '("out" "doc")) - (inputs - `(("libffi" ,libffi))) - (propagated-inputs ; required at run-time - `(("python-pycparser" ,python-pycparser))) - (native-inputs - `(("pkg-config" ,pkg-config) - ("python-sphinx" ,python-sphinx) - ("python-pytest" ,python-pytest))) - (arguments - `(#:modules ((ice-9 ftw) - (srfi srfi-26) - (guix build utils) - (guix build python-build-system)) - #:phases - (modify-phases %standard-phases - (replace 'check - (lambda _ - (setenv "PYTHONPATH" - (string-append - (getenv "PYTHONPATH") - ":" (getcwd) "/build/" - (car (scandir "build" (cut string-prefix? "lib." <>))))) - - ;; XXX The "normal" approach of setting CC and friends does - ;; not work here. Is this the correct way of doing things? - (substitute* "testing/embedding/test_basic.py" - (("c = distutils\\.ccompiler\\.new_compiler\\(\\)") - (string-append "c = distutils.ccompiler.new_compiler();" - "c.set_executables(compiler='gcc'," - "compiler_so='gcc',linker_exe='gcc'," - "linker_so='gcc -shared')"))) - (substitute* "testing/cffi0/test_ownlib.py" - (("'cc testownlib") "'gcc testownlib")) - (zero? (system* "py.test" "-v" "c/" "testing/")))) - (add-before 'check 'disable-failing-test - ;; This is assumed to be a libffi issue: - ;; https://bitbucket.org/cffi/cffi/issues/312/tests-failed-with-armv8 - (lambda _ - (substitute* "testing/cffi0/test_ownlib.py" - (("ret.left") "ownlib.left")) - #t)) - (add-after 'install 'install-doc - (lambda* (#:key outputs #:allow-other-keys) - (let* ((data (string-append (assoc-ref outputs "doc") "/share")) - (doc (string-append data "/doc/" ,name "-" ,version)) - (html (string-append doc "/html"))) - (with-directory-excursion "doc" - (system* "make" "html") - (mkdir-p html) - (copy-recursively "build/html" html)) - (copy-file "LICENSE" (string-append doc "/LICENSE")) - #t)))))) - (home-page "https://cffi.readthedocs.org") - (synopsis "Foreign function interface for Python") - (description - "Foreign Function Interface for Python calling C code.") - (license license:expat))) - -(define-public python2-cffi - (package-with-python2 python-cffi)) - (define-public python-xcffib (package (name "python-xcffib") -- cgit v1.3