From e01a11fcc7b1d4359f6ef7787259577a7c130239 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Tue, 16 Nov 2021 05:33:28 +0100 Subject: [PATCH] Add code and metadata to enforce the use of Python 3. Tell setup.py to require python >= 3.0, and throw a RuntimeError if the sys.version_info.major is below 3. Fixes #187. --- pycam/Utils/__init__.py | 2 ++ setup.py | 1 + 2 files changed, 3 insertions(+) diff --git a/pycam/Utils/__init__.py b/pycam/Utils/__init__.py index 83d26eb2..b026567f 100644 --- a/pycam/Utils/__init__.py +++ b/pycam/Utils/__init__.py @@ -30,6 +30,8 @@ # import win32com # import win32api +if sys.version_info.major < 3: + raise RuntimeError("Only work with Python 3 or later") # setproctitle is (optionally) imported try: diff --git a/setup.py b/setup.py index e61cfaa0..6eed38c2 100755 --- a/setup.py +++ b/setup.py @@ -37,6 +37,7 @@ author_email="devel@sumpfralle.de", provides=["pycam"], requires=["PyOpenGL", "PyYAML"], + python_requires='>=3.0', url="http://pycam.sourceforge.net/", download_url="http://sourceforge.net/projects/pycam/files", keywords=["3-axis", "cnc", "cam", "toolpath", "machining", "g-code"],