Skip to content

Commit

Permalink
Use strenum package and widen supported python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbrucker committed Mar 26, 2024
1 parent 457e6eb commit a0bc34d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion foxy_farmer/config/backend.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from enum import StrEnum
from strenum import StrEnum


class Backend(StrEnum):
Expand Down
4 changes: 2 additions & 2 deletions foxy_farmer/config/foxy_chia_config_manager.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from os import environ
from pathlib import Path
from shutil import copyfile
from typing import Dict, Any, List, Callable
from typing import Dict, Any, List, Callable, Union
from sys import exit

from chia.cmds.init_funcs import chia_init, check_keys
Expand Down Expand Up @@ -120,7 +120,7 @@ def patch_configs(
chia_config: Dict[str, Any],
foxy_farmer_config: FoxyConfig,
):
backend = foxy_farmer_config.get("backend", Backend.BladeBit)
backend: Union[str, Backend] = foxy_farmer_config.get("backend", Backend.BladeBit)
require_syslog = backend != Backend.BladeBit
full_node_peers: List[Dict[str, Any]] = [{
"host": eu1_foxy_farming_gateway_address,
Expand Down
4 changes: 2 additions & 2 deletions foxy_farmer/foxy_farmer_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from signal import SIGINT, Signals
from sys import platform
from types import FrameType
from typing import Optional
from typing import Optional, Union

from chia.util.misc import SignalHandlers
from sentry_sdk.sessions import auto_session_tracking
Expand Down Expand Up @@ -45,7 +45,7 @@ async def run(self):
foxy_config_manager = FoxyConfigManager(self._config_path)
foxy_config = foxy_config_manager.load_config()

backend = foxy_config.get("backend", Backend.BladeBit)
backend: Union[str, Backend] = foxy_config.get("backend", Backend.BladeBit)
if backend == Backend.BladeBit:
self._farmer = BladebitFarmer(root_path=self._foxy_root, farmer_config=foxy_config)
elif backend == Backend.Gigahorse:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"PyYAML>=6.0.1",
"questionary==2.0.1",
"sentry-sdk==1.41.0",
"StrEnum==0.4.15",
"yaspin==3.0.1",
]
if platform == "win32" or platform == "cygwin":
Expand All @@ -28,7 +29,7 @@
description='A simplified farmer for the Chia blockchain using the foxy chia farming gateway.',
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
python_requires='>=3.11, <4',
python_requires='>=3.9, <4',
install_requires=dependencies,
packages=find_packages(include=["foxy_farmer", "foxy_farmer.*"]),
extras_require=dict(
Expand Down

0 comments on commit a0bc34d

Please sign in to comment.