| |
- generateRequirementsTxt(packages)
- generateRequirementsTxt - Generates a requirements.txt suitable for pip to ingest based on packages param.
@param packages - Describes the required packages. Takes one of the following forms:
String - Directly becomes contents of requirements.txt file to be ingested by pip
List - A list/tuple/set of package names (optionally including version requirements, e.x. MyPkg==1.2.3)
Dict - A dictionary of package names to versions. If no value is present, the latest will be fetched.
@return <str> - generated requirements.txt file contents
- installPackages(packages, venvDir, stdout=<open file '<stdout>', mode 'w'>, stderr=<open file '<stderr>', mode 'w'>)
- installPackages - Installs packages into a created virtual environment
@param packages - Describes the required packages. Takes one of the following forms:
String - Directly becomes contents of requirements.txt file to be ingested by pip
List - A list/tuple/set of package names (optionally including version requirements, e.x. MyPkg==1.2.3)
Dict - A dictionary of package names to versions. If no value is present, the latest will be fetched.
@param venvDir <str> - Path to a created virtualenv directory. This should be the 'virtualenvDirectory' key from the return of createEnv
@param stdout <iostream/None> - Stream to be used as stdout for installation. Default is sys.stdout. Use "None" to swallow output.
@param stderr <iostream/None> - Stream to be used as stderr for installation. Default is sys.stderr. Use "None" to swallow output.
@return - The generated requirements.txt used to install packages.
@raises -
VirtualEnvOnDemand.exceptions.PipInstallFailed - if cannot install packages
Others (Exception, etc) - If permissions problem to write to specified directory, etc
|