self-contained-runnable-python-package-template icon indicating copy to clipboard operation
self-contained-runnable-python-package-template copied to clipboard

Add assertion ensuring python3 is used

Open tpapastylianou opened this issue 2 years ago • 0 comments

e.g. get this assertion error if you attempt to run using python2:

Error: This package is intended to be run in python3
   (you seem to be running python2)

NOTE: Ironically, for this to work, this whole file needs to use python2 compatible syntax, otherwise the interpreter will exit with a syntax error even before it reaches this assertion. Specifically, this means we cannot use 'f-strings' in this file, so we'll need to rely on the older '.format()' mechanism.

tpapastylianou avatar May 10 '22 16:05 tpapastylianou