diff --git a/ci/edmtool.py b/ci/edmtool.py index dbd6def08..cff3aa05a 100644 --- a/ci/edmtool.py +++ b/ci/edmtool.py @@ -97,17 +97,15 @@ "hypothesis", "kiwisolver", "numpy", + "pillow", + "pyface", "pygments", "pyparsing", - "pillow", + "pypdf2", "reportlab", "swig", "traits", "traitsui", - "pyface", - "pypdf2", - "swig", - "unittest2", } # Dependencies we install from source for cron tests diff --git a/setup.py b/setup.py index 13ca829f8..f43940c66 100644 --- a/setup.py +++ b/setup.py @@ -428,7 +428,31 @@ def macos_extensions(): ] +def verify_swig_version(): + """ Verify we are using swiig version 3.0.x. + """ + msg = ("SWIG is a required build dependency of Enable. Furthermore, there " + "is currently a known issue with SWIG 4.0, " + "see enthought/enable#360. Please install SWIG 3.0.x " + "(see http://www.swig.org/).") + try: + cmd = ["swig", "-version"] + opts = {"stdout": subprocess.PIPE, "encoding": "utf-8"} + with subprocess.Popen(cmd, **opts) as proc: + # We expect text along the lines of "SWIG Version 3.X.Y" + swig_version_match = re.search( + r"(SWIG Version 3)\.\d{1,2}\.\d{1,2}", + proc.stdout.read() + ) + if swig_version_match is None: + raise Exception(msg) + except FileNotFoundError: + raise Exception(msg) + + if __name__ == "__main__": + verify_swig_version() + # Write version modules as needed enable_version_path = os.path.join('enable', '_version.py') write_version_py(filename=enable_version_path)