Packages¶
- skare3_tools.packages.get_package_list()[source]¶
Return a list of dictionaries, one per package.
- Returns:
dict Dictionary contains only basic information
- skare3_tools.packages.get_repository_info(owner_repo, version='v4', **kwargs)[source]¶
Get information about a Github repository
- Parameters:
owner_repo – str the name of the repository, including owner, something like ‘sot/skare3’.
since – int or str the maximum number of releases to look back, or the release tag to look back to (not inclusive).
include_unreleased_commits – bool whether to include commits and merges for repositories that have no release. This affects only top-level entries ‘commits’, ‘merges’, ‘merge_info’. It is for backward compatibility with the dashboard.
include_commits – bool whether to include commits in release_info.
version – str Github API version to use.
update – bool Force update of the cached info. By default updates only if pushed_at or updated_at change.
- Returns:
- skare3_tools.packages.get_conda_pkg_info(conda_package, conda_channel=None)[source]¶
Get information on a conda package.
- Parameters:
conda_package – str Name of conda package
conda_channel – str url of the channel
- Returns:
dict
- skare3_tools.packages.get_conda_pkg_dependencies(conda_package, conda_channel=None)[source]¶
Get dependencies of a conda package.
- Parameters:
conda_package – str Name of conda package
conda_channel – str url of the channel
- Returns:
dict
Caching¶
- skare3_tools.packages.json_cache(name, directory='', ignore=None, expires=None, update_policy=None)[source]¶
Decorator to cache function results in json format.
This decorator adds an ‘update’ argument to decorated functions. update is False by default, but one can set it to True to force-update the cache entry.
Data is saved in json files. The file names can include a special separator character to denote the function arguments. Currently that character is ‘:’.
- Parameters:
name –
directory – str path where to save json file. Either absolute or relative to CONFIG[‘data_dir’]
ignore – list list of argument names to ignore in the cache entry identifier
expires – dict a dictionary that can be given to datetime.timedelta(**expires) If the cache entry is older than this interval, it is updated.
update_policy – callable A callable taking two arguments: (filename, result), which returns True if the cache entry should be updated.
- Returns:
- skare3_tools.packages.repository_info_is_outdated(_, pkg_info)[source]¶
Cache update policy that returns True if the Github repository has been updated or pushed into.
If the calling user has not write access to the cache directory, this function returns False, unless SKARE3_REPO_INFO_LATEST is set to “True”.
- Parameters:
_ –
pkg_info – dict. As returned from
get_repository_info
.
- Returns: