Skip to content

Commit 07fd2bd

Browse files
authored
chore(lib): warn about non-preferred-qt-version (#373)
Closes #371
1 parent d586dab commit 07fd2bd

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

manim_slides/present/__init__.py

+19
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@
1111
from ..config import Config, PresentationConfig
1212
from ..logger import logger
1313

14+
PREFERRED_QT_VERSIONS = ("6.5.1", "6.5.2")
15+
16+
17+
def warn_if_non_desirable_pyside6_version() -> None:
18+
from qtpy import API, QT_VERSION
19+
20+
if sys.version_info < (3, 12) and (
21+
API != "pyside6" or QT_VERSION not in PREFERRED_QT_VERSIONS
22+
):
23+
logger.warn(
24+
f"You are using {API = }, {QT_VERSION = }, "
25+
"but we recommend installing 'PySide6==6.5.2', mainly to avoid "
26+
"flashing screens between slides, "
27+
"see issue https://github.com/jeertmans/manim-slides/issues/293. "
28+
"You can do so with `pip install 'manim-slides[pyside6]'`."
29+
)
30+
1431

1532
@click.command()
1633
@folder_path_option
@@ -276,6 +293,8 @@ def present(
276293
if start_at[1]:
277294
start_at_slide_number = start_at[1]
278295

296+
warn_if_non_desirable_pyside6_version()
297+
279298
from ..qt_utils import qapp
280299

281300
app = qapp()

pyproject.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ filterwarnings = [
126126

127127
[tool.ruff]
128128
extend-exclude = ["manim_slides/resources.py"]
129+
extend-include = ["*.ipynb"]
130+
line-length = 88
131+
target-version = "py38"
132+
133+
[tool.ruff.lint]
129134
extend-ignore = [
130135
"D100",
131136
"D101",
@@ -140,8 +145,5 @@ extend-ignore = [
140145
"D212",
141146
"E501",
142147
]
143-
extend-include = ["*.ipynb"]
144148
extend-select = ["B", "C90", "D", "I", "N", "RUF", "UP", "T"]
145149
isort = {known-first-party = ["manim_slides", "tests"]}
146-
line-length = 88
147-
target-version = "py38"

0 commit comments

Comments
 (0)