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

Plugin may fail on other Python versions. #39

Open
Garulf opened this issue Dec 2, 2022 · 4 comments
Open

Plugin may fail on other Python versions. #39

Garulf opened this issue Dec 2, 2022 · 4 comments

Comments

@Garulf
Copy link

Garulf commented Dec 2, 2022

Hello @ivanipenburg,

After going over your code I noticed the hard dependency on the regex package which uses a dynamically linked python file. This may fail to load on other Python versions if the user isn't using the same version the file was complied for.

On Python 3.10:

\lib\regex\_regex_core.py", line 21, in <module>
    import regex._regex as _regex
ModuleNotFoundError: No module named 'regex._regex'

Flow Launcher uses version 3.8 for automatic install of Python and 3.8 is recommended at this time. But the user is capable of choosing any version they want. This may lead to users reporting issues with your plugin.

You may want to check out PyInstaller, or nuitka which package the python run time with your plugin.

If you have any questions please feel free to ask. Hope this helps!

@ivanipenburg
Copy link
Owner

Hi @Garulf ,

I actually couldn't get it to work on any other system without the hard dependency, as that exact error would show up. Because of a problem with the regex package, there is a problem if I build the release using pip install regex. This is a known issue for the regex package. mrabarnett/mrab-regex#413

Do you think using PyInstaller or nuitka would fix this problem? I don't know what they use under the hood to download the packages, but if it's downloading from source it will likely result in the same error.

I have actually struggled with it for a while, and right now the hard dependency was the only way to have it work.

@Garulf
Copy link
Author

Garulf commented Dec 2, 2022

They should fix the issue as you are essentially forcing the user to use your version of Python because it is packaged with your plugin.

You would have to change the plugin.json Language to "executable" and point it to your packaged plugin executable as you're not using the Python provided by Flow Launcher.

You can see my Steam-Search plugin if you need an example. It uses the nuitka package to package itself into an executable file.

@ivanipenburg
Copy link
Owner

ivanipenburg commented Dec 2, 2022

Thanks for the explanation, I will take a look at this.

It does seem however that your release.yml still installs the requirements through pip, which downloads a broken version of regex everytime, no matter which version I pin.

edit:
Responded too quickly, just realized nuitka can still use my hard dependecy of regex when packaging. Thanks for your help!

@Garulf
Copy link
Author

Garulf commented Dec 2, 2022

It does seem however that your release.yml still installs the requirements through pip, which downloads a broken version of regex everytime, no matter which version I pin.

Well its not broken.. it just uses a compiled file that's built using whatever version of Python you're using to install it with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants