;;; Copyright © 2018, 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
+;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
;;;
;;; This file is part of GNU Guix.
;;;
(define-module (gnu packages python)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
+ #:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages compression)
#:use-module (gnu packages dbm)
"--with-system-ffi" ;build ctypes
"--with-ensurepip=install" ;install pip and setuptools
"--enable-unicode=ucs4"
+
+ ;; Prevent the installed _sysconfigdata.py from retaining a reference
+ ;; to coreutils.
+ "INSTALL=install -c"
+ "MKDIR_P=mkdir -p"
+
(string-append "LDFLAGS=-Wl,-rpath="
(assoc-ref %outputs "out") "/lib"))
;; With no -j argument tests use all available cpus, so provide one.
(define-public python-3.7
(package (inherit python-2)
(name "python")
- (version "3.7.3")
+ (version "3.7.4")
(source (origin
(method url-fetch)
(uri (string-append "https://www.python.org/ftp/python/"
"python-3-search-paths.patch"))
(sha256
(base32
- "066ka8csjwkycqpgyv424d8hhqhfd7r6svsp4sfcvkylci0baq6s"))
+ "0gxiv5617zd7dnqm5k9r4q2188lk327nf9jznwq9j6b8p0s92ygv"))
(modules '((guix build utils)))
(snippet
'(begin
(substitute* "Modules/Setup.dist"
;; Link Expat instead of embedding the bundled one.
(("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n"))
-
- (for-each delete-file
- '(;; This test may hang and eventually run out of
- ;; memory on some systems:
- ;; <https://bugs.python.org/issue34587>
- "Lib/test/test_socket.py"
-
- ;; Delete test that fails on low-memory systems.
- "Lib/test/test_mmap.py"
-
- ;; These tests fail on AArch64.
- "Lib/ctypes/test/test_win32.py"
- "Lib/test/test_fcntl.py"
- "Lib/test/test_posix.py"))
#t))))
(arguments
(substitute-keyword-arguments (package-arguments python-2)
((#:make-flags _)
`(list (string-append
(format #f "TESTOPTS=-j~d" (parallel-job-count))
- ;; Exclude the following test, which fails as of 3.7.3 (see:
- ;; https://bugs.python.org/issue35998).
- " --exclude test_asyncio")))
+ ;; test_mmap fails on low-memory systems.
+ " --exclude test_mmap"
+ ;; test_socket may hang and eventually run out of memory
+ ;; on some systems: <https://bugs.python.org/issue34587>.
+ " test_socket"
+ ;; XXX: test_ctypes fails on some platforms due to a problem in
+ ;; libffi 3.2.1: <https://bugs.python.org/issue23249>.
+ ,@(if (string-prefix? "aarch64" (%current-system))
+ '(" test_ctypes")
+ '()))))
((#:phases phases)
`(modify-phases ,phases
+ (add-before 'check 'set-TZDIR
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; test_email requires the Olson time zone database.
+ (setenv "TZDIR"
+ (string-append (assoc-ref inputs "tzdata")
+ "/share/zoneinfo"))
+ #t))
;; Unset SOURCE_DATE_EPOCH while running the test-suite and set it
;; again afterwards. See <https://bugs.python.org/issue34022>.
(add-before 'check 'unset-SOURCE_DATE_EPOCH
(find-files out "\\.py$")))
(list '() '("-O") '("-OO")))
#t)))))))
+ (native-inputs
+ `(("tzdata" ,tzdata-for-tests)
+ ,@(package-native-inputs python-2)))
(native-search-paths
(list (search-path-specification
(variable "PYTHONPATH")
(version-major+minor version)
"/site-packages"))))))))
+(define-public python-3.8
+ (package
+ (inherit python-3.7)
+ (name "python-next")
+ (version "3.8.0")
+ (source
+ (origin
+ (inherit (package-source python-3.7))
+ (uri (string-append "https://www.python.org/ftp/python/"
+ version "/Python-" version ".tar.xz"))
+ (sha256 (base32 "110d0did9rxn7rg85kf2fwli5hqq44xv2d8bi7d92m7v2d728mmk"))
+ (patches (search-patches
+ "python-3.8-search-paths.patch"
+ "python-3-fix-tests.patch"
+ "python-3.8-fix-tests.patch"
+ "python-3-deterministic-build-info.patch"))
+ (snippet
+ '(begin
+ ;; Delete the bundled copy of libexpat.
+ (delete-file-recursively "Modules/expat")
+ (substitute* "Modules/Setup"
+ ;; Link Expat instead of embedding the bundled one.
+ (("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n"))
+ #t))))))
+
;; Current 3.x version.
(define-public python-3 python-3.7)
(define-public micropython
(package
(name "micropython")
- (version "1.10")
+ (version "1.11")
(source
(origin
(method url-fetch)
"/micropython-" version ".tar.gz"))
(sha256
(base32
- "1g1zjip3rkx6bp16qi1bag72wivnbh56fcsl3nffanrx4j5f4z90"))
+ "0px3xhw16rl0l7qifq7jw1gq92wzlnhd17dmszv9m2c3wbzs9p9f"))
(modules '((guix build utils)))
(snippet
'(begin
(arguments
`(#:phases
(modify-phases %standard-phases
- (add-before 'build 'preprare-build
+ (add-before 'build 'prepare-build
(lambda _
(chdir "ports/unix")
;; see: https://github.com/micropython/micropython/pull/4246