summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup.py36
-rw-r--r--src/mailman/__init__.py9
2 files changed, 30 insertions, 15 deletions
diff --git a/setup.py b/setup.py
index c9485de7f..6eb3630b9 100644
--- a/setup.py
+++ b/setup.py
@@ -18,33 +18,39 @@
import ez_setup
ez_setup.use_setuptools()
+import os
+import re
import sys
-from string import Template
-
-sys.path.insert(0, 'src')
-from mailman.version import VERSION as __version__
from setuptools import setup, find_packages
+from string import Template
-
-
if sys.hexversion < 0x20600f0:
print 'Mailman requires at least Python 2.6'
sys.exit(1)
+# Calculate the version number without importing the mailman package.
+with open('src/mailman/version.py') as fp:
+ for line in fp:
+ mo = re.match('VERSION = "(?P<version>[^"]+?)"', line)
+ if mo:
+ __version__ = mo.group('version')
+ print __version__
+ break
+ else:
+ print 'No version number found'
+ sys.exit(1)
+
+
# Ensure that all the .mo files are generated from the corresponding .po file.
# This procedure needs to be made sane, probably when the language packs are
# properly split out.
-import os
-import mailman.commands
-import mailman.messages
-
# Create the .mo files from the .po files. There may be errors and warnings
# here and that could cause the digester.txt test to fail.
-start_dir = os.path.dirname(mailman.messages.__file__)
+start_dir = os.path.dirname('src/mailman/messages')
for dirpath, dirnames, filenames in os.walk(start_dir):
for filename in filenames:
po_file = os.path.join(dirpath, filename)
@@ -70,7 +76,7 @@ scripts = set(
setup(
name = 'mailman',
- version = __version__,
+ ##version = __version__,
description = 'Mailman -- the GNU mailing list manager',
long_description= """\
This is GNU Mailman, a mailing list management system distributed under the
@@ -100,9 +106,9 @@ case second `m'. Any other spelling is incorrect.""",
'zope.interface',
'zope.schema',
],
- setup_requires = [
- 'setuptools_bzr',
- ],
+ ## setup_requires = [
+ ## 'setuptools_bzr',
+ ## ],
extras_require=dict(
docs=['Sphinx', 'z3c.recipe.sphinxdoc'],
)
diff --git a/src/mailman/__init__.py b/src/mailman/__init__.py
index 8c5301b0d..e5f46e3d4 100644
--- a/src/mailman/__init__.py
+++ b/src/mailman/__init__.py
@@ -29,3 +29,12 @@ __all__ = [
import warnings
warnings.filterwarnings(
'ignore', category=DeprecationWarning, module='lazr.restful._resource')
+
+
+# This is a namespace package.
+try:
+ import pkg_resources
+ pkg_resources.declare_namespace(__name__)
+except ImportError:
+ import pkgutil
+ __path__ = pkgutil.extend_path(__path__, __name__)