Packman’s API¶
packman provides an API that can be used to easily create packages from external application (for instance, you could call packman from your build machine to generate packages after all tests passed).
The API is also usable when alternative implementations of get and pack for different components, as described here
Contents:
-
packman.packman.
get_package_config
(package_name, packages_dict=None, packages_file=None)[source]¶ returns a package’s configuration
if packages_dict is not supplied, a packages.yaml file in the cwd will be assumed unless packages_file is explicitly given. after a packages_dict is defined, a package_config will be returned for the specified package_name.
Parameters: - package (string) – package name to retrieve config for.
- packages_dict (dict) – dict containing packages configuration
- packages_file (string) – packages file to search in
Return type: dict representing package configuration
-
packman.packman.
packman_runner
(action, packages_file=None, packages=None, excluded=None, verbose=False)[source]¶ logic for running packman. mainly called from the cli (pkm.py)
if no packages_file is supplied, we will assume a local packages.yaml as packages_file.
if packages are supplied, they will be iterated over. if excluded are supplied, they will be ignored.
if a pack.py or get.py files are present, and an action_package function exists in the files, those functions will be used. else, the base get and pack methods supplied with packman will be used. so for instance, if you have a package named x, and you want to write your own get function for it. Just write a get_x() function in get.py.
Parameters: - action (string) – action to perform (get, pack)
- packages_file (string) – path to file containing package config
- packages (string) – comma delimited list of packages to perform action on.
- excluded (string) – comma delimited list of packages to exclude
- verbose (bool) – determines output verbosity level
Return type: None
-
packman.packman.
get
(package)[source]¶ retrieves resources for packaging
Note
package params are defined in packages.yaml
Note
param names in packages.yaml can be overriden by editing definitions.py which also has an explanation on each param.
Parameters: package (dict) – dict representing package config as configured in packages.yaml will be appended to the filename and to the package depending on its type Return type: None
-
packman.packman.
pack
(package)[source]¶ creates a package according to the provided package configuration in packages.yaml uses fpm (https://github.com/jordansissel/fpm/wiki) to create packages.
Note
package params are defined in packages.yaml but can be passed directly to the pack function as a dict.
Note
param names in packages.yaml can be overriden by editing definitions.py which also has an explanation on each param.
Parameters: package (string|dict) – string or dict representing package name or params (coorespondingly) as configured in packages.yaml Return type: None