summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorBarry Warsaw2009-09-30 14:39:48 -0400
committerBarry Warsaw2009-09-30 14:39:48 -0400
commit4d65379e42136bacd84430f5a50d1fa733f0fdc9 (patch)
tree78e1f175daace58b925313ff4495383047117378 /setup.py
parent7e9654ddc443ae5c53da62cdd144c23b7e41877e (diff)
parent9dd0f35cfaeedda85badeb577991ae197b24fb03 (diff)
downloadmailman-4d65379e42136bacd84430f5a50d1fa733f0fdc9.tar.gz
mailman-4d65379e42136bacd84430f5a50d1fa733f0fdc9.tar.zst
mailman-4d65379e42136bacd84430f5a50d1fa733f0fdc9.zip
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/setup.py b/setup.py
index c9485de7f..e9967f453 100644
--- a/setup.py
+++ b/setup.py
@@ -18,33 +18,38 @@
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')
+ 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)