Monday, February 2, 2015

Getting Lino to build on Travis CI

Continued from yesterday. Next idea: it is because fab initdb uses the uninstalled Lino version while fab test uses the installed one.

So once again I change the whole system of declaring demo projects. The parameter to atelier.fablib.add_demo_project() cannot be a path, it must be a Django settings module.

And atelier.fablib.run_in_demo_projects() must set the current working directory to the cache_dir, not the project_dir. One reason for this is that Django’s loaddata command also looks for fixtures in the current directory. Which IMO is a bit odd. But we cannot change it. This was, BTW the explanation for a traceback “Cannot import beyond top-level” caused by the from ..settings import * statements used by many settings files. Yes, Lino uses two kinds of files: fixtures and settings. That’s a name clash which causes almost no problems.

After a Commit and push, Travis still failed because it needs the newest version of Atelier. Released Atelier 0.0.12 and commited again. It then still failed because pisa doesn’t seem to get (correctly) installed before the test suite runs. Changed the import statement in lino.mixins.printable so that the ImportError becomes visible. Excerpt from the build:

[localhost] local: python -q test
zip_safe flag not set; analyzing archive contents...
ho.__init__: module references __path__
ho.__init__: module references __path__
sx.__init__: module references __path__
sx.__init__: module references __path__
Installed /home/travis/build/lsaffre/lino/pisa-3.0.33-py2.7.egg
Searching for reportlab==2.7
Installed /home/travis/build/lsaffre/lino/beautifulsoup4-4.3.2-py2.7.egg
running egg_info
creating lino.egg-info
writing requirements to lino.egg-info/requires.txt
writing lino.egg-info/PKG-INFO
writing top-level names to lino.egg-info/top_level.txt
writing dependency_links to lino.egg-info/dependency_links.txt
writing manifest file 'lino.egg-info/SOURCES.txt'
reading manifest file 'lino.egg-info/SOURCES.txt'
reading manifest template ''
writing manifest file 'lino.egg-info/SOURCES.txt'
running build_ext
...................python test --noinput --failfast ({'cwd': 'docs/tutorials/pisa'}) returned 1:
FAIL: test_files (lino.utils.test.DocTest)
Traceback (most recent call last):
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/lino/utils/", line 48, in test_files"Failed doctest %s" % f)
AssertionError: Failed doctest /home/travis/build/lsaffre/lino/docs/tutorials/pisa/index.rst
Ran 1 test in 0.049s
FAILED (failures=1)
Creating test database for alias 'default'...
File "/home/travis/build/lsaffre/lino/docs/tutorials/pisa/index.rst", line 67, in index.rst
Failed example:
rv =
Exception raised:
Traceback (most recent call last):
File "/opt/python/2.7.9/lib/python2.7/", line 1315, in __run
compileflags, 1) in test.globs
File "<doctest index.rst[12]>", line 1, in <module>
rv =
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/lino/core/", line 423, in run
return thing.run_from_session(self, *args, **kw)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/lino/core/", line 610, in run_from_session
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/lino/core/", line 536, in run_from_code
self.run_from_ui(ar, **kw)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/lino/mixins/", line 444, in run_from_ui, self, elem)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/lino/mixins/", line 146, in build
import ho.pisa as pisa
ImportError: No module named ho.pisa

Strange… my next guess is that pisa gets installed into the wrong environment. Leaving this problem open for meditation.

Recurrent polls

Continued in Polls in Lino Welfare.

I removed the languages definitions in lino_welfare.projects.chatelet.settings so that the default configuration is now English. (For lino_welfare.projects.eupen.settings this is yet to do, but it would break a series of unit tests).

(Not finished. Continued tomorrow.)


The value of a DummyField is now always None.