okfn / opendataeditor

No-code application to explore and publish all kinds of data: datasets, tables, charts, maps, stories, and more. Forever free and open source project powered by open standards and generative AI.
http://opendataeditor.okfn.org
MIT License
149 stars 18 forks source link

Use pyinstaller #446

Open pdelboca opened 4 days ago

pdelboca commented 4 days ago

This PR refactors the application to use PyInstaller to handle the backend FastAPI server when building the application.

Main Changes:

cloudflare-pages[bot] commented 4 days ago

Deploying opendataeditor with  Cloudflare Pages  Cloudflare Pages

Latest commit: 98b45fc
Status: ✅  Deploy successful!
Preview URL: https://ffaf0c97.opendataeditor.pages.dev
Branch Preview URL: https://use-pyinstaller.opendataeditor.pages.dev

View logs

guergana commented 12 hours ago

Test OS: Ubuntu

Test case 1: installing the Ubuntu artifacts from this PR at https://github.com/okfn/opendataeditor/actions/runs/9710357555

Hello, @pdelboca I am testing this in Ubuntu with the file generated in the distribution files in the PR, and while I dont get any errors when opening the app after installation without access to the Internet, I can't open any files in the app:

This is what i see, the files/folders I try to add are not displayed either on the left menu or the right content panel.

image

Test case 2: Making a build locally

I can't make a local build because I am missing some dependencies. I have run make install and afterwards make build and got these errors:

opendataeditorgutz@C306:~/Desktop/Things/opendataeditor/opendataeditor$ make build
hatch run build
[assets] Copying 'desktop/assets' to 'build'
[server] Creating executable file for FastAPI server
246 WARNING: Failed to collect submodules for 'frictionless.vendors.wkt' because importing 'frictionless.vendors.wkt' raised: ModuleNotFoundError: No module named 'grako'
46563 WARNING: Hidden import "pysqlite2" not found!
46564 WARNING: Hidden import "MySQLdb" not found!
Traceback (most recent call last):
  File "/home/gutz/.local/share/hatch/env/virtual/.pythons/3.10/python/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,

I have googled the issue and I have found a couple links like this one and this one suggesting to change pysqlite2 to sqlite3

to remove the Hidden import "MySQLdb" not found! warning I had to go through the following steps

So I also failed to build it manually for my particular cpu version.

Test OS: Windows

Version from artifacts

The version from the PR artifacts installs well in Windows 10 inside VirtualBox and works fine.

guergana commented 11 hours ago

Given that the results for Windows and Ubuntu were very different, we should test this as well natively in MacOS, can we organize a call for this @romicolman ? :pray: (We test it together and we make some comments for Patricio based in our findings)