Specify extras for gettext message extractors

Added "babel" and "lingua" dependency entries to the setuptools entrypoints
for the babel and lingua extensions, so that pkg_resources can check that
these extra dependencies are available, raising an informative
exception if not.  Pull request courtesy sinoroc.

Fixes: #304

Closes: #305
Pull-request: https://github.com/sqlalchemy/mako/pull/305
Pull-request-sha: 9a1c9a2242a41b553af2524381ab69c2e404a778

Change-Id: I973081a17ed27bf2f954d73133b0d52855bcacff
diff --git a/doc/build/unreleased/304.rst b/doc/build/unreleased/304.rst
new file mode 100644
index 0000000..79921d7
--- /dev/null
+++ b/doc/build/unreleased/304.rst
@@ -0,0 +1,10 @@
+.. change::
+    :tags: bug, ext
+    :tickets: 304
+
+    Added "babel" and "lingua" dependency entries to the setuptools entrypoints
+    for the babel and lingua extensions, so that pkg_resources can check that
+    these extra dependencies are available, raising an informative
+    exception if not.  Pull request courtesy sinoroc.
+
+
diff --git a/setup.py b/setup.py
index fd5a89e..9e14132 100644
--- a/setup.py
+++ b/setup.py
@@ -77,12 +77,20 @@
       css+mako = mako.ext.pygmentplugin:MakoCssLexer
 
       [babel.extractors]
-      mako = mako.ext.babelplugin:extract
+      mako = mako.ext.babelplugin:extract [babel]
 
       [lingua.extractors]
-      mako = mako.ext.linguaplugin:LinguaMakoExtractor
+      mako = mako.ext.linguaplugin:LinguaMakoExtractor [lingua]
 
       [console_scripts]
       mako-render = mako.cmd:cmdline
       """,
+    extras_require={
+        'babel': [
+            'Babel',
+        ],
+        'lingua': [
+            'lingua',
+        ],
+    },
 )