django-appconf-0.5 test glitches, build doc needs -j1
idella opened this issue · 2 comments
The tests from tunning appconf/tests/tests.py have the following 2 issues;
Issue 1. appconf/tests/tests.py requires
sed -e 's:from .models:from models:' -i appconf/tests/tests.py
In gentoo, an ebuild runs the install; run from an ebuild, from .models does NOT work.
Issue 2. The line 48;
prefix = model_module.name.split('.')[-2]
in appconf/base.py draws error in the test phase;
-
Testing of dev-python/django-appconf-0.5 with CPython 2.5...
Traceback (most recent call last):
File "appconf/tests/tests.py", line 5, in
from models import (TestConf, PrefixConf, YetAnotherPrefixConf,
File
"/mnt/gen2/TmpDir/portage/dev-python/django-appconf-0.5/work/django-appconf-0.5/appconf/tests/models.py",
line 10, in class TestConf(AppConf): File
"/mnt/gen2/TmpDir/portage/dev-python/django-appconf-0.5/work/django-appconf-0.5/appconf/base.py",
line 48, in new prefix = model_module.name.split('.')[-2]
IndexError: list index out of rangeor python2.7
- Testing of dev-python/django-appconf-0.5 with CPython 2.7...
Traceback (most recent call last):
File "appconf/tests/tests.py", line 5, in
from models import (TestConf, PrefixConf, YetAnotherPrefixConf,
File "/mnt/gen2/TmpDir/portage/dev-python/django-appconf-0.5/work/django-appconf-0.5/appconf/tests/models.py", line 10, in
class TestConf(AppConf):
File "/mnt/gen2/TmpDir/portage/dev-python/django-appconf-0.5/work/django-appconf-0.5/appconf/base.py", line 48, in new
prefix = model_module.name.split('.')[-2]
IndexError: list index out of range
When replaced with the value [-1]; it returns success for the test.
Your call whether the value -2 in the test is wrong, I'm not sure.
- An annoying glitch in build in the docs. Require emake -j1 -C docs pickle html
in order to build with more than 1 option for emake, or make. Without -j; you get
Exception occurred:
File "/usr/lib64/python2.7/site-packages/sphinx/environment.py", line 1210, in get_doctree
doctree = pickle.load(f)
EOFError
The full traceback has been saved in /mnt/gen2/TmpDir/portage/dev-python/django-appconf-0.5/temp/sphinx-err-gT9rFC.log, if you want to report the issue to the developers.
Actually it is intermittent or inconsistent; i.e. sometimes it misfires, sometimes it gets thru
The setup in the Makefile is to build the docs with common to many other python packages.
It's actually a sphinx issue, but mentioning it here does no harm, and you could pass it on perhaps.
I can't reproduce the errors, @idella (see http://travis-ci.org/jezdez/django-appconf), but I've just updated the import in the tests module to be absolute instead of relative. Using just from models import …
is not an option for me, as it's implicit and therefor unclean.
I don't get the second issue, it needs to be second to last item of the split module path, it picks 'appname' from 'path.to.appname.models' to be able to discover the config prefix. I think the second issue might have been related to you fixing your first issue, using implicit relative imports. But I'm not sure as I can't reproduce this.
The third issue about the docs is something I could happily fix locally, if you can provide a patch. Other than that, this sounds indeed like an upstream issue.
hey,
back then a few weeks ago my system had this erroneous PYTHONPATH system setting. It was apparently installed with a python app the name of which I can't remember now. So it interfered with a few other test phases in similar fashion.. Now it's been deleted test phases like this work ok.