Add build script for pymcuprog executable #18
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1. Why a build script?
Not all computers have Python installed (especially Windows). Even if Python is available, people often don't like to install extra modules in their default installation. Virtual environments are of course a solution, but that requires skills and setup efforts. In short: a simple executable is a good idea to make your tool more easily available.
2. Result of the build
I've written a build script that invokes CX_Freeze to create an executable file. On Windows, the build output looks like this:
On Linux it looks very similar. I don't have a MAC, so I can't test it there. I only had the opportunity to test it on Windows 10, Windows 11, Ubuntu and Debian.
3. How to invoke the build script
My build script is very easy to invoke. Just make sure you have CX_Freeze installed. Then navigate to the toplevel
pymcuprog
folder and run the build script like so:To clean the output, just run:
4. Notes
Please note I added a file named
pymcuprog_execute.py
. It just serves as the target for CX_Freeze. The file simply imports thepymcuprog
module and runs itsmain()
function.