You're right, I misunderstood environment markers.
However, you can ensure compatibility around this by specifying the required version in the top of your script:
import sys
minimum_version = (3,6,1)
if sys.version_info < minimum_version:
sys.exit("You need Python 3.6.1")
This will work because of how Python's tuple comparison works.
As long as you put this above any code requiring any specific version (this will work with Pyton 2.7, I don't have anything older to test) this will halt execution on dependency failures.
You can include these checks in your setup.py if you want to rely on Pip so users are warned on install time. You could probably also add this to some wheel trigger if you add a local/public package as a dependency in your requirements.txt.
However, you can ensure compatibility around this by specifying the required version in the top of your script:
This will work because of how Python's tuple comparison works.As long as you put this above any code requiring any specific version (this will work with Pyton 2.7, I don't have anything older to test) this will halt execution on dependency failures.
You can include these checks in your setup.py if you want to rely on Pip so users are warned on install time. You could probably also add this to some wheel trigger if you add a local/public package as a dependency in your requirements.txt.