taldcroft/sfepy — comment on commit 61dfa6290eefb02dbd0d0af59a7e02b640a587f2
File:  line 0
By rc:

Ah, I see.

The current implementation does the following. In each example, the mesh name has this form:

filename_mesh = data_dir + '/meshes/3d/cylinder.mesh'

where data_dir is '.' for non-installed sfepy, and /../../../../share/sfepy/ for installed sfepy. This is an ad-hoc solution, as I was not sure where would be the best place to install data files.

Example (on Gentoo):
$ python setup.py install --root=/home/share/software/

leads to

/home/share/software/usr/lib64/python2.6/site-packages/ containing sfepy package (in sfepy/ directory)

and

/home/share/software/usr/share/sfepy holds the data files like examples, meshes, docs etc.

After your patch, the data files are installed directly to

/home/share/software/usr/lib64/python2.6/site-packages/

which is wrong.

It seems that with EPD, data_dir is set in a wrong way and/or the data files are copied to other dir than expected. (BTW. on Gentoo, what you did actually works with unpatched code!). Where do other packages (ipython, matplotlib, scipy etc.) install non-source data files in EPD? I think using the same directory as the sources would simplify things and fixed the issues - will try it.

Just like you would like, I develop sfepy-related projects outside of the sfepy source directory, but I do not install sfepy. Instead, I add the sfepy source directory to PYTHONPATH, and (optionally) make symbolic links to simple.py, postproc.py and other scripts I may want to run from the project working directory. It seems to me to be the easiest way, as when I update sfepy, I do not need to reinstall it every time (and compile is necessary only when touching C). Also, you can remove the "data_dir + '/" in the copied example(s).

As concerns the namespace issue, it's true that "simple.py" is a rather generic name, and a prefix might be good. The documentation is mostly written for non-installed sfepy, so it would be a matter of adding a mapping of the names with explanation to the beginning.