From a2eeb67198c98526cb9b19630546dc25ecf0e1a6 Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Mon, 6 Jul 2026 11:08:54 +0200 Subject: [PATCH 1/3] update python versions support Remove support for python 3.7, 3.8, 3.9. Add support for python 3.14. Signed-off-by: Heiko Thiery --- .github/workflows/test.yml | 2 +- README.rst | 2 +- setup.py | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7997048..f4470bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.8", "pypy3.9", "pypy3.10"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.10"] steps: - uses: actions/checkout@v3 diff --git a/README.rst b/README.rst index 2473e48..62d5b4b 100644 --- a/README.rst +++ b/README.rst @@ -119,7 +119,7 @@ ipmitool command: Compatibility ------------- -Python > 3.6 is currently supported. Python 2.x is deprecated. +Python >= 3.10 is currently supported. Python 2.x is deprecated. Contributing ------------ diff --git a/setup.py b/setup.py index d83a7f9..b5035f6 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ def git_pep440_version(): packages=find_packages(exclude=['tests*']), license='LGPLv2+', platforms=["any"], + python_requires='>=3.10', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', @@ -56,13 +57,11 @@ def git_pep440_version(): 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - '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', + 'Programming Language :: Python :: 3.14', 'Topic :: Software Development :: Libraries :: Python Modules', ], entry_points={ From 7ca3865fe5b9da284fa069afcef8c9f433fa748b Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Mon, 6 Jul 2026 11:13:32 +0200 Subject: [PATCH 2/3] .github: bump used ubuntu version to 24.04 Signed-off-by: Heiko Thiery --- .github/workflows/check-dco.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-dco.yml b/.github/workflows/check-dco.yml index 53d4fcf..b9b149b 100644 --- a/.github/workflows/check-dco.yml +++ b/.github/workflows/check-dco.yml @@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch] jobs: check-dco: name: Check Developer's Certificate of Origin - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 26a3513..2c47a4d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch] jobs: lint: name: Lint with flake8 - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 61bc3cd..e6a1db5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,7 @@ on: jobs: deploy: name: Publish to Pypi - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4470bd..6a75a03 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch] jobs: tests: name: Python ${{ matrix.python-version }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: @@ -38,7 +38,7 @@ jobs: finish: needs: tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Coveralls Finished uses: coverallsapp/github-action@master From ab74891fffbb43221b878a532d9068379f57f21f Mon Sep 17 00:00:00 2001 From: Heiko Thiery Date: Mon, 6 Jul 2026 11:19:08 +0200 Subject: [PATCH 3/3] pyipmi/utils.py: get rid of _PY3 checks Signed-off-by: Heiko Thiery --- pyipmi/utils.py | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/pyipmi/utils.py b/pyipmi/utils.py index 929da93..b8edaa4 100644 --- a/pyipmi/utils.py +++ b/pyipmi/utils.py @@ -16,7 +16,6 @@ from __future__ import annotations -import sys import codecs from array import array from typing import Any, Generator, TYPE_CHECKING @@ -30,35 +29,22 @@ from .msgs import Message -_PY3 = (sys.version_info >= (3,)) - - def py3enc_unic_bytes_fix(dat: Any) -> Any: - # python 3 unicode fix - if isinstance(dat, str) and _PY3: + if isinstance(dat, str): dat = dat.encode('raw_unicode_escape') return dat def py3dec_unic_bytes_fix(dat: bytes) -> str: - # python 3 unicode fix - if _PY3: - return dat.decode('raw_unicode_escape') - return dat + return dat.decode('raw_unicode_escape') def py3_array_frombytes(msg: array, data: bytes) -> None: - if _PY3: - return msg.frombytes(data) - else: - return msg.fromstring(data) + return msg.frombytes(data) def py3_array_tobytes(msg: array) -> bytes: - if _PY3: - return msg.tobytes() - else: - return msg.tostring() + return msg.tobytes() def check_completion_code(cc: int) -> None: @@ -112,7 +98,7 @@ def pop_unsigned_int(self, length: int) -> int: return value def push_string(self, value: str | bytes) -> None: - if _PY3 and isinstance(value, str): + if isinstance(value, str): # Encode Unicode to UTF-8 value = value.encode() py3_array_frombytes(self.array, value) @@ -121,7 +107,6 @@ def pop_string(self, length: int) -> bytes: string = self.array[0:length] del self.array[0:length] return py3_array_tobytes(string) - # return py3dec_unic_bytes_fix(string.tostring()) def pop_slice(self, length: int) -> ByteBuffer: if len(self.array) < length: @@ -167,8 +152,6 @@ def bcd_decode(encoded_input: Any) -> tuple[str, int]: chars = list() try: for data in encoded_input: - if not _PY3: - data = ord(data) chars.append(BCD_MAP[data >> 4 & 0xf] + BCD_MAP[data & 0xf]) return (''.join(chars), len(encoded_input) * 2) except IndexError: @@ -183,5 +166,4 @@ def bcd_search(name: str) -> codecs.CodecInfo | None: def is_string(string: Any) -> bool: - if _PY3: - return isinstance(string, str) + return isinstance(string, str)