Skip to content

Commit

Permalink
Ensure Python 3.8+ compatibility regarding StrEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Aug 21, 2023
1 parent 8c57ac8 commit 444b4db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions aiomonitor/webui/app.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
from __future__ import annotations

import dataclasses
import enum
import sys
from importlib.metadata import version
from pathlib import Path
from typing import TYPE_CHECKING, Dict, Mapping, Tuple

if sys.version_info >= (3, 11):
from enum import StrEnum
else:
from backports.strenum import StrEnum

import trafaret as t
from aiohttp import web
from jinja2 import Environment, PackageLoader, select_autoescape
Expand All @@ -23,7 +28,7 @@ class WebUIContext:
jenv: Environment


class TaskTypes(enum.StrEnum):
class TaskTypes(StrEnum):
RUNNING = "running"
TERMINATED = "terminated"

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ install_requires =
click>=8
janus>=1.0
jinja2>=3.1.2
backports.strenum>=1.2.4; python_version<"3.11"
terminaltables
trafaret>=2.1.1
typing-extensions>=4.1
Expand Down

0 comments on commit 444b4db

Please sign in to comment.