mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
Set the minimum python version required by anki on qt/setup.py
This commit is contained in:
parent
2f9979bd30
commit
274944e678
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
import setuptools
|
import setuptools
|
||||||
|
@ -15,6 +16,7 @@ def package_files(directory):
|
||||||
|
|
||||||
# just the Python files for type hints?
|
# just the Python files for type hints?
|
||||||
pyonly = os.getenv("PYFILESONLY")
|
pyonly = os.getenv("PYFILESONLY")
|
||||||
|
minimum_python_version = (3, 7)
|
||||||
|
|
||||||
if pyonly:
|
if pyonly:
|
||||||
extra_files = []
|
extra_files = []
|
||||||
|
@ -33,6 +35,11 @@ install_requires = [
|
||||||
'darkdetect; sys.platform == "darwin"',
|
'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:
|
try:
|
||||||
import PyQt5 as IS_PYQT_INSTALLED
|
import PyQt5 as IS_PYQT_INSTALLED
|
||||||
|
|
Loading…
Reference in a new issue