build: misc updates to repo (#180)

This commit is contained in:
Talley Lambert
2023-08-16 12:08:13 -04:00
committed by GitHub
parent dd9af3bfed
commit 9ff01e757b
9 changed files with 20 additions and 60 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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",
]

View File

@@ -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",
],
)

View File

@@ -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:

View File

@@ -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])

View File

@@ -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)