:orphan: |rss_image| :ref:`<== ` **blog page - 2/6** :ref:`==> ` :ref:`Blog ` :ref:`notebook (8) ` :ref:`sphinx (13) ` .. |rss_image| image:: feed-icon-16x16.png :target: ../_downloads/rss.xml :alt: RSS ---- .. _ap-main-1: blog page - 2/6 +++++++++++++++ .. blogpostagg:: :title: Missing signature for functions :date: 2018-08-03 :keywords: signature,inspect :categories: python :rawfile: 2018/2018-08-03_signature.rst The signature of a function is not always available in :epkg:`Python`. The buildin functions do not follow the same pattern as functions written in :epkg:`Python` but they provide a backup plan with the attribute ``__text_signature__``: ... .. blogpostagg:: :title: Upload a single binary on PyPI :date: 2018-05-21 :keywords: PyPI,upload :categories: build :rawfile: 2018/2018-05-21_uploadbinaries.rst 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: ... .. blogpostagg:: :title: Check RST syntax :date: 2018-04-21 :keywords: sphinx,RST :categories: sphinx :rawfile: 2018/2018-04-21_compile_rst.rst 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 :class:`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. .. blogpostagg:: :title: Long names on Windows :date: 2018-03-26 :keywords: sphinx,gallery :categories: sphinx :rawfile: 2018/2018-03-26_gallery.rst One of my unit test was failing due to a weird error in :epkg:`sphinx-gallery`. The module could not write a file on :epkg:`Windows` because its name was longer than 260 which still seems to be a limit of the system. ... .. blogpostagg:: :title: pip 9.0.2 and issue with pip._vendor.urllib3.contrib :date: 2018-03-19 :keywords: pip,9.0.2 :categories: modules :rawfile: 2018/2018-03-19_pip902.rst :epkg:`pip` was recently updated and the new version produces a weird error: ... .. blogpostagg:: :title: Replace pdflatex by xelatex :date: 2018-03-03 :keywords: latex,pdflatex,xelatex :categories: latex :rawfile: 2018/2018-03-03_xelatex.rst `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. .. blogpostagg:: :title: Turn warnings into errors :date: 2017-09-23 :keywords: python,warnings :categories: warnings :rawfile: 2017/2017-09_23_warnings.rst The following code turns warnings into errors. Useful to find the source of a warning. ... .. blogpostagg:: :title: Issue in ZipFile on Windows :date: 2017-09-14 :keywords: python,zipfile :categories: issue :rawfile: 2017/2017-09_14_zipfile.rst 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 :class:`WinZipFile ` owerwrites method :epkg:`*py:zipfile:ZipFile:open` to fix the line which checks that names are consistent in the file list and in the compressed content. .. blogpostagg:: :title: Issues with sphinx-gallery :date: 2017-08-25 :keywords: documentation,sphinx,sphinx-gallery :categories: documentation :rawfile: 2017/2017-08-25_sphinxgallery.rst Taking another dependency always means a potential conflicts between version. Is it fact enough updated when it breaks? I realized I was not the only to face an issue with `sphinx-gallery `_. There is a discussion about it on `scikit-learn/9189 `_ and the package is now included in the `sources `_. It is not really bothering for a small package like this. But still, it is extra work. I realize open source holds on some kind of magic sometimes. Some are fun but keeping them alive takes some energy. .. blogpostagg:: :title: Pandoc on ubuntu and WSL :date: 2017-08-20 :keywords: documentation,sphinx,pandoc :categories: documentation :rawfile: 2017/2017-08-20_pandoc.rst I was using the `Windows Subsystem for Linux `_ to test a module with Linux. I could not make it work due to an old version of :epkg:`pandoc`. Surprisingly, the default ``apt-get install pandoc`` installed a very old version (1.12). I could not convert any notebook with `nbconvert `_ into latex. I finally installed the latest version (1.19) and it worked perfectly. You can see the installation step in file `.circleci/config.yml `_. That was not the last issue because *pandoc* seems to be very slow on WSL. About that, you can read: `massive delay to call pandoc using the Windows Subsystem for Linux (WSL) or Bash for Windows `_, `stack ghc painfully slow `_. ---- |rss_image| :ref:`<== ` **blog page - 2/6** :ref:`==> ` :ref:`2020-08 (2) ` :ref:`2020-09 (1) ` :ref:`2021-01 (1) ` :ref:`2022-03 (1) ` :ref:`2023-05 (1) `