Remove Python 3.10 requirement
This commit is contained in:
parent
fddd77e6fd
commit
cf7ed909b3
5 changed files with 23 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ from . import log
|
||||||
from . import main
|
from . import main
|
||||||
from . import music
|
from . import music
|
||||||
from . import net
|
from . import net
|
||||||
|
from . import python
|
||||||
from . import repairs
|
from . import repairs
|
||||||
from . import setup
|
from . import setup
|
||||||
from . import sources
|
from . import sources
|
||||||
|
|
|
||||||
14
scripts/wk/cfg/python.py
Normal file
14
scripts/wk/cfg/python.py
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
"""WizardKit: Config - Python"""
|
||||||
|
# vim: sts=2 sw=2 ts=2
|
||||||
|
|
||||||
|
from sys import version_info
|
||||||
|
|
||||||
|
DATACLASS_DECORATOR_KWARGS = {}
|
||||||
|
if version_info.major >= 3 and version_info.minor >= 10:
|
||||||
|
DATACLASS_DECORATOR_KWARGS['slots'] = True
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
print("This file is not meant to be called directly.")
|
||||||
|
|
||||||
|
# vim: sts=2 sw=2 ts=2
|
||||||
|
|
@ -10,6 +10,7 @@ from dataclasses import dataclass, field
|
||||||
from typing import Any, Union
|
from typing import Any, Union
|
||||||
|
|
||||||
from wk.cfg.main import KIT_NAME_SHORT
|
from wk.cfg.main import KIT_NAME_SHORT
|
||||||
|
from wk.cfg.python import DATACLASS_DECORATOR_KWARGS
|
||||||
from wk.exe import get_json_from_command, run_program
|
from wk.exe import get_json_from_command, run_program
|
||||||
from wk.hw.test import Test
|
from wk.hw.test import Test
|
||||||
from wk.hw.smart import (
|
from wk.hw.smart import (
|
||||||
|
|
@ -29,7 +30,7 @@ WK_LABEL_REGEX = re.compile(
|
||||||
|
|
||||||
|
|
||||||
# Classes
|
# Classes
|
||||||
@dataclass(slots=True)
|
@dataclass(**DATACLASS_DECORATOR_KWARGS)
|
||||||
class Disk:
|
class Disk:
|
||||||
# pylint: disable=too-many-instance-attributes
|
# pylint: disable=too-many-instance-attributes
|
||||||
"""Object for tracking disk specific data."""
|
"""Object for tracking disk specific data."""
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ from dataclasses import dataclass, field
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from wk.cfg.hw import KNOWN_RAM_VENDOR_IDS
|
from wk.cfg.hw import KNOWN_RAM_VENDOR_IDS
|
||||||
|
from wk.cfg.python import DATACLASS_DECORATOR_KWARGS
|
||||||
from wk.exe import get_json_from_command, run_program
|
from wk.exe import get_json_from_command, run_program
|
||||||
from wk.hw.test import Test
|
from wk.hw.test import Test
|
||||||
from wk.std import (
|
from wk.std import (
|
||||||
|
|
@ -23,7 +24,7 @@ from wk.std import (
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(slots=True)
|
@dataclass(**DATACLASS_DECORATOR_KWARGS)
|
||||||
class System:
|
class System:
|
||||||
"""Object for tracking system specific hardware data."""
|
"""Object for tracking system specific hardware data."""
|
||||||
cpu_description: str = field(init=False)
|
cpu_description: str = field(init=False)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Any, Callable
|
from typing import Any, Callable
|
||||||
|
|
||||||
@dataclass(slots=True)
|
from wk.cfg.python import DATACLASS_DECORATOR_KWARGS
|
||||||
|
|
||||||
|
@dataclass(**DATACLASS_DECORATOR_KWARGS)
|
||||||
class Test:
|
class Test:
|
||||||
# pylint: disable=too-many-instance-attributes
|
# pylint: disable=too-many-instance-attributes
|
||||||
"""Object for tracking test specific data."""
|
"""Object for tracking test specific data."""
|
||||||
|
|
@ -27,7 +29,7 @@ class Test:
|
||||||
self.status = status
|
self.status = status
|
||||||
|
|
||||||
|
|
||||||
@dataclass(slots=True)
|
@dataclass(**DATACLASS_DECORATOR_KWARGS)
|
||||||
class TestGroup:
|
class TestGroup:
|
||||||
"""Object for tracking groups of tests."""
|
"""Object for tracking groups of tests."""
|
||||||
name: str
|
name: str
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue