diff --git a/bumpversion.sh b/bumpversion.sh index cb8ac50..b79b7d7 100755 --- a/bumpversion.sh +++ b/bumpversion.sh @@ -6,6 +6,8 @@ NEW="$( git rev-parse --abbrev-ref HEAD | cut -d / -f 2 )" echo "Bumping version ${OLD} -> ${NEW}...\n" sed -e "s/^ version='${OLD}'/ version='${NEW}'/" setup.py > .setup.py mv .setup.py setup.py +sed -e "s/^__version__ = '${OLD}'$/__version__ = '${NEW}'/" dddp/__init__.py > .__init__.py +mv .__init__.py dddp/__init__.py sed -e "s/^version = '${OLD%.*}'/version = '${NEW%.*}'/" -e "s/^release = '${OLD}'/release = '${NEW}'/" docs/conf.py > docs/.conf.py mv docs/.conf.py docs/conf.py git diff setup.py docs/conf.py diff --git a/dddp/__init__.py b/dddp/__init__.py index d998909..bb1d172 100644 --- a/dddp/__init__.py +++ b/dddp/__init__.py @@ -2,19 +2,10 @@ from __future__ import unicode_literals import os.path import sys -from pkg_resources import get_distribution, DistributionNotFound from gevent.local import local from dddp import alea -try: - _dist = get_distribution('django-ddp') - if not __file__.startswith(os.path.join(_dist.location, 'django-ddp', '')): - # not installed, but there is another version that *is* - raise DistributionNotFound -except DistributionNotFound: - __version__ = 'development' -else: - __version__ = _dist.version +__version__ = '0.17.1' default_app_config = 'dddp.apps.DjangoDDPConfig' @@ -80,7 +71,7 @@ class ThreadLocal(local): def get(self, name, factory, *factory_args, **factory_kwargs): """Get attribute, creating if required using specified factory.""" update_thread_local = getattr(factory, 'update_thread_local', True) - if (not update_thread_local) or (not hasattr(self, name)): + if (not update_thread_local) or (name not in self.__dict__): obj = factory(*factory_args, **factory_kwargs) if update_thread_local: setattr(self, name, obj) diff --git a/requirements.txt b/requirements.txt index 08a16e3..e0617b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ Django==1.8.5 gevent==1.0.2 gevent-websocket==0.9.5 psycopg2==2.6.1 +six==1.10.0 diff --git a/setup.py b/setup.py index 8d5468a..c1b93b1 100644 --- a/setup.py +++ b/setup.py @@ -62,6 +62,7 @@ setup( 'psycogreen>=1.0', 'django-dbarray>=0.2', 'pybars3>=0.9.1', + 'six>=1.10.0', ], entry_points={ 'console_scripts': [