Windows 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:

.\venv\Scripts\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.ico --add-data ".\resources\fonts;resources\fonts" --add-data ".\resources\gifs;resources\gifs" --add-data ".\resources\icons;resources\icons" --add-data ".\resources\images;resources\images" --add-data ".\resources\logos;resources\logos" --clean --noconfirm --collect-data pulp --onefile --noconsole --name GraphFilter-x.x.x-win 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.ico --add-data ".\resources\fonts;resources\fonts" --add-data ".\resources\gifs;resources\gifs" --add-data ".\resources\icons;resources\icons" --add-data ".\resources\images;resources\images" --add-data ".\resources\logos;resources\logos" --collect-data pulp --onefile --noconsole --name GraphFilter-x.x.x-win app.py

This will create an GraphFilter-x.x.x-win.spec 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-win.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

To run the program you just need to double click the executable.