Files
@ 193138922d56
Branch filter:
Location: kallithea/MANIFEST.in - annotation
193138922d56
1.1 KiB
text/plain
celery: introduce make_app instead of creating app at import time
It is dirty to instantiate things at import time (unless it really is basic
singletons).
In 0.5.1 (and earlier), such dirtyness made partial test execution fail when
other things had global side effects and things didn't use the usual import
order:
$ py.test kallithea/lib/
collecting ...
――― kallithea/lib/celerypylons/__init__.py ―――
kallithea/lib/celerypylons/__init__.py:58: in <module>
app.config_from_object(celery_config(tg.config))
kallithea/lib/celerypylons/__init__.py:28: in celery_config
assert config['celery.imports'] == 'kallithea.lib.celerylib.tasks', 'Kallithea Celery configuration has not been loaded'
data/env/lib/python2.7/site-packages/tg/configuration/tgconfig.py:31: in __getitem__
return self.config_proxy.current_conf()[key]
E KeyError: 'celery.imports'
Avoid that by running a "factory" function when the celery app actually is
needed.
It is dirty to instantiate things at import time (unless it really is basic
singletons).
In 0.5.1 (and earlier), such dirtyness made partial test execution fail when
other things had global side effects and things didn't use the usual import
order:
$ py.test kallithea/lib/
collecting ...
――― kallithea/lib/celerypylons/__init__.py ―――
kallithea/lib/celerypylons/__init__.py:58: in <module>
app.config_from_object(celery_config(tg.config))
kallithea/lib/celerypylons/__init__.py:28: in celery_config
assert config['celery.imports'] == 'kallithea.lib.celerylib.tasks', 'Kallithea Celery configuration has not been loaded'
data/env/lib/python2.7/site-packages/tg/configuration/tgconfig.py:31: in __getitem__
return self.config_proxy.current_conf()[key]
E KeyError: 'celery.imports'
Avoid that by running a "factory" function when the celery app actually is
needed.
8cea7986ed79 ff08d3cf9aef ff08d3cf9aef ff08d3cf9aef 8cea7986ed79 ff08d3cf9aef ff08d3cf9aef ff08d3cf9aef ff08d3cf9aef ddfecf9fe7f2 8cea7986ed79 ff08d3cf9aef 8cea7986ed79 8cea7986ed79 8cea7986ed79 2d7a94f3eaae 0e6035a85980 7894a440e134 ff08d3cf9aef 8cea7986ed79 19a9f02443c8 ff08d3cf9aef ff08d3cf9aef 7e5f8c12a3fc ff08d3cf9aef ff08d3cf9aef 8cea7986ed79 8cea7986ed79 ff08d3cf9aef 8cea7986ed79 | include .coveragerc
include Apache-License-2.0.txt
include CONTRIBUTORS
include COPYING
include Jenkinsfile
include LICENSE-MERGELY.html
include LICENSE.md
include MIT-Permissive-License.txt
include README.rst
include conftest.py
include dev_requirements.txt
include development.ini
include pytest.ini
include requirements.txt
include tox.ini
recursive-include docs *
recursive-include init.d *
recursive-include kallithea/alembic *
include kallithea/bin/ldap_sync.conf
include kallithea/lib/paster_commands/template.ini.mako
recursive-include kallithea/front-end *
recursive-include kallithea/i18n *
recursive-include kallithea/public *
recursive-include kallithea/templates *
recursive-include kallithea/tests/fixtures *
recursive-include kallithea/tests/scripts *
include kallithea/tests/models/test_dump_html_mails.ref.html
include kallithea/tests/performance/test_vcs.py
include kallithea/tests/vcs/aconfig
recursive-include scripts *
|