clutchski / caribou

A small, simple Python migrations library for SQLite databases.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to make caribou work with Pyinstaller?

cwilvx opened this issue · comments

I'm trying to build my python app with Pyinstaller but I can't figure out how to make caribou work in the built version of the app. Caribou works fine when running the app using python app.py since the migration directories are preserved. In the build version, all files are build into binaries, all in the same directory ... and that leads to caribou failing with

caribou.Error: /tmp/_MEI7FKrIm/app/migrations/main is not a directory.

I'm building my app in pyinstaller's single file mode.

The only way I get caribou to work properly is by including the migration folder in the bundle as an asset using the --add-data flag during build.

"--add-data=app/migrations:app/migrations",

This is a no-go zone since it's a security hazard since the migration python files can be manipulated when the app is running.

3 months later ... I decided to write a custom migration module for my project. Bye!