hpcflow.sdk.runtime.RunTimeInfo#
- class hpcflow.sdk.runtime.RunTimeInfo(name, package_name, version, logger)#
Bases:
object
Get useful run-time information, including the executable name used to invoke the CLI, in the case a PyInstaller-built executable was used.
- Parameters:
Methods
Get the command to activate the virtual environment.
Get the command to deactivate the virtual environment.
Display the information known by this class as a human-readable table.
Serialize this class as a dictionary.
Attributes
Get the name of the frozen app executable, if the app is frozen.
Get the path that the user invoked to launch the frozen app, if the app is frozen.
Get the command that was used to invoke this instance of the app.
Get the resolved name of the frozen app executable, if the app is frozen.
Get the resolved path to the frozen app that the user launched, if the app is frozen.
Get the resolved path to the Python script used to invoked this instance of the app, if the app is not frozen.
Get the path to the Python script used to invoked this instance of the app, if the app is not frozen.
Application name.
Application package name.
Application version.
Whether this is a frozen application.
Working directory.
Where to write log messages.
Host that this is running on.
Whether this application is inside iPython.
Whether this application is being used interactively.
Whether this application is being used in test mode.
Whether this application is being run from the CLI.
The bundle directory, if frozen.
The path to Python itself.
The Python version.
Whether the application is in a virtual environment.
Whether the application is in a Conda virtual environment.
From sys.prefix.
From sys.base_prefix.
The old base prefix, from sys.real_prefix.
The Conda prefix, if defined.
The virtual environment path.
- bundle_dir#
The bundle directory, if frozen.
- conda_prefix#
The Conda prefix, if defined.
- property executable_name: str | None#
Get the name of the frozen app executable, if the app is frozen.
If the user launches the app via a symbolic link, then this returns the name of that link, whereas resolved_executable_name returns the actual frozen app file name.
- property executable_path: Path | None#
Get the path that the user invoked to launch the frozen app, if the app is frozen.
If the user launches the app via a symbolic link, then this returns that link, whereas executable_path_resolved returns the actual frozen app path.
- from_CLI#
Whether this application is being run from the CLI.
- get_activate_env_command()#
Get the command to activate the virtual environment.
- get_deactivate_env_command()#
Get the command to deactivate the virtual environment.
- hostname#
Host that this is running on.
- in_ipython#
Whether this application is inside iPython.
- in_pytest#
Whether this application is being used in test mode.
- property invocation_command: tuple[str, ...]#
Get the command that was used to invoke this instance of the app.
- is_conda_venv#
Whether the application is in a Conda virtual environment.
- is_frozen#
Whether this is a frozen application.
- is_interactive#
Whether this application is being used interactively.
- is_venv#
Whether the application is in a virtual environment.
- logger#
Where to write log messages.
- name#
Application name.
- package_name#
Application package name.
- python_executable_path#
The path to Python itself.
- python_version#
The Python version.
- property resolved_executable_name: str | None#
Get the resolved name of the frozen app executable, if the app is frozen.
- property resolved_executable_path: Path | None#
Get the resolved path to the frozen app that the user launched, if the app is frozen.
In a one-file app, this is the path to the bootloader. In the one-folder app, this is the path to the executable.
References
[1] https://pyinstaller.org/en/stable/runtime-information.html#using-sys-executable-and-sys-argv-0
- property resolved_script_path: Path | None#
Get the resolved path to the Python script used to invoked this instance of the app, if the app is not frozen.
- property script_path: Path | None#
Get the path to the Python script used to invoked this instance of the app, if the app is not frozen.
- show()#
Display the information known by this class as a human-readable table.
- Return type:
None
- sys_base_prefix#
From sys.base_prefix. This will be equal to sys_prefix (sys.prefix) if not running within a virtual environment. However, if running within a virtual environment, this will be the Python installation directory, and sys_prefix will be equal to the virtual environment directory.
- sys_prefix#
From sys.prefix. If running in a virtual environment, this will point to the environment directory. If not running in a virtual environment, this will point to the Python installation root.
- sys_real_prefix#
The old base prefix, from sys.real_prefix. Compatibility version of
sys_base_prefix
.
- version#
Application version.
- working_dir#
Working directory.