Restore Python 3.10 compatibility
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
|
||||
## 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`,
|
||||
`openvixdisklib`).
|
||||
- The `.vddk` dir contains the VDDK libraries and their dependencies, including
|
||||
|
||||
@@ -22,10 +22,12 @@ Not implemented: compression open flags other than FastLZ, CBT /
|
||||
allocated-block queries, disk geometry (`DDB_GET`), encrypted disks,
|
||||
and direct ESXi `ha-nfc` without vCenter `vpxa-nfc`.
|
||||
|
||||
Requires Python 3.10 or later.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
python3.12 -m venv .venv
|
||||
python3 -m venv .venv
|
||||
.venv/bin/pip install -e .
|
||||
```
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import contextlib
|
||||
import hashlib
|
||||
import socket
|
||||
import ssl
|
||||
from typing import Self
|
||||
|
||||
from pyVim.connect import Disconnect, SmartConnect
|
||||
from pyVmomi import vim
|
||||
@@ -395,7 +394,7 @@ class NfcAuthSession:
|
||||
finally:
|
||||
Disconnect(self.si)
|
||||
|
||||
def __enter__(self) -> Self:
|
||||
def __enter__(self) -> NfcAuthSession:
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc, tb) -> None:
|
||||
|
||||
@@ -25,7 +25,6 @@ import os
|
||||
import socket
|
||||
import ssl
|
||||
import struct
|
||||
from typing import Self
|
||||
|
||||
from openvixdisklib import fastlz
|
||||
from openvixdisklib.nfc_auth import NfcAuthSession, _ssl_client_context
|
||||
@@ -385,7 +384,7 @@ class NfcDisk:
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def __enter__(self) -> Self:
|
||||
def __enter__(self) -> NfcDisk:
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc, tb) -> None:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
line-length = 88
|
||||
target-version = "py312"
|
||||
target-version = "py310"
|
||||
|
||||
[lint]
|
||||
# UP031: Allow percent formatting for now.
|
||||
@@ -8,4 +8,5 @@ target-version = "py312"
|
||||
# BLE001: we'll allow catching Exception for now.
|
||||
# RUF015: enforces next() to be used when getting the first item of a list,
|
||||
# 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"]
|
||||
|
||||
@@ -14,7 +14,10 @@ classifier =
|
||||
Operating System :: OS Independent
|
||||
Programming Language :: Python
|
||||
Programming Language :: Python :: 3
|
||||
Programming Language :: Python :: 3.10
|
||||
Programming Language :: Python :: 3.11
|
||||
Programming Language :: Python :: 3.12
|
||||
python-requires = >=3.10
|
||||
|
||||
[files]
|
||||
packages =
|
||||
|
||||
Reference in New Issue
Block a user