Set the minimum python version required by anki on qt/setup.py

This commit is contained in:
evandrocoan 2020-03-31 22:07:47 -03:00
parent 2f9979bd30
commit 274944e678

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
from distutils.version import LooseVersion
import setuptools
@ -15,6 +16,7 @@ def package_files(directory):
# just the Python files for type hints?
pyonly = os.getenv("PYFILESONLY")
minimum_python_version = (3, 7)
if pyonly:
extra_files = []
@ -33,6 +35,11 @@ install_requires = [
'darkdetect; sys.platform == "darwin"',
]
if sys.version_info < minimum_python_version:
raise RuntimeError(
"The minimum Python interpreter version required for Anki is '%s' "
"and version '%s' was found!" % (minimum_python_version, sys.version_info)
)
try:
import PyQt5 as IS_PYQT_INSTALLED