summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2020-06-22 08:51:26 -0500
committerptmcg <ptmcg@austin.rr.com>2020-06-22 08:51:26 -0500
commit6fc0f329eec924c760877eaddb0abb164a861267 (patch)
tree15859084c8b62cb337ae023b031c7461b60ffaa4
parentaf13023380fe28e2a52f566ea3c8f070fb92f14d (diff)
downloadpyparsing-git-6fc0f329eec924c760877eaddb0abb164a861267.tar.gz
Add explicit guard to setup.py against installs using Python < 3.5, for those who do 'python setup.py install' directly instead of going thru pip
-rw-r--r--setup.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index b8208fd..9a64c9b 100644
--- a/setup.py
+++ b/setup.py
@@ -7,9 +7,16 @@ try:
except ImportError:
from distutils.core import setup
import io
+import sys
from pyparsing import __version__ as pyparsing_version
-# The text of the README file
+# guard against manual invocation of setup.py (when using pip, we shouldn't even get this far)
+if sys.version_info[:2] < (3, 5):
+ sys.exit(
+ "Python < 3.5 is not supported in this version of pyparsing; use latest pyparsing 2.4.x release"
+ )
+
+# get the text of the README file
README_name = __file__.replace("setup.py", "README.rst")
with io.open(README_name, encoding="utf8") as README:
pyparsing_main_doc = README.read()