20140116 (Thursday, 16 January 2014)

sphinxcontrib-dailyblog

I created a new project sphinxcontrib-dailyblog which contains what was previously in rstgen.sphinxconf, plus the new sphinxconf.dailyblog.refstothis module.

A new project means a decision about the license. Sigh!

I only recently found a consensus with Joe that for Lino I want the LGPL (see docs/tickets/79). Now I went to look for instructions on how to apply the LGPL to my code. Where I stumbled over the article Why you shouldn’t use the Lesser GPL for your next library.

People who write proprietary software anyway won’t use Sphinx to document it, so dog can be GPL (and not LGPL).

namespace packages

atelier did not yet support Python namespace packages.

https://stackoverflow.com/questions/1675734/how-do-i-create-a-namespace-package-in-python

http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages

But something is still wrong:

>>> import sphinxcontrib
>>> dir(sphinxcontrib)
['__doc__', '__name__', '__path__']
>>> import sphinxcontrib.dailyblog
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named dailyblog
>>> import sphinxcontrib.taglist
>>> import sphinxcontrib.dailyblog
>>> dir(sphinxcontrib)
['__builtins__', '__doc__', '__file__', '__name__', '__path__', 'dailyblog', 'taglist']

I guess that the reason is that I installed sphinxcontrib-newsfeed and sphinxcontrib-taglist using a simple pip install, but then I used pip install -e to install sphinxcontrib-dailyblog. Package namespaces have a problem when mixing released and development packages of a same namespace.

To try whether this is true, I uninstall the two released modules:

$ pip uninstall sphinxcontrib-newsfeed
$ pip uninstall sphinxcontrib-taglist

Yes, this was (probably) necessary, but it did not solve the following problem:

>>> import pkg_resources
>>> dist = pkg_resources.get_distribution('sphinxcontrib.dailyblog')
Traceback (most recent call last):
    ...
DistributionNotFound: sphinxcontrib.dailyblog

After quite some fiddling I discovered that in fact I don’t need the dist attribute of an atelier.Project, so I just removed that line.