diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index a7a4307..5be982a 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -1,5 +1,9 @@ name: Test +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: push: branches: @@ -43,14 +47,6 @@ jobs: platform: windows-latest backend: pyside6 - # python 3.7 - - python-version: 3.7 - platform: macos-latest - backend: pyqt5 - - python-version: 3.7 - platform: windows-latest - backend: pyside2 - # legacy Qt - python-version: 3.8 platform: ubuntu-latest @@ -63,11 +59,6 @@ jobs: backend: "pyqt5==5.14.*" steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ github.token }} - - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -167,6 +158,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3782896..bd805ff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ pytest All widgets must be well-tested, and should work on: -- Python 3.7 and above +- Python 3.8 and above - PyQt5 (5.11 and above) & PyQt6 - PySide2 (5.11 and above) & PySide6 - macOS, Windows, & Linux diff --git a/README.md b/README.md index 4d08442..7426b94 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ that are not provided in the native QtWidgets module. Components are tested on: - macOS, Windows, & Linux -- Python 3.7 and above +- Python 3.8 and above - PyQt5 (5.11 and above) & PyQt6 - PySide2 (5.11 and above) & PySide6 diff --git a/docs/index.md b/docs/index.md index 3d9b860..c04534f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,7 +10,7 @@ QtWidgets module. Components are tested on: - macOS, Windows, & Linux -- Python 3.7 and above +- Python 3.8 and above - PyQt5 (5.11 and above) & PyQt6 - PySide2 (5.11 and above) & PySide6 diff --git a/pyproject.toml b/pyproject.toml index b67e830..b45abf1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,9 +8,9 @@ build-backend = "hatchling.build" name = "superqt" description = "Missing widgets and components for PyQt/PySide" readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.8" license = { text = "BSD 3-Clause License" } -authors = [{ email = "talley.lambert@gmail.com" }, { name = "Talley Lambert" }] +authors = [{ email = "talley.lambert@gmail.com", name = "Talley Lambert" }] keywords = [ "qt", "pyqt", @@ -28,7 +28,6 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -93,19 +92,21 @@ src_paths = ["src/superqt", "tests"] # https://github.com/charliermarsh/ruff [tool.ruff] line-length = 88 -target-version = "py37" +target-version = "py38" src = ["src", "tests"] select = [ "E", # style errors "F", # flakes + "W", # flakes "D", # pydocstyle "I", # isort "UP", # pyupgrade "S", # bandit - "C", # flake8-comprehensions + "C4", # flake8-comprehensions "B", # flake8-bugbear "A001", # flake8-builtins "RUF", # ruff-specific rules + "TID", # tidy imports ] ignore = [ "D100", # Missing docstring in public module @@ -118,7 +119,6 @@ ignore = [ "D401", # First line should be in imperative mood "D413", # Missing blank line after last section "D416", # Section name should end with a colon - "C901", # Function is too complex ] @@ -180,5 +180,4 @@ ignore = [ "CONTRIBUTING.md", "codecov.yml", ".ruff_cache/**/*", - "setup.py", ] diff --git a/setup.py b/setup.py deleted file mode 100644 index 57275ee..0000000 --- a/setup.py +++ /dev/null @@ -1,29 +0,0 @@ -import sys - -sys.stderr.write( - """ -=============================== -Unsupported installation method -=============================== -superqt does not support installation with `python setup.py install`. -Please use `python -m pip install .` instead. -""" -) -sys.exit(1) - - -# The below code will never execute, however GitHub is particularly -# picky about where it finds Python packaging metadata. -# See: https://github.com/github/feedback/discussions/6456 -# -# To be removed once GitHub catches up. - -setup( # noqa: F821 - name="superqt", - install_requires=[ - "packaging", - "pygments>=2.4.0", - "qtpy>=1.1.0", - "typing-extensions", - ], -) diff --git a/src/superqt/__init__.py b/src/superqt/__init__.py index c61bc2c..be9e088 100644 --- a/src/superqt/__init__.py +++ b/src/superqt/__init__.py @@ -1,9 +1,10 @@ """superqt is a collection of Qt components for python.""" +from importlib.metadata import PackageNotFoundError, version from typing import TYPE_CHECKING, Any try: - from ._version import version as __version__ -except ImportError: + __version__ = version("superqt") +except PackageNotFoundError: __version__ = "unknown" if TYPE_CHECKING: diff --git a/tests/test_sliders/test_labeled_slider.py b/tests/test_sliders/test_labeled_slider.py index 25525e0..feaac1c 100644 --- a/tests/test_sliders/test_labeled_slider.py +++ b/tests/test_sliders/test_labeled_slider.py @@ -1,4 +1,3 @@ -import sys from typing import Any, Iterable from unittest.mock import Mock @@ -26,8 +25,7 @@ def test_slider_connect_works(qtbot): def _assert_types(args: Iterable[Any], type_: type): # sourcery skip: comprehension-to-generator - if sys.version_info >= (3, 8): - assert all(isinstance(v, type_) for v in args), "invalid type" + assert all(isinstance(v, type_) for v in args), "invalid type" @pytest.mark.parametrize("cls", [QLabeledDoubleSlider, QLabeledSlider]) diff --git a/tests/test_sliders/test_range_slider.py b/tests/test_sliders/test_range_slider.py index 87b5675..29bc08d 100644 --- a/tests/test_sliders/test_range_slider.py +++ b/tests/test_sliders/test_range_slider.py @@ -1,5 +1,4 @@ import math -import sys from itertools import product from typing import Any, Iterable from unittest.mock import Mock @@ -218,8 +217,7 @@ def test_wheel(cls, orientation, qtbot): def _assert_types(args: Iterable[Any], type_: type): # sourcery skip: comprehension-to-generator - if sys.version_info >= (3, 8): - assert all(isinstance(v, type_) for v in args), "invalid type" + assert all(isinstance(v, type_) for v in args), "invalid type" @pytest.mark.parametrize("cls, orientation", ALL_SLIDER_COMBOS)