What Is This About?
Like what the title says, we should be using PyInstaller to build Unnamed Wallet. This is a response to Python 3.11.x, where a virtual environment has to be set up first in order to be able to install dependencies
The need to set up a virtual environment to be able to use Unnamed Wallet would result in the wallet not being very user friendly for new, inexperienced users who are using Unnamed Wallet
By using PyInstaller, users will have a choice between using a prebuilt executable or running / building Unnamed Wallet from source code
Rationale
Unnamed Wallet was designed using Unix philosophy, where we would want every program to be as simple, modular, and can be extended if the user ever choose to do so
The code was also meant to run directly from source code, with the intention that users who would want to modify the code can do so with ease and at the same time, users can also verify that their code is not malicious
With the introduction of PEP 668, running from source code is still possible but we must do the following:
- Must set up a virtual environment
python3 -m venv <path to venv>
- Must download external dependencies (e.g.
pynacl
, py-algorand-sdk
) in the virtual environment
- Must know how to use the virtual environment, know how to activate / deactivate the virtual environment
- Must run code with external dependencies in the virtual environment, when the virtual environment is running
As you can see, these 4 points can make Unnamed Wallet very difficult for new users to run from source code. Therefore a new solution is needed
PyInstaller
The solution I propose would be PyInstaller, which is a package that can compile, build Unnamed Wallet into an executable. With the executable, you will not need to have Python to be able to run Unnamed Wallet as the dependencies are included in the executable
This is good for new users who want to use Unnamed Wallet and users who are unfamiliar with setting up the virtual environment but there are some limitations to this solution, which I will list later
Source Code Inclusion
If the user ever so choose to modify the source code or manually build the source code for their platform, they could easily access Github or use git clone
to obtain the source code
Advanced users of Unnamed Wallet who wish to run the wallet from source can choose to do so
Advantages
- Users get to have a wallet that is more user friendly
- Users do not need Python or installing dependencies
- Users do not need to set up a virtual environment
- Users can have a choice to run the code using prebuilt executables or directly from source code
Disadvantages
- Users may have to build their own executables if their platform is not supported
- Users may not be able to modify the code directly as they will not run the wallet from source code
- Users will not be able to view the source code in the built executable directly, must ensure that the prebuilt executable is from the correct source, and signed with the appropriate PGP key
Choices
Here are the possible directions Unnamed Wallet can take:
- Build Unnamed Wallet using PyInstaller, exclude source code from executables (laughing emoji)
- Build Unnamed Wallet using PyInstaller, include source code with executables (hooray emoji)
- Do not build Unnamed Wallet with PyInstaller, use source code instead (confused emoji)
Choice 1 will be the default option if there are no clear winning votes
If you have any questions regarding the vote, please feel free to ask them. The vote will end in 7 days starting from 2023 Jun 24