File: create_exe.py

package info (click to toggle)
guiqwt 4.4.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,720 kB
  • sloc: python: 26,775; cpp: 1,673; makefile: 22
file content (40 lines) | stat: -rw-r--r-- 1,136 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Setup script for distributing SIFT as a stand-alone executable
# SIFT is the Signal and Image Filtering Tool
# Simple signal and image processing application based on guiqwt and guidata
# (see guiqwt/tests/sift.py)

"""Create a stand-alone executable"""

try:
    from guidata.utils.disthelpers import Distribution
except ImportError:
    raise ImportError("This script requires guidata 1.4+")

# Importing modules to be bundled
from guiqwt.tests import sift


def create_executable():
    """Build executable using ``guidata.utils.disthelpers``"""
    dist = Distribution()
    dist.setup(
        name="Sift",
        version=sift.VERSION,
        description="Signal and Image Filtering Tool",
        script="sift.pyw",
        target_name="sift.exe",
        target_dir="%s-%s" % ("Sift", sift.VERSION),
        icon="sift.ico",
    )
    dist.add_modules("guidata", "guiqwt")
    dist.excludes += ["IPython"]

    # Building executable
    dist.build("cx_Freeze", create_archive="move")


if __name__ == "__main__":
    create_executable()