Packaging the code
The last step is to modify the package to include the static files used to define the user interface and add the additional entry point for launching the user interface.
Firstly, we will modify the entry_points
option to include the unitconverter-ui
command, as follows:
entry_points = { 'console_scripts': ['unitconvert=unitconverter.CLI:run_cli'], 'gui_scripts': ['unitconverter-ui=unitconverter.gui:run_gui'] }
Next, we will add the package_data
option to define the static files that we wish to include in the package:
package_data = { '': ['*.ui'] }
In this case, we are including any file with the .ui
extension anywhere in the package.
Note
Note that the package_data
option is technically only required when the include_package_data
option has not been set to True
.
Once the package has been modified, it can be installed using the following command:
sudo python setup.py install
When this completes, you can launch...