Utilities for getting information about IPython and the system it’s running in.
Return the effective number of CPUs in the system as an integer.
This cross-platform function makes an attempt at finding the total number of available CPUs in the system, as returned by various underlying system and python calls.
If it can’t find a sensible answer, it returns 1 (though an error may make it return a large positive number that’s actually incorrect).
Get short form of commit hash given directory pkg_path
There should be a file called ‘COMMIT_INFO.txt’ in pkg_path. This is a file in INI file format, with at least one section: commit hash, and two variables archive_subst_hash and install_hash. The first has a substitution pattern in it which may have been filled by the execution of git archive if this is an archive generated that way. The second is filled in by the installation, if the installation is from a git archive.
We get the commit hash from (in order of preference):
If all these fail, we return a not-found placeholder tuple
Parameters : | pkg_path : str
|
---|---|
Returns : | hash_from : str
hash_str : str
|
Return dict describing the context of this package
Parameters : | pkg_path : str
|
---|---|
Returns : | context : dict
|
Return useful information about IPython and the system, as a string.