RSS blog page - 1/5 ==> Blog sphinx (12)

blog page - 1/5

Slow imports and code to investigate


I notice that the following code was very slow:


nbconvert, tornado, incompatibilities


tornado was recently released in version 6.0. It introduced an incompabilities with all existing versions of nbconvert (<= 0.4.1).


Missing signature for functions


The signature of a function is not always available in Python. The buildin functions do not follow the same pattern as functions written in Python but they provide a backup plan with the attribute __text_signature__:


Upload a single binary on PyPI


The packages for multiple distribution are built on different machine but the upload takes place on a single machine. I retrieved all available builds and moved them to the dist folder. The file .pypirc was saved into my home with the following content:


Check RST syntax


It is usually a pain to discover I made an error in a formula while I’m writing documentation. It fails quite long after after the unit tests started. The documentation is generated after the unit test pass. I also use a lot .. runpython:: (see RunPythonDirective) to run pieces of code inside the documentation. It is quite annoying to discover it fails long after. So I creates a unit test which can be used to compile a single page of the documentation : test_doc_page. I modify the page name when I have some doubt or I move to another one.


Long names on Windows


One of my unit test was failing due to a weird error in sphinx-gallery. The module could not write a file on Windows because its name was longer than 260 which still seems to be a limit of the system.


pip 9.0.2 and issue with pip._vendor.urllib3.contrib


pip was recently updated and the new version produces a weird error:


Replace pdflatex by xelatex


pdflatex does not natively support utf-8 (no fixed size characters) but xelatex does (see Swapping from pdfLaTeX to XeLaTex). I tried a couple of past in the past with no success and I finally remove all accents from pdf coming from notebooks. It seems to work now.


Turn warnings into errors


The following code turns warnings into errors. Useful to find the source of a warning.


Issue in ZipFile on Windows


Issue 6839 happens when a zip file is created on Windows. The created zip may contain full path with \\ when the file list only contains /. This raises exception BadZipFile with the following message: File name in directory … and header … differ due to a mismatch between backslashes. Another consequence found on GitHub: zipfile raises: File name in directory X and header Y differ.. The class WinZipFile owerwrites method to fix the line which checks that names are consistent in the file list and in the compressed content.


RSS blog page - 1/5 ==> 2018-03 (3) 2018-04 (1) 2018-05 (1) 2018-08 (1) 2019-03 (2)