From 0d246c9e0be164b73c6f972a1d1b9ffa8d5b5810 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 15 Oct 2021 12:54:59 +1000 Subject: [PATCH] update wheel definitions to require Python 3.9; make PyQt optional While we do require PyQt, it's not possible to declare that we require either 5 or 6, and so we need to mark it as optional. Instead, we provide optional dependencies, so the user can e.g. 'pip install aqt[qt6]' --- pylib/anki/BUILD.bazel | 2 +- qt/aqt/BUILD.bazel | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/pylib/anki/BUILD.bazel b/pylib/anki/BUILD.bazel index f0c3c0e1f..d98080060 100644 --- a/pylib/anki/BUILD.bazel +++ b/pylib/anki/BUILD.bazel @@ -76,7 +76,7 @@ py_wheel( "//platforms:linux_x86_64": "manylinux2014_x86_64", "//platforms:linux_arm64": "manylinux2014_aarch64", }), - python_tag = "cp38", + python_tag = "cp39", python_version = ">=3.9", requires = [ "beautifulsoup4", diff --git a/qt/aqt/BUILD.bazel b/qt/aqt/BUILD.bazel index 788cae435..778db0ede 100644 --- a/qt/aqt/BUILD.bazel +++ b/qt/aqt/BUILD.bazel @@ -107,10 +107,20 @@ py_wheel( entry_points = { "console_scripts": ["anki = aqt:run"], }, + extra_requires = { + "qt5": [ + "pyqt5>=5.14", + "pyqtwebengine", + ], + "qt6": [ + "pyqt6>=6.2", + "pyqt6-webengine>=6.2", + ], + }, homepage = "https://apps.ankiweb.net", license = "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", python_tag = "py3", - python_version = ">=3.8", + python_version = ">=3.9", requires = [ "beautifulsoup4", "requests", @@ -119,12 +129,9 @@ py_wheel( "flask", "flask_cors", "waitress", - "pyqt5>=5.12", - "pyqtwebengine", 'psutil; sys.platform == "win32"', 'pywin32; sys.platform == "win32"', - 'winrt==1.0.20239.1; sys.platform == "win32" and platform_release == "10" and python_version == "3.8"', - 'winrt; sys.platform == "win32" and platform_release == "10" and python_version >= "3.9"', + 'winrt; sys.platform == "win32"', "anki==" + anki_version, ], strip_path_prefixes = [