summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-12-06 11:18:41 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-12-06 11:18:41 -0300
commita0ef331191fa8e1c7a7a9816f1cf35ed6b9bfe59 (patch)
tree3d4d91a5f52bb10c24ef2136db9fa5b99c9f2123
parentb3f698253e1b6e0db2a21b756b04e50f40aa59e3 (diff)
downloadaskbot-a0ef331191fa8e1c7a7a9816f1cf35ed6b9bfe59.tar.gz
askbot-a0ef331191fa8e1c7a7a9816f1cf35ed6b9bfe59.tar.bz2
askbot-a0ef331191fa8e1c7a7a9816f1cf35ed6b9bfe59.zip
made dependency checking more complete and incremented revision
-rw-r--r--askbot/__init__.py26
-rw-r--r--askbot/doc/source/changelog.rst9
-rw-r--r--askbot/models/__init__.py6
-rw-r--r--askbot/startup_procedures.py20
-rw-r--r--setup.py24
5 files changed, 48 insertions, 37 deletions
diff --git a/askbot/__init__.py b/askbot/__init__.py
index 9686b5f5..99c3f596 100644
--- a/askbot/__init__.py
+++ b/askbot/__init__.py
@@ -9,7 +9,31 @@ import smtplib
import sys
import logging
-VERSION = (0, 7, 32)
+VERSION = (0, 7, 33)
+
+#keys are module names used by python imports,
+#values - the package qualifier to use for pip
+REQUIREMENTS = {
+ 'akismet': 'akismet',
+ 'django': 'django>=1.1.2',
+ 'jinja2': 'Jinja2',
+ 'coffin': 'Coffin>=0.3',
+ 'south': 'South>=0.7.1',
+ 'oauth2': 'oauth2',
+ 'markdown2': 'markdown2',
+ 'html5lib': 'html5lib',
+ 'keyedcache': 'django-keyedcache',
+ 'threaded_multihost': 'django-threaded-multihost',
+ 'robots': 'django-robots',
+ 'unidecode': 'unidecode',
+ 'django_countries': 'django-countries==1.0.5',
+ 'djcelery': 'django-celery==2.2.7',
+ 'djkombu': 'django-kombu==0.9.2',
+ 'followit': 'django-followit',
+ 'recaptcha_works': 'django-recaptcha-works',
+ 'openid': 'python-openid',
+ 'pystache': 'pystache==0.3.1',
+}
#necessary for interoperability of django and coffin
try:
diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst
index c8bd18f2..2617b096 100644
--- a/askbot/doc/source/changelog.rst
+++ b/askbot/doc/source/changelog.rst
@@ -1,16 +1,17 @@
Changes in Askbot
=================
-Development version
--------------------
+0.7.33 (Current Version)
+------------------------
* Made on log in redirect to the forum index page by default
and to the question page, if user was reading the question
it is still possible to override the ``next`` url parameter
or just rely on django's ``LOGIN_REDIRECT_URL`` (Evgeny)
* Implemented retraction of offensive flags (Dejan Noveski)
+* Made automatic dependency checking more complete (Evgeny)
-0.7.32 (Current Version)
-------------------------
+0.7.32
+------
* Bugfixes in English locale (Evgeny)
0.7.31
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py
index 4c5cfdc5..9f5e8999 100644
--- a/askbot/models/__init__.py
+++ b/askbot/models/__init__.py
@@ -1,3 +1,6 @@
+from askbot import startup_procedures
+startup_procedures.run()
+
import logging
import re
import hashlib
@@ -36,9 +39,6 @@ from askbot.utils.decorators import auto_now_timestamp
from askbot.utils.slug import slugify
from askbot.utils.diff import textDiff as htmldiff
from askbot.utils import mail
-from askbot import startup_procedures
-
-startup_procedures.run()
def get_model(model_name):
return models.get_model('askbot', model_name)
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
index 5e2f7da0..9c962f2a 100644
--- a/askbot/startup_procedures.py
+++ b/askbot/startup_procedures.py
@@ -12,7 +12,6 @@ import os
from django.db import transaction
from django.conf import settings as django_settings
from django.core.exceptions import ImproperlyConfigured
-from askbot.models import badges
from askbot.utils.loading import load_module
PREAMBLE = """\n
@@ -120,15 +119,18 @@ def try_import(module_name, pypi_package_name):
try:
load_module(module_name)
except ImportError, error:
- message = unicode(error) + ' run\npip install %s' % pypi_package_name
- message += '\nTo install all the dependencies at once, type:'
+ message = 'Error: ' + unicode(error)
+ message += '\n\nPlease run: >pip install %s' % pypi_package_name
+ message += '\n\nTo install all the dependencies at once, type:'
message += '\npip install -r askbot_requirements.txt\n'
+ message += '\nType ^C to quit.'
raise ImproperlyConfigured(message)
def test_modules():
"""tests presence of required modules"""
- try_import('akismet', 'akismet')
- try_import('recaptcha_works', 'django-recaptcha-works')
+ from askbot import REQUIREMENTS
+ for module_name, pip_path in REQUIREMENTS.items():
+ try_import(module_name, pip_path)
def test_postgres():
"""Checks for the postgres buggy driver, version 2.4.2"""
@@ -283,8 +285,14 @@ def run_startup_tests():
@transaction.commit_manually
def run():
"""runs all the startup procedures"""
- run_startup_tests()
try:
+ run_startup_tests()
+ except ImproperlyConfigured, error:
+ transaction.rollback()
+ print error
+ sys.exit(1)
+ try:
+ from askbot.models import badges
badges.init_badges()
transaction.commit()
except Exception, error:
diff --git a/setup.py b/setup.py
index 253f9db9..2227aba3 100644
--- a/setup.py
+++ b/setup.py
@@ -6,28 +6,6 @@ import sys
#NOTE: if you want to develop askbot
#you might want to install django-debug-toolbar as well
-install_requires = [
- 'akismet',
- 'django>=1.1.2',
- 'Jinja2',
- 'Coffin>=0.3',
- 'South>=0.7.1',
- 'oauth2',
- 'markdown2',
- 'html5lib',
- 'django-keyedcache',
- 'django-threaded-multihost',
- 'django-robots',
- 'unidecode',
- 'django-countries==1.0.5',
- 'django-celery==2.2.7',
- 'django-kombu==0.9.2',
- 'django-followit',
- 'django-recaptcha-works',
- 'python-openid',
- 'pystache==0.3.1',
-]
-
import askbot
setup(
@@ -46,7 +24,7 @@ setup(
},
url = 'http://askbot.org',
include_package_data = True,
- install_requires = install_requires,
+ install_requires = askbot.REQUIREMENTS.values(),
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',