mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: python-ipython-documentation: Also build info and pdf targets.
* gnu/packages/patches/python-ipython-documentation-chars.patch: New file. * gnu/packages/patches/python-ipython-documentation-repro.patch: Likewise. * gnu/local.mk: Register them. * gnu/packages/python-xyz.scm (python-ipython-documentation) [source]: Apply patches. [arguments]: Use gexps. [phases]{sanitize-sources}: New phase. {configure-sphinx-for-xelatex}: Likewise. {install}: Streamline. Also build and install the PDF and info manual. Enable parallel processing. [inputs]: Delete field. [propagated-inputs]: Remove texlive-updmap.cfg input. Add fontconfig, font-gnu-freefont, graphviz, python-docrepr, texlive-polyglossia, texlive-bin and texlive-xindy.
This commit is contained in:
parent
5fdae311a0
commit
2576d9ffc4
4 changed files with 117 additions and 71 deletions
|
@ -1686,6 +1686,8 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/python-execnet-read-only-fix.patch \
|
%D%/packages/patches/python-execnet-read-only-fix.patch \
|
||||||
%D%/packages/patches/python-fixtures-remove-monkeypatch-test.patch \
|
%D%/packages/patches/python-fixtures-remove-monkeypatch-test.patch \
|
||||||
%D%/packages/patches/python-flask-restful-werkzeug-compat.patch \
|
%D%/packages/patches/python-flask-restful-werkzeug-compat.patch \
|
||||||
|
%D%/packages/patches/python-ipython-documentation-chars.patch \
|
||||||
|
%D%/packages/patches/python-ipython-documentation-repro.patch \
|
||||||
%D%/packages/patches/python-keras-integration-test.patch \
|
%D%/packages/patches/python-keras-integration-test.patch \
|
||||||
%D%/packages/patches/python-pdoc3-tests.patch \
|
%D%/packages/patches/python-pdoc3-tests.patch \
|
||||||
%D%/packages/patches/python-peachpy-determinism.patch \
|
%D%/packages/patches/python-peachpy-determinism.patch \
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
Avoid LaTeX errors due to non-printable characters.
|
||||||
|
Submitted upstream: https://github.com/ipython/ipython/pull/13640
|
||||||
|
|
||||||
|
diff --git a/IPython/utils/coloransi.py b/IPython/utils/coloransi.py
|
||||||
|
index e33142180..9300b0108 100644
|
||||||
|
--- a/IPython/utils/coloransi.py
|
||||||
|
+++ b/IPython/utils/coloransi.py
|
||||||
|
@@ -74,8 +74,8 @@ class TermColors:
|
||||||
|
class InputTermColors:
|
||||||
|
"""Color escape sequences for input prompts.
|
||||||
|
|
||||||
|
- This class is similar to TermColors, but the escapes are wrapped in \001
|
||||||
|
- and \002 so that readline can properly know the length of each line and
|
||||||
|
+ This class is similar to TermColors, but the escapes are wrapped in \\001
|
||||||
|
+ and \\002 so that readline can properly know the length of each line and
|
||||||
|
can wrap lines accordingly. Use this class for any colored text which
|
||||||
|
needs to be used in input prompts, such as in calls to raw_input().
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
Fix non-reproducibilities caused by time-dependent procedures.
|
||||||
|
Submitted upstream: https://github.com/ipython/ipython/pull/13640
|
||||||
|
|
||||||
|
diff --git a/IPython/sphinxext/ipython_directive.py b/IPython/sphinxext/ipython_directive.py
|
||||||
|
index 18bdfcae9..2c665ac87 100644
|
||||||
|
--- a/IPython/sphinxext/ipython_directive.py
|
||||||
|
+++ b/IPython/sphinxext/ipython_directive.py
|
||||||
|
@@ -19,7 +19,7 @@
|
||||||
|
In [1]: 1+1
|
||||||
|
|
||||||
|
In [1]: import datetime
|
||||||
|
- ...: datetime.datetime.now()
|
||||||
|
+ ...: datetime.date.fromisoformat('2022-02-22')
|
||||||
|
|
||||||
|
It supports IPython construct that plain
|
||||||
|
Python does not understand (like magics):
|
||||||
|
@@ -28,7 +28,7 @@
|
||||||
|
|
||||||
|
In [0]: import time
|
||||||
|
|
||||||
|
- In [0]: %timeit time.sleep(0.05)
|
||||||
|
+ In [0]: %pdoc time
|
||||||
|
|
||||||
|
This will also support top-level async when using IPython 7.0+
|
||||||
|
|
|
@ -155,9 +155,11 @@
|
||||||
#:use-module (gnu packages django)
|
#:use-module (gnu packages django)
|
||||||
#:use-module (gnu packages djvu)
|
#:use-module (gnu packages djvu)
|
||||||
#:use-module (gnu packages docker)
|
#:use-module (gnu packages docker)
|
||||||
|
#:use-module (gnu packages documentation)
|
||||||
#:use-module (gnu packages enchant)
|
#:use-module (gnu packages enchant)
|
||||||
#:use-module (gnu packages file)
|
#:use-module (gnu packages file)
|
||||||
#:use-module (gnu packages fontutils)
|
#:use-module (gnu packages fontutils)
|
||||||
|
#:use-module (gnu packages fonts)
|
||||||
#:use-module (gnu packages freedesktop)
|
#:use-module (gnu packages freedesktop)
|
||||||
#:use-module (gnu packages gdb)
|
#:use-module (gnu packages gdb)
|
||||||
#:use-module (gnu packages gcc)
|
#:use-module (gnu packages gcc)
|
||||||
|
@ -9389,79 +9391,78 @@ computing.")
|
||||||
(inherit python-ipython)
|
(inherit python-ipython)
|
||||||
(name "python-ipython-documentation")
|
(name "python-ipython-documentation")
|
||||||
(version (package-version python-ipython))
|
(version (package-version python-ipython))
|
||||||
|
(source
|
||||||
|
(origin
|
||||||
|
(inherit (package-source python-ipython))
|
||||||
|
(patches (append (search-patches
|
||||||
|
"python-ipython-documentation-chars.patch"
|
||||||
|
"python-ipython-documentation-repro.patch")
|
||||||
|
(origin-patches (package-source python-ipython))))))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:phases
|
(list
|
||||||
(modify-phases %standard-phases
|
#:phases
|
||||||
|
#~(modify-phases %standard-phases
|
||||||
|
(add-after 'unpack 'set-pythonpath
|
||||||
|
(lambda _
|
||||||
|
;; Ensure this fixed (via the
|
||||||
|
;; "python-ipython-documentation-chars.patch" patch) copy of
|
||||||
|
;; IPython gets used.
|
||||||
|
(setenv "PYTHONPATH" (string-append (getcwd)))))
|
||||||
|
(add-before 'build 'configure-sphinx-for-xelatex
|
||||||
|
(lambda _
|
||||||
|
;; Use XeLaTeX instead of PDFLaTeX, as it can
|
||||||
|
;; cope with the Unicode characters present in the
|
||||||
|
;; contributors page, for example.
|
||||||
|
(substitute* "docs/source/conf.py"
|
||||||
|
(("project = 'IPython'.*" all)
|
||||||
|
(string-append all "latex_engine = 'xelatex'\n")))
|
||||||
|
;; XXX: The Sphinx-generated ipython.tex specifies the GNU
|
||||||
|
;; FreeFont font to be searched via its extension, which uses
|
||||||
|
;; kpathsea instead of fontconfig and fail (see:
|
||||||
|
;; https://github.com/sphinx-doc/sphinx/issues/10347). Create a
|
||||||
|
;; symlink to GNU FreeFont and add it to the TEXMF tree via
|
||||||
|
;; GUIX_TEXMF.
|
||||||
|
(mkdir-p "texmf-dist/fonts/opentype/public")
|
||||||
|
(symlink (string-append
|
||||||
|
#$(this-package-native-input "font-gnu-freefont")
|
||||||
|
"/share/fonts/opentype")
|
||||||
|
(string-append
|
||||||
|
(getcwd) "/"
|
||||||
|
"texmf-dist/fonts/opentype/public/gnu-freefont"))
|
||||||
|
(setenv "GUIX_TEXMF" (string-append (getenv "GUIX_TEXMF") ":"
|
||||||
|
(getcwd) "/texmf-dist"))))
|
||||||
(delete 'build)
|
(delete 'build)
|
||||||
(delete 'check)
|
(delete 'check)
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(let* ((data (string-append (assoc-ref outputs "out") "/share"))
|
(let* ((data (string-append #$output "/share"))
|
||||||
(doc (string-append data "/doc/" ,name "-" ,version))
|
(doc (string-append data "/doc/" #$name "-" #$version))
|
||||||
(html (string-append doc "/html"))
|
(html (string-append doc "/html"))
|
||||||
(man1 (string-append data "/man/man1"))
|
(info (string-append data "/info")))
|
||||||
(info (string-append data "/info"))
|
(invoke "make" "-C" "docs" "info" "html" "pdf"
|
||||||
(examples (string-append doc "/examples"))
|
(string-append "SPHINXOPTS=-j"
|
||||||
(python-arg (string-append "PYTHON=" (which "python"))))
|
(number->string (parallel-job-count))))
|
||||||
(setenv "LANG" "en_US.utf8")
|
(install-file "COPYING.rst" doc)
|
||||||
(with-directory-excursion "docs"
|
(copy-recursively "examples" (string-append doc "/examples"))
|
||||||
;; FIXME: pdf fails to build
|
;; Install HTML documentation.
|
||||||
;;(system* "make" "pdf" "PAPER=a4")
|
|
||||||
(system* "make" python-arg "html")
|
|
||||||
;; FIXME: the generated texi file contains ^@^@, which trips
|
|
||||||
;; up the parser.
|
|
||||||
;; (system* "make" python-arg "info")
|
|
||||||
)
|
|
||||||
(copy-recursively "docs/man" man1)
|
|
||||||
(copy-recursively "examples" examples)
|
|
||||||
(copy-recursively "docs/build/html" html)
|
(copy-recursively "docs/build/html" html)
|
||||||
;; (copy-file "docs/build/latex/ipython.pdf"
|
;; Likewise for the PDF.
|
||||||
;; (string-append doc "/ipython.pdf"))
|
(install-file "docs/build/latex/ipython.pdf" doc)
|
||||||
(mkdir-p info)
|
;; Likewise for the info manual.
|
||||||
;; (copy-file "docs/build/texinfo/ipython.info"
|
(install-file "docs/build/texinfo/ipython.info" info)
|
||||||
;; (string-append info "/ipython.info"))
|
(symlink (string-append html "/_images")
|
||||||
(copy-file "COPYING.rst" (string-append doc "/COPYING.rst"))))))))
|
(string-append info "/ipython-figures"))))))))
|
||||||
(inputs
|
|
||||||
(list python-ipython python-ipykernel))
|
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("python-sphinx" ,python-sphinx)
|
(list fontconfig ;for XDG_DATA_DIRS to locate fonts
|
||||||
("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
|
font-gnu-freefont
|
||||||
;; FIXME: It's possible that a smaller updmap.cfg would work just as
|
graphviz
|
||||||
;; well.
|
python-docrepr
|
||||||
("texlive" ,(texlive-updmap.cfg (list texlive-amsfonts
|
python-sphinx
|
||||||
texlive-capt-of
|
python-sphinx-rtd-theme
|
||||||
texlive-fonts-ec
|
texinfo
|
||||||
texlive-generic-iftex
|
texlive-bin
|
||||||
texlive-pdftex
|
texlive-polyglossia
|
||||||
texlive-latex-cmap
|
texlive-xindy))))
|
||||||
texlive-latex-environ
|
|
||||||
texlive-latex-eqparbox
|
|
||||||
texlive-etoolbox
|
|
||||||
texlive-latex-expdlist
|
|
||||||
texlive-latex-fancyhdr
|
|
||||||
texlive-latex-fancyvrb
|
|
||||||
texlive-latex-fncychap
|
|
||||||
texlive-latex-float
|
|
||||||
texlive-latex-framed
|
|
||||||
texlive-latex-geometry
|
|
||||||
texlive-latex-graphics
|
|
||||||
texlive-hyperref
|
|
||||||
texlive-latex-mdwtools
|
|
||||||
texlive-latex-multirow
|
|
||||||
texlive-latex-needspace
|
|
||||||
texlive-oberdiek
|
|
||||||
texlive-latex-parskip
|
|
||||||
texlive-latex-preview
|
|
||||||
texlive-latex-tabulary
|
|
||||||
texlive-latex-threeparttable
|
|
||||||
texlive-latex-titlesec
|
|
||||||
texlive-latex-trimspaces
|
|
||||||
texlive-latex-ucs
|
|
||||||
texlive-latex-upquote
|
|
||||||
texlive-url
|
|
||||||
texlive-latex-varwidth
|
|
||||||
texlive-wrapfig)))
|
|
||||||
("texinfo" ,texinfo)))))
|
|
||||||
|
|
||||||
(define-public python-urwid
|
(define-public python-urwid
|
||||||
(package
|
(package
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue