Mac Configurations - GraphFilter/GraphFilter GitHub Wiki

Virtual Environment

Inside the project directory, create a virtual environment (venv)

At the cmd, at the project's root directory, type:

python -m venv .\venv

After that you should see a venv directory.

To use the virtual environment, run:

source ./venv/bin/activate

The terminal will show you that you are inside the virtual environment somehow, usually with a flag (venv) above the insert line.

Building

To build the project, PyInstaller will be required. You can use it directly from the virtual environment.

pyinstaller --icon ./resources/icons/hexagon.icns --add-data "./resources/icons:resources/icons" --add-data "./resources/fonts:resources/fonts" --add-data "./resources/gifs:resources/gifs" --add-data "./resources/images:resources/images" --add-data "./resources/logos:resources/logos" --add-data "./resources/stylesheet:resources/stylesheet" --clean --noconfirm --collect-data pulp --onefile --noconsole --name GraphFilter-x.x.x-macos app.py

Create spec file

Create a spec file it's useful because it's easier to change some configuration in the file instead of the command line, since it has too many options.

Alternatively, it is possible to create the spec file, which is just replace pyinstaller for pyi-makespec, removing the --clean and --noconfirm options.

pyi-makespec --icon ./resources/icons/hexagon.icns --add-data "./resources/icons:resources/icons" --add-data "./resources/fonts:resources/fonts" --add-data "./resources/gifs:resources/gifs" --add-data "./resources/images:resources/images" --add-data "./resources/logos:resources/logos" --add-data "./resources/stylesheet:resources/stylesheet" --collect-data pulp --onefile --noconsole --name GraphFilter-x.x.x-macos app.py

This will create an GraphFilter-x.x.x-macos file.

Replace x.x.x for the version number of the release

After creating the spec file, run the following command:

pyinstaller GraphFilter-x.x.x-macos.spec

Distributing

After the previous steps, you will see that two folders were created inside the project structure: build and dist.
Inside dist will be an executable file that runs the program.

Executing

After downloading the file GraphFilter-x.x.x-macos.zip, double-click on the file to extract. A program called GraphFilter-x.x.x-macos will be created. Double-click the program to run it or drag it to your applications folder for easy access.

It might be necessary to allow foreign applications to execute in your MacOS. If you don't know how to do so, follow these steps.