From 5adb25a67e2b0f8a766782e07b262df499ef0101 Mon Sep 17 00:00:00 2001 From: Patrick Baus Date: Wed, 13 Aug 2025 14:18:54 +0200 Subject: [PATCH] Updated pyproject toml to reflect latest style - Added Python 3.13 as a supported Python version - Udpated pre-commit hooks - Fixed pylint errors due to changed rules --- .github/workflows/pre-commit.yml | 2 +- .github/workflows/publish-pypi.yml | 4 ++-- .github/workflows/publish-test-pypi.yml | 2 +- .github/workflows/pylint.yml | 2 +- .pre-commit-config.yaml | 17 ++++++++++------- async_gpib/async_gpib.py | 6 +++--- pyproject.toml | 5 ++--- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 44048ab..c20f571 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - python-version: [ "3.12" ] + python-version: [ "3.13" ] steps: - name: Checkout source repository diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 488b9ac..2020513 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - python-version: [ "3.12", ] + python-version: [ "3.13" ] steps: - name: Checkout source repository @@ -44,7 +44,7 @@ jobs: strategy: matrix: - python-version: [ "3.12" ] + python-version: [ "3.13" ] steps: - name: Checkout source repository diff --git a/.github/workflows/publish-test-pypi.yml b/.github/workflows/publish-test-pypi.yml index f95b990..8fe3281 100644 --- a/.github/workflows/publish-test-pypi.yml +++ b/.github/workflows/publish-test-pypi.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - python-version: [ "3.12" ] + python-version: [ "3.13" ] steps: - name: Checkout source repository diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 1a4b3fd..6413884 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: [ "3.10", "3.11", "3.12", "3.13" ] steps: - name: Checkout source repository diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a4fc209..04d593c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,32 +2,35 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v6.0.0 hooks: - id: check-executables-have-shebangs # Check for invalid files - id: check-toml # Check Python files - id: end-of-file-fixer - - id: fix-encoding-pragma - args: [--remove] + exclude: "^.*\\.bin$" - id: mixed-line-ending args: [ --fix=lf ] - id: check-executables-have-shebangs - id: requirements-txt-fixer - id: trailing-whitespace args: [ --markdown-linebreak-ext=md ] +- repo: https://github.com/asottile/pyupgrade + rev: v3.20.0 + hooks: + - id: pyupgrade - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 25.1.0 hooks: - id: black - repo: https://github.com/asottile/blacken-docs - rev: 1.16.0 + rev: 1.19.1 hooks: - id: blacken-docs args: [ --line-length=120 ] - repo: https://github.com/PyCQA/isort - rev: 5.13.2 + rev: 6.0.1 hooks: - id: isort - repo: local @@ -39,6 +42,6 @@ repos: types: [ python ] require_serial: true - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.10.0' + rev: 'v1.17.1' hooks: - id: mypy diff --git a/async_gpib/async_gpib.py b/async_gpib/async_gpib.py index daaa44b..aed1ae9 100644 --- a/async_gpib/async_gpib.py +++ b/async_gpib/async_gpib.py @@ -11,7 +11,7 @@ # Import either the Linux GPIB module or gpib_ctypes. Prefer Linux GPIB. from enum import Flag, unique from types import TracebackType -from typing import Any, Callable, Type +from typing import Any, Callable try: from typing import Self # type: ignore # Python 3.11 @@ -105,7 +105,7 @@ def sad(self) -> int: def __str__(self) -> str: return f"Linux-GPIB at Gpib({self.__name})" - def __init__( # pylint: disable=too-many-arguments + def __init__( # pylint: disable=too-many-arguments,too-many-positional-arguments self, name: int | str = "gpib0", pad: int | None = None, @@ -150,7 +150,7 @@ async def __aenter__(self) -> Self: return self async def __aexit__( - self, exc_type: Type[BaseException] | None, exc: BaseException | None, traceback: TracebackType | None + self, exc_type: type[BaseException] | None, exc: BaseException | None, traceback: TracebackType | None ) -> None: await self.disconnect() diff --git a/pyproject.toml b/pyproject.toml index 0d8412a..4164887 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,17 +5,16 @@ authors = [ ] description = "Python3 AsyncIO Linux GPIB wrapper" readme = "README.md" -license = { text="GNU General Public License v3 (GPLv3)" } +license = "GPL-3.0-only" requires-python = ">=3.7" classifiers = [ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Intended Audience :: Developers", "Intended Audience :: Science/Research",