Restore Python 3.10 compatibility

This commit is contained in:
Lucian Petrut
2026-09-09 08:54:22 +00:00
parent f64c753d9c
commit 1e5b2d70a5
6 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -33,7 +33,7 @@
## Architecture ## Architecture
- The project uses Python and must be Python 3.12 compatible. - The project uses Python and must be Python 3.12 and Python 3.10 compatible.
- Library code lives in the `openvixdisklib` package (`nfc_auth`, `nfc_open`, - Library code lives in the `openvixdisklib` package (`nfc_auth`, `nfc_open`,
`openvixdisklib`). `openvixdisklib`).
- The `.vddk` dir contains the VDDK libraries and their dependencies, including - The `.vddk` dir contains the VDDK libraries and their dependencies, including
+3 -1
View File
@@ -22,10 +22,12 @@ Not implemented: compression open flags other than FastLZ, CBT /
allocated-block queries, disk geometry (`DDB_GET`), encrypted disks, allocated-block queries, disk geometry (`DDB_GET`), encrypted disks,
and direct ESXi `ha-nfc` without vCenter `vpxa-nfc`. and direct ESXi `ha-nfc` without vCenter `vpxa-nfc`.
Requires Python 3.10 or later.
## Install ## Install
```bash ```bash
python3.12 -m venv .venv python3 -m venv .venv
.venv/bin/pip install -e . .venv/bin/pip install -e .
``` ```
+1 -2
View File
@@ -21,7 +21,6 @@ import contextlib
import hashlib import hashlib
import socket import socket
import ssl import ssl
from typing import Self
from pyVim.connect import Disconnect, SmartConnect from pyVim.connect import Disconnect, SmartConnect
from pyVmomi import vim from pyVmomi import vim
@@ -395,7 +394,7 @@ class NfcAuthSession:
finally: finally:
Disconnect(self.si) Disconnect(self.si)
def __enter__(self) -> Self: def __enter__(self) -> NfcAuthSession:
return self return self
def __exit__(self, exc_type, exc, tb) -> None: def __exit__(self, exc_type, exc, tb) -> None:
+1 -2
View File
@@ -25,7 +25,6 @@ import os
import socket import socket
import ssl import ssl
import struct import struct
from typing import Self
from openvixdisklib import fastlz from openvixdisklib import fastlz
from openvixdisklib.nfc_auth import NfcAuthSession, _ssl_client_context from openvixdisklib.nfc_auth import NfcAuthSession, _ssl_client_context
@@ -385,7 +384,7 @@ class NfcDisk:
except OSError: except OSError:
pass pass
def __enter__(self) -> Self: def __enter__(self) -> NfcDisk:
return self return self
def __exit__(self, exc_type, exc, tb) -> None: def __exit__(self, exc_type, exc, tb) -> None:
+3 -2
View File
@@ -1,5 +1,5 @@
line-length = 88 line-length = 88
target-version = "py312" target-version = "py310"
[lint] [lint]
# UP031: Allow percent formatting for now. # UP031: Allow percent formatting for now.
@@ -8,4 +8,5 @@ target-version = "py312"
# BLE001: we'll allow catching Exception for now. # BLE001: we'll allow catching Exception for now.
# RUF015: enforces next() to be used when getting the first item of a list, # RUF015: enforces next() to be used when getting the first item of a list,
# may be enabled at a later time. # may be enabled at a later time.
ignore = ["UP031", "PIE790", "RUF100", "BLE001", "RUF015"] # PYI034: typing.Self requires Python 3.11; return the class instead.
ignore = ["UP031", "PIE790", "RUF100", "BLE001", "RUF015", "PYI034"]
+3
View File
@@ -14,7 +14,10 @@ classifier =
Operating System :: OS Independent Operating System :: OS Independent
Programming Language :: Python Programming Language :: Python
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12 Programming Language :: Python :: 3.12
python-requires = >=3.10
[files] [files]
packages = packages =