Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to start Lute 3.4.0 on Python 3.12 #424

Closed
cghyzel opened this issue May 18, 2024 · 5 comments
Closed

Failure to start Lute 3.4.0 on Python 3.12 #424

cghyzel opened this issue May 18, 2024 · 5 comments
Labels
bug Something isn't working fixed Fixed in develop or master, to be launched.

Comments

@cghyzel
Copy link
Contributor

cghyzel commented May 18, 2024

Description
(from discord)
When running on Python 3.12 the following error occurs.

python -m lute.main

  Starting Lute.

  Using default config
    data path: /home/ali/.local/share/Lute3
    database:  /home/ali/.local/share/Lute3/lute.db

  Initializing app.
  Initializing parsers from plugins ...


--------------------------------------------------
Error during startup:
'EntryPoints' object has no attribute 'get'
Please try again, or report an issue on GitHub.
Additionally, help is available with --help.
-------------------------------------------------

To Reproduce

Start lute on python 3.12 on version 0.3.4.0

Extra software info, if not already included in the Description:

Python version 3.12.1

@cghyzel
Copy link
Contributor Author

cghyzel commented May 18, 2024

One implicit aspect of this bug is that there actually needs to be an increase in the scope of testing to encompass 3.12. Right now testing is done for 3.8 to 3.11.

@thangnguyenxtz
Copy link

I can run Lute 3.4.0 with Python version 3.11, but I can't run it with Python version 3.12 too

@cghyzel
Copy link
Contributor Author

cghyzel commented May 19, 2024

This fixed worked for me in 3.12. Going to open a PR.

def init_parser_plugins():
    """
    Initialize parsers from plugins
    """
    if sys.version_info.major == 3 and sys.version_info.minor in (8, 9, 10, 11):
        custom_parser_eps = entry_points().get('lute.plugin.parse')
    elif sys.version_info.major == 3 and sys.version_info.minor == 12:
        custom_parser_eps = entry_points().select(group='lute.plugin.parse')
    else:
        custom_parser_eps = []
    for custom_parser_ep in custom_parser_eps:
        if _is_valid(custom_parser_ep.load()):
            __LUTE_PARSERS__[custom_parser_ep.name] = custom_parser_ep.load()
        else:
            raise ValueError(f"{custom_parser_ep.name} is not a a subclass of AbstractParser")

@cghyzel
Copy link
Contributor Author

cghyzel commented May 19, 2024

Should be solved by

@jzohrab jzohrab added bug Something isn't working fixed Fixed in develop or master, to be launched. labels May 19, 2024
@jzohrab
Copy link
Collaborator

jzohrab commented May 19, 2024

Thanks very much @cghyzel -- merged into develop, and github ci was extended to include python 3.12.

@jzohrab jzohrab closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Fixed in develop or master, to be launched.
Projects
Archived in project
Development

No branches or pull requests

3 participants