Skip to content

Commit

Permalink
[F] Fix #35 python 3.11 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Nov 4, 2022
1 parent d56f083 commit e8c7266
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hyfetch/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def select_lightness():
if random_count > len(perm):
choices = perm
else:
choices = random.sample(perm, random_count)
choices = random.sample(sorted(perm), random_count)
choices = [{slots[i]: n for i, n in enumerate(c)} for c in choices]
arrangements += [(f'random{i}', ColorAlignment('custom', r)) for i, r in enumerate(choices)]
asciis = [[*ca.recolor_ascii(asc, _prs).split('\n'), k.center(asc_width)] for k, ca in arrangements]
Expand Down
6 changes: 2 additions & 4 deletions hyfetch/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from __future__ import annotations

from dataclasses import dataclass

from typing_extensions import Literal
from dataclasses import dataclass, field

from .color_util import AnsiMode, LightDark
from .constants import CONFIG_PATH
Expand All @@ -16,7 +14,7 @@ class Config:
mode: AnsiMode
light_dark: LightDark = 'dark'
lightness: float | None = None
color_align: ColorAlignment = ColorAlignment('horizontal')
color_align: ColorAlignment = field(default_factory=lambda: ColorAlignment('horizontal'))

@classmethod
def from_dict(cls, d: dict):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import setup

import hyfetch
import hyfetch.constants

# The directory containing this file
HERE = pathlib.Path(__file__).parent
Expand All @@ -14,7 +14,7 @@
# This call to setup() does all the work
setup(
name="HyFetch",
version=hyfetch.__version__,
version=hyfetch.constants.VERSION,
description="neofetch with flags <3",
long_description=README,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit e8c7266

Please sign in to comment.