Install Process Command Line
This section describe everything related to install-steps.
Set-up CLI
Once you have defined your installation process with InstallProcess, use setup_install to
enable the CLI:
# File my_environment_setup.py
# [...]
class MyInstallProcess(InstallProcess):
# ...
if __name__ == '__main__':
setup_install(MyInstallProcess)
In the rest of this section, it will be assumed setup_install(MyInstallProcess) is defined in file
my_environment_setup.py.
Install, Uninstall, Reinstall
You can now run your install process from the command line:
python -m my_environment_setup
You can also add the -i option to specify if you want to uninstall rather than install:
python -m my_environment_setup -i uninstall
And if you want to reinstall (a.k.a uninstall then install again), you can:
python -m my_environment_setup -i reinstall
Install Only a Specific Part
If you wish to run only a specific part of your install process, you can do so by providing the name of the step you want to install/uninstall/reinstall.
To get the name of all steps (this does not install or uninstall anything):
python -m my_environment_setup -n
Then you can call only a subset of your installation process:
python -m my_environment_setup -t Database
python -m my_environment_setup -t Database.ConfigureMyDatabase -i reinstall
Verbose output for shell commands
By default, if you use a shell command from within an install step using `self.shell(...), the output is not
displayed unless the command fails.
If you want to always display shell commands outputs, you can do so by enabling verbose mode:
python -m my_environment_setup -v
Add Install-Steps Before/After Install
If you wish to add install-steps (or group of install-steps) before/after executing you install-process, you can do so by
providing them to setup_install:
# File my_environment_setup.py
# [...]
class StepBeforeInstallOrUninstall(InstallStep):
# ...
class StepAfterInstallOrUninstall(InstallStep):
# ...
class MyInstallProcess(InstallProcess):
# ...
if __name__ == '__main__':
setup_install(
MyInstallProcess,
prologue=StepBeforeInstallOrUninstall(),
epilogue=StepAfterInstallOrUninstall()
)
Do note that prologue will trigger before install, and before uninstall ;
and that epilogue will trigger after install, and after uninstall.