Thursday, September 19, 2019

Miscellaneous

I subtle change in the Lino core in order to optimize testing: lino.utils.diag.Analyzer.show_window_fields() no longer shows dummy fields. Because it was irritating to see the lino_xl.lib.cv.LanguageKnowledge.entry_date field appear in the doctests for Lino Welfare where they don’t want to have this field.

Version mismatch: this is the ‘cffi’ package version 1.12.3

Back to work on #3095, continued after Wednesday, September 18, 2019 where I stopped here:

[Wed Sep 18 15:37:21.750588 2019] [wsgi:error] [pid 3357:tid 140319710512896]
Exception: Version mismatch: this is the 'cffi'
package version 1.12.3, located in
'/usr/local/lino/lino_local/prod/env/lib/python3.7/site-packages/cffi/api.py'.
When we import the top-level '_cffi_backend' extension module, we get version
1.12.2, located in
'/usr/lib/python3/dist-packages/_cffi_backend.cpython-37m-x86_64-linux-gnu.so'.
The two versions should be equal; check your installation.

Looks as if the cffi in the site’s environment is finding the cffi of the server-wide environment.

But the server-wide Python does not seem to have cffi installed:

# python3
Python 3.7.3 (default, Apr  3 2019, 05:39:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cffi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cffi'
>>>

Why then does it have a file _cffi_backend.cpython-37m-x86_64-linux-gnu.so?

Why do I have that cffi package installed at all? What does it do? Which module requires it?

What is the difference between /usr/lib/python3/dist-packages and /usr/local/lib/python3/dist-packages?

Ouch, I just read here that “(note: do not use sudo pip, which can cause problems).” That’s what I currently instruct to do in Setting up a Lino contributor environment.

And also: /usr/lib is for modules installed by the system with the package manager (e.g. with sudo apt-get python-numpy) while /usr/local/lib is for modules that you installed yourself system-wide (e.g. with sudo pip install numpy

After reading this, I tried to install python3-cffi as a system package:

$ sudo apt-get install python3-cffi
...
The following NEW packages will be installed:
  python3-cffi python3-ply python3-pycparser
...

And whoops, the problem is gone! But don’t ask me why…

TODO: review Installing getlino to not use “sudo pip3”, e.g. by always using a shared env which contains at least getlino.

Install eidreader handler on tups

I needed to install a custom url handler for beid:// links, so I used the documentation about Installation and reviewed it en passant.

Run the migration script

I ran the migration script prod2preview for weleup because I had an operationdatabase error because LanguageKnowledge.use_certificate had not yet been created. Nothing special.

Amici removes participants of my meeting

I started working on #3210 (Amici removes participants of my meeting). Continued Friday, September 20, 2019.