From 0fd25aa66540335c949efd5873bc8f665ba7e4b6 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 10 Oct 2023 13:27:07 -0400 Subject: [PATCH 01/11] chore: changelog v0.6.1 --- CHANGELOG.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a9e73..c00dd1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [v0.6.1](https://github.com/pyapp-kit/superqt/tree/v0.6.1) (2023-10-10) + +[Full Changelog](https://github.com/pyapp-kit/superqt/compare/v0.6.0...v0.6.1) + +**Implemented enhancements:** + +- feat: add QIcon backed by iconify [\#209](https://github.com/pyapp-kit/superqt/pull/209) ([tlambert03](https://github.com/tlambert03)) + +**Merged pull requests:** + +- ci: test python 3.12 [\#181](https://github.com/pyapp-kit/superqt/pull/181) ([tlambert03](https://github.com/tlambert03)) + ## [v0.6.0](https://github.com/pyapp-kit/superqt/tree/v0.6.0) (2023-09-25) [Full Changelog](https://github.com/pyapp-kit/superqt/compare/v0.5.4...v0.6.0) @@ -370,13 +382,17 @@ ## [v0.2.1](https://github.com/pyapp-kit/superqt/tree/v0.2.1) (2021-07-10) -[Full Changelog](https://github.com/pyapp-kit/superqt/compare/v0.2.0...v0.2.1) +[Full Changelog](https://github.com/pyapp-kit/superqt/compare/v0.2.0rc0...v0.2.1) **Fixed bugs:** - Fix QLabeledRangeSlider API \(fix slider proxy\) [\#10](https://github.com/pyapp-kit/superqt/pull/10) ([tlambert03](https://github.com/tlambert03)) - Fix range slider with negative min range [\#9](https://github.com/pyapp-kit/superqt/pull/9) ([tlambert03](https://github.com/tlambert03)) +## [v0.2.0rc0](https://github.com/pyapp-kit/superqt/tree/v0.2.0rc0) (2021-06-26) + +[Full Changelog](https://github.com/pyapp-kit/superqt/compare/v0.2.0...v0.2.0rc0) + \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* From 3efafd7aa86081f0b9260e1b195f2f47467390d9 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 10 Oct 2023 16:52:08 -0400 Subject: [PATCH 02/11] fix: remove old dep (#212) --- examples/code_highlight.py | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/code_highlight.py b/examples/code_highlight.py index a601af4..6706937 100644 --- a/examples/code_highlight.py +++ b/examples/code_highlight.py @@ -1,4 +1,4 @@ -from PyQt5.QtGui import QColor, QPalette +from qtpy.QtGui import QColor, QPalette from qtpy.QtWidgets import QApplication, QTextEdit from superqt.utils import CodeSyntaxHighlight diff --git a/pyproject.toml b/pyproject.toml index fd8847e..08cf5f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,6 @@ classifiers = [ ] dynamic = ["version"] dependencies = [ - "packaging", "pygments>=2.4.0", "qtpy>=1.1.0", "typing-extensions >=3.7.4.3,!=3.10.0.0", From bd6899133fbbf6efff9fe9eabc05bae20b1f92f3 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 23 Oct 2023 11:20:59 -0400 Subject: [PATCH 03/11] feat: icon.name() (#213) --- src/superqt/iconify/__init__.py | 8 ++++++++ tests/test_iconify.py | 1 + 2 files changed, 9 insertions(+) diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index 92fbb81..8932270 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -71,5 +71,13 @@ class QIconifyIcon(QIcon): "Please install it with `pip install pyconify` or use the " "`pip install superqt[iconify]` extra." ) from e + if len(key) == 1: + self._name = key[0] + else: + self._name = ":".join(key) self.path = svg_path(*key, color=color, flip=flip, rotate=rotate, dir=dir) super().__init__(str(self.path)) + + def name(self) -> str: + """Return the iconify `prefix:icon` represented by this QIcon.""" + return self._name diff --git a/tests/test_iconify.py b/tests/test_iconify.py index 991c5b8..3bcb167 100644 --- a/tests/test_iconify.py +++ b/tests/test_iconify.py @@ -15,6 +15,7 @@ def test_qiconify(qtbot: "QtBot", monkeypatch: "pytest.MonkeyPatch") -> None: icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90) assert icon.path.name.endswith(".svg") + assert icon.name() == "bi:alarm-fill" btn = QPushButton() qtbot.addWidget(btn) From 570c2613682c34435ad13637d3f77a2ab5cd447a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:36:08 -0500 Subject: [PATCH 04/11] ci: [pre-commit.ci] autoupdate (#216) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/psf/black: 23.9.1 → 23.10.1](https://github.com/psf/black/compare/23.9.1...23.10.1) - [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.292...v0.1.4) - [github.com/abravalheri/validate-pyproject: v0.14 → v0.15](https://github.com/abravalheri/validate-pyproject/compare/v0.14...v0.15) - [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.6.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.1...v1.6.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eff6ece..3b5007b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,30 +5,30 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-docstring-first - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.10.1 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.292 + rev: v0.1.4 hooks: - id: ruff args: ["--fix"] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.14 + rev: v0.15 hooks: - id: validate-pyproject - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 + rev: v1.6.1 hooks: - id: mypy exclude: tests|examples From c9103e3dd8a813f0af78644c6cb45a6457700534 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 6 Nov 2023 18:36:36 -0500 Subject: [PATCH 05/11] ci: use reusable test workflow (#215) * ci: try resuable * style: [pre-commit.ci] auto fixes [...] * remove x * fix cov * update * update --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/test_and_deploy.yml | 122 +++++++------------------- pyproject.toml | 5 +- 2 files changed, 35 insertions(+), 92 deletions(-) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 2e26b9d..69176ec 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -6,19 +6,23 @@ concurrency: on: push: - branches: - - main - tags: - - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 + branches: [main] + tags: [v*] pull_request: - branches: - - main workflow_dispatch: + schedule: + - cron: "0 0 * * 0" # run weekly jobs: test: - name: ${{ matrix.platform }} py${{ matrix.python-version }} ${{ matrix.backend }} - runs-on: ${{ matrix.platform }} + name: Test + uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v1 + with: + os: ${{ matrix.platform }} + python-version: ${{ matrix.python-version }} + qt: ${{ matrix.backend }} + pip-install-pre-release: ${{ github.event_name == 'schedule' }} + report-failures: ${{ github.event_name == 'schedule' }} strategy: fail-fast: false matrix: @@ -62,96 +66,34 @@ jobs: platform: ubuntu-latest backend: "pyqt5==5.14.*" - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - uses: tlambert03/setup-qt-libs@v1.4 - - - name: Linux opengl - if: runner.os == 'Linux' && ( startsWith(matrix.backend, 'pyside6') || startsWith(matrix.backend, 'pyqt6') ) - run: sudo apt-get install -y libopengl0 libegl1-mesa libxcb-xinput0 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e .[test] - python -m pip install ${{ matrix.backend }} - - - name: Test - uses: aganders3/headless-gui@v1.2 - with: - run: python -m pytest --color=yes --cov=superqt --cov-report=xml - - - name: Coverage - uses: codecov/codecov-action@v3 - - test_old_qtpy: - name: qtpy minreq - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: tlambert03/setup-qt-libs@v1.4 - - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: install - run: | - python -m pip install -U pip - python -m pip install -e .[test,pyqt5] - python -m pip install qtpy==1.1.0 typing-extensions==3.7.4.3 - - - name: Test - uses: aganders3/headless-gui@v1.2 - with: - run: python -m pytest --color=yes + test-qt-minreqs: + uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v1 + with: + python-version: "3.8" + qt: pyqt5 + pip-post-installs: 'qtpy==1.1.0 typing-extensions==3.7.4.3' test_napari: - name: napari tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - path: superqt - - - uses: actions/checkout@v4 - with: - repository: napari/napari - path: napari-repo - fetch-depth: 2 - - - uses: tlambert03/setup-qt-libs@v1 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: install - run: | - python -m pip install -U pip - python -m pip install ./superqt - python -m pip install ./napari-repo[testing,pyqt5] - - - name: Test napari - uses: aganders3/headless-gui@v1.2 - with: - working-directory: napari-repo - run: python -m pytest --color=yes napari/_qt + uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@v1 + with: + dependency-repo: napari/napari + dependency-ref: ${{ matrix.napari-version }} + dependency-extras: 'testing' + qt: ${{ matrix.qt }} + pytest-args: 'napari/_qt -k "not async and not qt_dims_2"' + python-version: "3.10" + strategy: + fail-fast: false + matrix: + napari-version: ["", "v0.4.18"] + qt: ["pyqt5", "pyside2"] check-manifest: name: Check Manifest runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - run: pip install check-manifest && check-manifest + - run: pipx run check-manifest deploy: # this will run when you have tagged a commit, starting with "v*" diff --git a/pyproject.toml b/pyproject.toml index 08cf5f6..6d20250 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -186,7 +186,7 @@ allow_redefinition = true # https://coverage.readthedocs.io/en/6.4/config.html [tool.coverage.run] -source = ["src/superqt"] +source = ["superqt"] [tool.coverage.report] exclude_lines = [ @@ -194,7 +194,8 @@ exclude_lines = [ "if TYPE_CHECKING:", "@overload", "except ImportError", - "\\.\\.\\." + "\\.\\.\\.", + "pass" ] # https://github.com/mgedmin/check-manifest#configuration From 61e7409b1cc61ec0030be4d9030ae40ebfa486bb Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 7 Nov 2023 07:44:19 -0500 Subject: [PATCH 06/11] fix: better default size policy for qcollapsible (#217) * fix: better default size policy for qcollapsible * fix: fix annotations --- src/superqt/collapsible/_collapsible.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/superqt/collapsible/_collapsible.py b/src/superqt/collapsible/_collapsible.py index 7bd53c0..89d8551 100644 --- a/src/superqt/collapsible/_collapsible.py +++ b/src/superqt/collapsible/_collapsible.py @@ -1,5 +1,5 @@ """A collapsible widget to hide and unhide child widgets.""" -from typing import Optional, Union +from __future__ import annotations from qtpy.QtCore import ( QEasingCurve, @@ -12,7 +12,7 @@ from qtpy.QtCore import ( Signal, ) from qtpy.QtGui import QIcon, QPainter, QPalette, QPixmap -from qtpy.QtWidgets import QFrame, QPushButton, QVBoxLayout, QWidget +from qtpy.QtWidgets import QFrame, QPushButton, QSizePolicy, QVBoxLayout, QWidget class QCollapsible(QFrame): @@ -28,9 +28,9 @@ class QCollapsible(QFrame): def __init__( self, title: str = "", - parent: Optional[QWidget] = None, - expandedIcon: Optional[Union[QIcon, str]] = "▼", - collapsedIcon: Optional[Union[QIcon, str]] = "▲", + parent: QWidget | None = None, + expandedIcon: QIcon | str | None = "▼", + collapsedIcon: QIcon | str | None = "▲", ): super().__init__(parent) self._locked = False @@ -41,13 +41,15 @@ class QCollapsible(QFrame): self._toggle_btn.setCheckable(True) self.setCollapsedIcon(icon=collapsedIcon) self.setExpandedIcon(icon=expandedIcon) + self.setSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Maximum) + self._toggle_btn.setStyleSheet("text-align: left; border: none; outline: none;") self._toggle_btn.toggled.connect(self._toggle) # frame layout - self.setLayout(QVBoxLayout()) - self.layout().setAlignment(Qt.AlignmentFlag.AlignTop) - self.layout().addWidget(self._toggle_btn) + layout = QVBoxLayout(self) + layout.setAlignment(Qt.AlignmentFlag.AlignTop) + layout.addWidget(self._toggle_btn) # Create animators self._animation = QPropertyAnimation(self) @@ -98,7 +100,7 @@ class QCollapsible(QFrame): """Returns the icon used when the widget is expanded.""" return self._expanded_icon - def setExpandedIcon(self, icon: Optional[Union[QIcon, str]] = None) -> None: + def setExpandedIcon(self, icon: QIcon | str | None = None) -> None: """Set the icon on the toggle button when the widget is expanded.""" if icon and isinstance(icon, QIcon): self._expanded_icon = icon @@ -112,7 +114,7 @@ class QCollapsible(QFrame): """Returns the icon used when the widget is collapsed.""" return self._collapsed_icon - def setCollapsedIcon(self, icon: Optional[Union[QIcon, str]] = None) -> None: + def setCollapsedIcon(self, icon: QIcon | str | None = None) -> None: """Set the icon on the toggle button when the widget is collapsed.""" if icon and isinstance(icon, QIcon): self._collapsed_icon = icon @@ -126,7 +128,7 @@ class QCollapsible(QFrame): """Set duration of the collapse/expand animation.""" self._animation.setDuration(msecs) - def setEasingCurve(self, easing: QEasingCurve) -> None: + def setEasingCurve(self, easing: QEasingCurve | QEasingCurve.Type) -> None: """Set the easing curve for the collapse/expand animation.""" self._animation.setEasingCurve(easing) From b927159f49104a8cb90f205d4b82d7ed89a7e1cc Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 8 Nov 2023 12:52:41 -0500 Subject: [PATCH 07/11] feat: add addKey method to QIconifyIcon (#218) * feat: addKey method to Iconify * style: [pre-commit.ci] auto fixes [...] * remove breakpoint --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/superqt/iconify/__init__.py | 71 ++++++++++++++++++++++++++------- tests/test_iconify.py | 6 +-- 2 files changed, 60 insertions(+), 17 deletions(-) diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index 8932270..7549cfe 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations from typing import TYPE_CHECKING +from qtpy.QtCore import QSize from qtpy.QtGui import QIcon if TYPE_CHECKING: @@ -10,6 +11,11 @@ if TYPE_CHECKING: Flip = Literal["horizontal", "vertical", "horizontal,vertical"] Rotation = Literal["90", "180", "270", 90, 180, 270, "-90", 1, 2, 3] +try: + from pyconify import svg_path +except ModuleNotFoundError: # pragma: no cover + svg_path = None + class QIconifyIcon(QIcon): """QIcon backed by an iconify icon. @@ -27,6 +33,9 @@ class QIconifyIcon(QIcon): SVGs are cached to disk, and persist across sessions (until `pyconify.clear_cache()` is called). + Parameters are the same as `QIconifyIcon.addKey`, which can be used to add + additional icons for various modes and states to the same QIcon. + Parameters ---------- *key: str @@ -63,21 +72,55 @@ class QIconifyIcon(QIcon): rotate: Rotation | None = None, dir: str | None = None, ): - try: - from pyconify import svg_path - except ModuleNotFoundError as e: # pragma: no cover - raise ImportError( + if svg_path is None: # pragma: no cover + raise ModuleNotFoundError( "pyconify is required to use QIconifyIcon. " "Please install it with `pip install pyconify` or use the " "`pip install superqt[iconify]` extra." - ) from e - if len(key) == 1: - self._name = key[0] - else: - self._name = ":".join(key) - self.path = svg_path(*key, color=color, flip=flip, rotate=rotate, dir=dir) - super().__init__(str(self.path)) + ) + super().__init__() + self.addKey(*key, color=color, flip=flip, rotate=rotate, dir=dir) - def name(self) -> str: - """Return the iconify `prefix:icon` represented by this QIcon.""" - return self._name + def addKey( + self, + *key: str, + color: str | None = None, + flip: Flip | None = None, + rotate: Rotation | None = None, + dir: str | None = None, + size: QSize | None = None, + mode: QIcon.Mode = QIcon.Mode.Normal, + state: QIcon.State = QIcon.State.Off, + ) -> None: + """Add an icon to this QIcon. + + This is a variant of `QIcon.addFile` that uses an iconify icon keys and + arguments instead of a file path. + + Parameters + ---------- + *key: str + Icon set prefix and name. May be passed as a single string in the format + `"prefix:name"` or as two separate strings: `'prefix', 'name'`. + color : str, optional + Icon color. If not provided, the icon will appear black (the icon fill color + will be set to the string "currentColor"). + flip : str, optional + Flip icon. Must be one of "horizontal", "vertical", "horizontal,vertical" + rotate : str | int, optional + Rotate icon. Must be one of 0, 90, 180, 270, or 0, 1, 2, 3 (equivalent to 0, + 90, 180, 270, respectively) + dir : str, optional + If 'dir' is not None, the file will be created in that directory, otherwise + a default + [directory](https://docs.python.org/3/library/tempfile.html#tempfile.mkstemp) + is used. + size : QSize, optional + Size specified for the icon, passed to `QIcon.addFile`. + mode : QIcon.Mode, optional + Mode specified for the icon, passed to `QIcon.addFile`. + state : QIcon.State, optional + State specified for the icon, passed to `QIcon.addFile`. + """ + path = svg_path(*key, color=color, flip=flip, rotate=rotate, dir=dir) + self.addFile(str(path), size or QSize(), mode, state) diff --git a/tests/test_iconify.py b/tests/test_iconify.py index 3bcb167..4c5a2cc 100644 --- a/tests/test_iconify.py +++ b/tests/test_iconify.py @@ -1,6 +1,7 @@ from typing import TYPE_CHECKING import pytest +from qtpy.QtGui import QIcon from qtpy.QtWidgets import QPushButton from superqt import QIconifyIcon @@ -13,9 +14,8 @@ def test_qiconify(qtbot: "QtBot", monkeypatch: "pytest.MonkeyPatch") -> None: monkeypatch.setenv("PYCONIFY_CACHE", "0") pytest.importorskip("pyconify") - icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90) - assert icon.path.name.endswith(".svg") - assert icon.name() == "bi:alarm-fill" + icon = QIconifyIcon("bi:alarm-fill", color="red", flip="vertical") + icon.addKey("bi:alarm", color="blue", rotate=90, state=QIcon.State.On) btn = QPushButton() qtbot.addWidget(btn) From ef876856267ba869daf02dcd590d2d0e01059ec9 Mon Sep 17 00:00:00 2001 From: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> Date: Sat, 25 Nov 2023 13:29:48 -0500 Subject: [PATCH 08/11] Bugfix: Check min max versus current value (#221) * Check min max vs value * add test * style: [pre-commit.ci] auto fixes [...] * test min too * check that max > min per Qt * update test --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/superqt/spinbox/_intspin.py | 6 ++++++ tests/test_large_int_spinbox.py | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/superqt/spinbox/_intspin.py b/src/superqt/spinbox/_intspin.py index 5ead23d..2951768 100644 --- a/src/superqt/spinbox/_intspin.py +++ b/src/superqt/spinbox/_intspin.py @@ -65,14 +65,20 @@ class QLargeIntSpinBox(QAbstractSpinBox): def setMinimum(self, min): self._minimum = int(min) + if self._minimum > self._value: + self.setValue(self._minimum) def maximum(self): return self._maximum def setMaximum(self, max): self._maximum = int(max) + if self._maximum < self._value: + self.setValue(self._maximum) def setRange(self, minimum, maximum): + if maximum < minimum: + maximum = minimum self.setMinimum(minimum) self.setMaximum(maximum) diff --git a/tests/test_large_int_spinbox.py b/tests/test_large_int_spinbox.py index d7578e1..08612c5 100644 --- a/tests/test_large_int_spinbox.py +++ b/tests/test_large_int_spinbox.py @@ -22,6 +22,24 @@ def test_large_spinbox(qtbot): assert sb.value() == -(10**e) +def test_large_spinbox_range(qtbot): + sb = QLargeIntSpinBox() + qtbot.addWidget(sb) + sb.setRange(-100, 100) + sb.setValue(50) + + sb.setRange(-10, 10) + assert sb.value() == 10 + + sb.setRange(100, 1000) + assert sb.value() == 100 + + sb.setRange(50, 0) + assert sb.minimum() == 50 + assert sb.maximum() == 50 + assert sb.value() == 50 + + def test_large_spinbox_type(qtbot): sb = QLargeIntSpinBox() qtbot.addWidget(sb) From 95b1178647a7a982929fafb3cdbd4700c99d4a68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:15:47 -0500 Subject: [PATCH 09/11] ci(dependabot): bump actions/setup-python from 4 to 5 (#225) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test_and_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 69176ec..8d9fe53 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -107,7 +107,7 @@ jobs: with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install dependencies From b4d3a4f9b75de450ee7e9359887c34e2d13df72e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 28 Dec 2023 12:03:21 -0500 Subject: [PATCH 10/11] ci: [pre-commit.ci] autoupdate (#223) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.10.1 → 23.11.0](https://github.com/psf/black/compare/23.10.1...23.11.0) - [github.com/astral-sh/ruff-pre-commit: v0.1.4 → v0.1.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.4...v0.1.6) - [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.7.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.7.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3b5007b..f39ab4a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,12 +12,12 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.11.0 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.1.6 hooks: - id: ruff args: ["--fix"] @@ -28,7 +28,7 @@ repos: - id: validate-pyproject - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.7.1 hooks: - id: mypy exclude: tests|examples From 60188de52e9fd34ccf38fdd5089339a6489cf5c8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:09:23 -0500 Subject: [PATCH 11/11] ci: [pre-commit.ci] autoupdate (#228) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.11.0 → 23.12.1](https://github.com/psf/black/compare/23.11.0...23.12.1) - [github.com/astral-sh/ruff-pre-commit: v0.1.6 → v0.1.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.6...v0.1.9) - [github.com/pre-commit/mirrors-mypy: v1.7.1 → v1.8.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.1...v1.8.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f39ab4a..70cfbb1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,12 +12,12 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 23.12.1 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.6 + rev: v0.1.9 hooks: - id: ruff args: ["--fix"] @@ -28,7 +28,7 @@ repos: - id: validate-pyproject - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.1 + rev: v1.8.0 hooks: - id: mypy exclude: tests|examples