From a49e27689a31220aa2bb1c6d23ae18b811613757 Mon Sep 17 00:00:00 2001 From: Alex Kaszynski Date: Fri, 18 Jun 2021 00:32:23 +0000 Subject: [PATCH] check py38 and 64 bit --- setup.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/setup.py b/setup.py index 2ba218c3..c0ba0a7b 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ """Installation file for ansys-mapdl-reader""" +import struct import os import sys from io import open as io_open @@ -89,6 +90,25 @@ def compilerName(): 'matplotlib>=3.0.0', 'tqdm>=4.45.0'] +# perform python version checking +# this is necessary to avoid the new pip package checking as vtk does +# not support Python 3.9 or any 32-bit as of 17 June 2021. +is64 = struct.calcsize("P")*8 == 64 +if not is64: + raise RuntimeError('\n\n``ansys-mapdl-reader`` requires 64-bit Python\n' + 'Please check the version of Python installed at\n' + '%s' % sys.executable) + +if sys.version_info.minor > 8: + try: + import vtk + except: + raise RuntimeError('\n\n``ansys-mapdl-reader`` supports Python 3.6 - 3.8\n' + 'Python 3.9 support depends on vtk wheels, which should\n' + 'be released by August 2021.\n\n' + 'Installed Python:\n' + '%s' % str(sys.version.splitlines()[0])) + # Actual setup setup(