From 68b9e95512416590959167c5bf7cbae87d0c5bb1 Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Mon, 24 Sep 2018 11:25:33 -0700 Subject: [PATCH] Added error checking for python version & clarified README --- README.rst | 7 ++----- scripts/atrcopy | 10 ++++++++-- setup.py | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 6cc19a8..55cbc77 100644 --- a/README.rst +++ b/README.rst @@ -22,11 +22,8 @@ Supported Python versions: * Python 3.6 (and later) -If you need Python 2 support, ``atrcopy`` 6.5 and earlier supports: - -* Python 2.7 -* Python 3.5 -* Python 3.6 +If you need Python 2 support, ``atrcopy`` 6.5 and earlier supports Python 2.7, +which you can install with ``pip install "atrcopy<7.0"`` Dependencies ------------ diff --git a/scripts/atrcopy b/scripts/atrcopy index c4b1b2a..f0a3d6f 100755 --- a/scripts/atrcopy +++ b/scripts/atrcopy @@ -1,6 +1,12 @@ #!/usr/bin/env python if __name__ == "__main__": - import atrcopy + import sys + if sys.version_info < (3, 6, 0): + print("atrcopy requires Python 3.6 or greater to run; this is Python %s" % ".".join([str(v) for v in sys.version_info[0:2]])) + if sys.version_info[0] == 2: + print("Python 2 support was dropped with atrcopy 7.0, so you can either use:\n\n pip install \"atrcopy<7.0\"\n\nto install a version compatible with Python 2, or install Python 3.6 or higher.") + else: + import atrcopy - atrcopy.run() + atrcopy.run() diff --git a/setup.py b/setup.py index e8b06bb..200ee7d 100644 --- a/setup.py +++ b/setup.py @@ -33,6 +33,7 @@ setup(name="atrcopy", "Topic :: Software Development :: Libraries", "Topic :: Utilities", ], + python_requires = '>=3.6', install_requires = [ 'numpy', ],