Thursday, August 16, 2018

About pushing too quickly to master

Oops, yesterday evening Hamza reported a test failure caused by my changes. I quickly answered “These failures are my mistake. I also had them yesterday and fixed them and pushed the fix. So I was just too quick with pushing my changes to github.” Now I ran the test suite again on my machine and saw that there was yet another failure, caused by the fact that I changed the verbose_name of one field from “Sales Base account” to “Sales account”. Such failures are trivial to fix for me because I caused them, but they are not trivial to Hamza.

Switching from Ubuntu Desktop to xfce

I tried to switch from Ubuntu Desktop to xfce. Looks sympathic, but ssh-agent doesn’t seem to work. For every inv pd I am getting asked again and again:

Enter passphrase for key '/home/luc/.ssh/id_rsa':

I just want it to work as it does in Ubuntu Desktop: pop up a window when some program needs my passphrase for the first time.

This thread explains how they did a similar solution (asking the password after starting the session, which would be suboptimal for me, but maybe I would get used to it). made me try to install ssh-askpass:

$ sudo apt install ssh-askpass

But no change. I also read this and this, but I don’t understand them. Yes, there are different programs to do this, and it seems not trivial to configure them. I don’t understand why this is such a problem. I don’t want to dive that deep into this, at least not right now. I switch back to Ubuntu Desktop where it works out of the box.

Manually entering invoices - optimizations

I had another phone meeting with Vera. She is really doing a hard and frustrating job: she must continue what had been done during 20 years by Lydia who had to stop for health reasons. Both she and me knew in advance that it would be hard. But yesterday morning she told me for the first time that she had had some moments of happiness with Lino.

After the phone meeting I opened #2490. Since Vera is entering purchase invoices which are half a year old, she didn’t want Lino to suggest dd.today() as the entry date for each new invoice. Also for suppliers having an empty purchase_account Lino was suggesting the rather arbitrary account I chose as the base_account for purchases.

I added the notion of “Waiting account”: a new choice waiting in lino_xl.lib.ledger.CommonAccounts and changed lino_xl.lib.vat.VatDocument so that it uses this as the default account (instead of the TradeType’s main_account).

As for the entry date I used the recently discovered approach of using a new database model lino_xl.lib.ledger.LedgerInfo with a OneToOneField (similar to lino_xl.lib.invoicing.SalesRule, see Thursday, July 12, 2018). Before that date I would have used dd.inject_field in such a case.

En passant I fixed another stupid bug that would cause frustration once Vera would discover it: after having registered an invoice, the insert button was disabled as long as you were in detail view. You had to close the detail view to re-enable the button. The ShowInsert action has now readonly = True because otherwise it was disabled when the current row was a registered document.

Making Lino installable using pip

Hamza, please note that noi, xl, avanti and voga have currently version “18.04.” which causes a UserWarning “Normalizing ‘18.04.0’ to ‘18.4.0’”. The version should be without a leading 0. And it should be set to 18.8.0 for all projects soon (before doing the first official PyPI release).

Lino Tera continued

I had a meeting with Daniel, Harry and Gregor about the therapeutic functions in Lino Tera. Here is my new task list.

I closed the release notes for 18.8.0 (2018-08-16) and started a new page Lino Tera die Nächste.

Making Lino installable using pip

Hamza and I did research for the release process.

We would like to separate our private temporary package repository from the book because e.g. if Hamza works on the deployment and I change documentation and publish them, the LF site would serve my version of the dl files instead of his version.

One idea was to use twine directly on test.pypi. Twine has an option --skip-existing which should make it possible to overwrite our packages without changing the version (an important feature since there are quite some issues which appear only when installing apypi version of Lino). But test.pypi.org unfortunately doesn’t support this option.

At this point our internet connection broke. But I continued because the solution was so close: using pypiserver I got it to work.

I updated Simulating a release on PyPI and Installing Lino.

There is still at least one problem (obviously not detected by the test suite): runserver starts but does not find the static files. So there is only a white screen. Hamza, I leave this for you. See in lino.core.urls where it adds a pattern to MEDIA_ROOT. And see how the MEDIA_ROOT setting is set as a child of lino.core.site.Site.cache_dir in lino.core.site.