Anonymous committed aaeb6bb

fix #379 fails with obscure error message

Comments (0)

Files changed (3)


 project = "MoinMoin"
 import sys
-if sys.hexversion < 0x2070000:
-    sys.exit("%s requires Python 2.7.x.\n" % project)
+import platform
+if sys.hexversion < 0x2070000 or sys.hexversion > 0x2999999:
+    sys.exit("Error: %s requires Python 2.7.x., current version is %s\n" % (project, platform.python_version()))
 from MoinMoin.util.version import Version
 needs: virtualenv, pip
+import MoinMoin  # validate python version
 import argparse
 import logging
 import os.path
             os.path.join(self.dir_venv_bin, 'python'),
             os.path.join(self.dir_source, ''),
             'compile_catalog', '--statistics',
+            # needed in case user runs with a cwd other than the repo root
+            '--directory', os.path.join(os.path.dirname(__file__), 'MoinMoin', 'translations'),
 # Copyright: 2001-2012 MoinMoin:ThomasWaldmann
 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
-import sys
 import os
+import MoinMoin  # validate python version
-from MoinMoin import project, version
-if sys.hexversion < 0x2070000:
-    # we require 2.7.x, python 3.x does not work yet.
-    sys.stderr.write("%s %s requires Python 2.7.x.\n" % (project, str(version)))
-    sys.exit(1)
-with open('README.txt') as f:
+basedir = os.path.abspath(os.path.dirname(__file__))
+with open(os.path.join(basedir, 'README.txt')) as f:
     long_description =
 from setuptools import setup, find_packages
 setup_args = dict(
-    version=str(version),
+    version=str(MoinMoin.version),
     description="MoinMoin is an easy to use, full-featured and extensible wiki software package",
     author="Juergen Hermann et al.",
     # maintainer(_email) not active because distutils/register can't handle author and maintainer at once
-    download_url='' % (version, ),
+    download_url='' % (MoinMoin.version, ),
     license="GNU GPL v2 (or any later version)",
     keywords="wiki web",