Skip to content

[Archived] Creating a release

Umesh .A Bhat edited this page Dec 14, 2020 · 4 revisions

This page is outdated. Refer to this instead.

Packaging and creating a release

Once you have fixed various bugs, added features and inadvertently created new bugs to fix in the future, it's time to make a release. Make sure everything works and build the front-end. Once the front-end is built, the application can be packaged into a minimal distributable.

Universal

The universal package can be built using a shell script build.sh in the client directory. It mostly just does file copying a renaming. The end result will be put into the dist folder.

Windows

The windows specific packaging is done using pyinstaller. The source is packaged into an .exe file along with all the dependencies and the python3 runtime. Creating a release should be pretty straightforward, have a look at their instructions here.

Using the pyinstaller

First run the command pyinstaller src\main.py in the client folder. This creates the main.spec file that pyinstaller will be using to create the executable. Note that when running pyinstaller, the csv module has to be marked as a hidden import alongside all the modules that src/icp.py imports. This means that after running the pyinstaller you need to modify the created .spec file and make sure the following is things are included in the file.

# Name an import not visible in the code of the script(s). This option can be used multiple times.
hiddenimports=['csv', 'apsw', 'enum', 'kaitaistruct', 'pkg_resources'],
# Optional module or package (the Python name, not the path name) that will be ignored (as though it was not found).
excludes=['icp'],

Secondly, make sure the pathex is set up correctly. It should point to your Python3 libs and the client directory.

# Name an import not visible in the code of the script(s). This option can be used multiple times.
pathex=['C:\\Users\\Estcuboid\\AppData\\Local\\Programs\\Python\\Python37-32\\Lib', 'C:\\Users\\..\\Telemetry-Forwarding-Client\\client'],

Now you should be ready to run pyinstaller on the generated .spec file by simply running pyinstaller main.spec. It should create a dist folder and that's where the built main.exe should be.

Creating a release folder

Create a folder for the release specifying the platform you generated the build on. It should look something like this estcube-telemetry-win64. The icp module needs to be excluded from the package and copied independently into the src/ folder of the distributable, since this file is overwritten by the configuration updater. In the end the folder you created should look like the following:

  • estcube-telemetry-win64
    • spec folder
      • icp.ksy
      • telemetry.json
    • src folder
      • icp.py
    • static
      • Up to date front-end files
      • Create these using yarn build
    • configuration.ini
      • Create this from configuration.ini.sample
    • main.exe executable file

Making it public

Releases are meant to be a easy way for people to use our program.

Release guidelines to be written.

Clone this wiki locally