Commits

Andy Mikhailenko  committed 1089d4f

Removed doqu.dist; the dependencies are now stored in plain requirements files and the pkg_resources machinery is not used anymore.

  • Participants
  • Parent commits 3947fbb

Comments (0)

Files changed (7)

File doqu/dist.py

-# -*- coding: utf-8 -*-
-#
-#    Doqu is a lightweight schema/query framework for document databases.
-#    Copyright © 2009—2010  Andrey Mikhaylenko
-#
-#    This file is part of Doqu.
-#
-#    Doqu is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Lesser General Public License as published
-#    by the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
-#
-#    Doqu is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Lesser General Public License for more details.
-#
-#    You should have received a copy of the GNU Lesser General Public License
-#    along with Doqu.  If not, see <http://gnu.org/licenses/>.
-"""
-Distribution internals
-======================
-
-These are some distribution-related routines. It is doubtful that you would
-ever need them unless you are developing Doqu itself.
-"""
-import pkg_resources
-
-
-DEFAULT_GROUP = 'extensions'
-
-
-def _get_entry_points(module_name, attr_name=None):
-    """
-    Returns an iterator on entry points for given module name and, optionally,
-    attribute name.
-    """
-    group = DEFAULT_GROUP
-    for entry_point in pkg_resources.iter_entry_points(group):
-        if not entry_point.module_name == module_name:
-            continue
-        if attr_name and not attr_name in entry_point.attrs:
-            continue
-        yield entry_point
-
-def check_dependencies(module_name, attr_name=None):
-    """
-    Checks module or attribute dependencies. Raises NameError if setup.py does
-    not specify dependencies for given module or attribute.
-
-    :param module_name:
-        e.g. "doqu.ext.mongodb"
-    :param attr_name:
-        e.g. "bar" from "doqu.ext.foo:bar"
-
-    """
-    entry_points = list(_get_entry_points(module_name, attr_name))
-    if not entry_points:
-        msg = 'There are no entry points for module "{module_name}"'
-        if attr_name:
-            msg += 'and attribute "{attr_name}"'
-        raise NameError(msg.format(**locals()))
-    for entry_point in entry_points:
-        entry_point.require()

File doqu/ext/forms.py

 #
 #    You should have received a copy of the GNU Lesser General Public License
 #    along with Doqu.  If not, see <http://gnu.org/licenses/>.
-
 """
 WTForms extension
 =================
     in the future most of them can be translated automatically.
 
 """
-from doqu import dist
-dist.check_dependencies(__name__)
-
 import datetime
 try:
     import dateutil

File doqu/ext/mongodb/__init__.py

 #
 #    You should have received a copy of the GNU Lesser General Public License
 #    along with Doqu.  If not, see <http://gnu.org/licenses/>.
-
 """
 MongoDB extension
 =================
     involving complex queries. Patches, improvements, rewrites are welcome.
 
 """
-from doqu import dist
-dist.check_dependencies(__name__)
-
 import pymongo
 from pymongo.objectid import ObjectId
 

File doqu/ext/shove_db/__init__.py

 #    You should have received a copy of the GNU Lesser General Public License
 #    along with Doqu.  If not, see <http://gnu.org/licenses/>.
 
-
 """
 Shove extension
 ===============
   .. _shove: http://pypi.python.org/pypi/shove
 
 """
-
-from doqu import dist
-dist.check_dependencies(__name__)
-
 from shove import Shove
 
 # reuse most of the shelve extension's code

File doqu/ext/tokyo_cabinet/__init__.py

 #
 #    You should have received a copy of the GNU Lesser General Public License
 #    along with Doqu.  If not, see <http://gnu.org/licenses/>.
-
-
 """
 Tokyo Cabinet extension
 =======================
     >>> os.unlink(DB_SETTINGS['path'])
 
 """
-
-from doqu import dist
-dist.check_dependencies(__name__)
-
 import logging
 
 import tokyo.cabinet as tc

File doqu/ext/tokyo_tyrant/__init__.py

   .. _Pyrant: http://pypi.python.org/pypi/pyrant
 
 """
-
-__all__ = ['StorageAdapter']
-
-from doqu import dist
-dist.check_dependencies(__name__)
-
 from storage import StorageAdapter
 
 # let backend-specific stuff register itself with managers
 import converters
 import lookups
+
+
+__all__ = ['StorageAdapter']
     provides = ['doqu'],
     obsoletes = ['pymodels', 'docu'],
 
-    # optional features
-    #   NOTE: if e.g. Sphinx or nosetests die because of endpoints, try:
-    #   $ rm -rf doqu.egg-info
-    #   $ pip install .
-    extras_require = {
-        'TC': ['tokyo-python>=0.6'],
-        'TT': ['pyrant>=0.6.3'],
-        'Shove': ['shove>=0.2.1'],
-        'Mongo': ['pymongo>=1.7'],
-        'WTForms': ['wtforms>=0.6.1dev'],  # 0.6 has bug in dateutil ext
-    },
-    entry_points = {
-        'extensions': [
-            'tc = doqu.ext.tokyo_cabinet [TC]',
-            'tt = doqu.ext.tokyo_tyrant [TT]',
-            'shove = doqu.ext.shove_db [Shove]',
-            'mongo = doqu.ext.mongodb [Mongo]',
-            'wtforms = doqu.ext.forms [WTForms]',
-        ],
-    },
-
     # copyright
     author   = 'Andrey Mikhaylenko',
     author_email = 'andy@neithere.net',