Skip to content

Commit

Permalink
Release v0.2.2
Browse files Browse the repository at this point in the history
Fix compatibility with python3.10
  • Loading branch information
dormant-user committed Jan 2, 2025
1 parent f5516e6 commit 92c058c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyudisk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from .main import EnvConfig, generate_report, monitor, smart_metrics # noqa: F401

version = "0.2.1"
version = "0.2.2"


@click.command()
Expand Down
7 changes: 3 additions & 4 deletions pyudisk/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import platform
import sys
from typing import Any, List, Optional

from pydantic import BaseModel, DirectoryPath, Field, FilePath, HttpUrl, field_validator
Expand All @@ -10,13 +9,13 @@

OPERATING_SYSTEM = platform.system()

if sys.version_info.minor > 10:
try:
from enum import StrEnum
else:
except ImportError:
from enum import Enum

class StrEnum(str, Enum):
"""Override for python 3.10 due to lack of StrEnum."""
"""Custom StrEnum object for python3.10."""


class OperationSystem(StrEnum):
Expand Down
9 changes: 8 additions & 1 deletion pyudisk/models/linux.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import json
from enum import StrEnum
from typing import List, Optional

from pydantic import BaseModel, DirectoryPath, field_validator

from . import Usage

try:
from enum import StrEnum
except ImportError:
from enum import Enum

class StrEnum(str, Enum):
"""Custom StrEnum object for python3.10."""


class Drives(StrEnum):
"""Identifiers for drives.
Expand Down

0 comments on commit 92c058c

Please sign in to comment.