diff --git a/crossword_puzzle/__init__.py b/crossword_puzzle/__init__.py index 2d1ea04db..21db616e0 100644 --- a/crossword_puzzle/__init__.py +++ b/crossword_puzzle/__init__.py @@ -1,5 +1,3 @@ from .main import main -__version__ = "2.2.82" -__package__ = "crossword_puzzle" __all__ = ["main"] diff --git a/crossword_puzzle/main.py b/crossword_puzzle/main.py index a7979aa8d..393961735 100644 --- a/crossword_puzzle/main.py +++ b/crossword_puzzle/main.py @@ -6,13 +6,13 @@ from configparser import ConfigParser try: from ctypes import windll + from locale import windows_locale except ImportError: pass -from locale import windows_locale from os import name as os_name from os import environ -from babel import Locale, UnknownLocaleError +from babel import Locale from crossword_puzzle.base import Base from crossword_puzzle.utils import ( diff --git a/crossword_puzzle/pages/editor.py b/crossword_puzzle/pages/editor.py index d0c97eef6..98c99c35a 100644 --- a/crossword_puzzle/pages/editor.py +++ b/crossword_puzzle/pages/editor.py @@ -19,7 +19,7 @@ CTkRadioButton, CTkTextbox, ) -from pathvalidate import validate_filename, ValidationError +from pathvalidate import validate_filename from regex import search from crossword_puzzle.base import Addons, Base diff --git a/crossword_puzzle/pages/home.py b/crossword_puzzle/pages/home.py index 1db601b32..ea5a5fded 100644 --- a/crossword_puzzle/pages/home.py +++ b/crossword_puzzle/pages/home.py @@ -7,7 +7,7 @@ ) from concurrent.futures import ThreadPoolExecutor from threading import Thread -from typing import List, Union +from typing import List from webbrowser import open_new_tab from babel import Locale, numbers @@ -35,6 +35,7 @@ Colour, ) from crossword_puzzle.utils import GUIHelper, _update_cfg, _check_version +from crossword_puzzle.version import __version__ class HomePage(CTkFrame, Addons): @@ -341,5 +342,4 @@ async def check_version(self) -> None: with ThreadPoolExecutor() as executor: ver = await loop.run_in_executor(executor, _check_version) if ver: - from crossword_puzzle import __version__ self._make_version_label(__version__, ver) diff --git a/crossword_puzzle/utils.py b/crossword_puzzle/utils.py index 1762e7989..a3c1aae1b 100644 --- a/crossword_puzzle/utils.py +++ b/crossword_puzzle/utils.py @@ -34,6 +34,7 @@ ) from crossword_puzzle.errors import DefinitionsParsingError from crossword_puzzle.td import CrosswordInfo +from crossword_puzzle.version import __version__ class GUIHelper: @@ -223,8 +224,6 @@ def _check_version() -> Union[None, str]: response = req.urlopen(request) if response.status == 200: - from crossword_puzzle import __version__ - data = loads(response.read().decode()) local_ver = __version__.split(".") remote_ver = data["name"].split(".") @@ -439,6 +438,7 @@ def _make_cword_info_json( total_definitions=total_definitions, difficulty=difficulty, symbol="0x2717", + name=adjusted_cword_name, translated_name="", category=category ), diff --git a/crossword_puzzle/version.py b/crossword_puzzle/version.py new file mode 100644 index 000000000..041ce7da5 --- /dev/null +++ b/crossword_puzzle/version.py @@ -0,0 +1 @@ +__version__ = "2.2.83" diff --git a/setup.py b/setup.py index a02974b93..238b33a78 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,10 @@ from setuptools import find_namespace_packages, setup -from crossword_puzzle import __version__, __package__ + setup( - name=__package__, - version=__version__, + name="crossword_puzzle", + version="2.2.83", # If I import crossword_puzzle.version.__version__, + # setuptools fails to build the project for some reason author="Tomas Vana", url="https://github.com/tomasvana10/crossword_puzzle", description="Select, generate and play always-unique crosswords.",