pkglts package¶
Subpackages¶
- pkglts.install_env package
- pkglts.option package
- Subpackages
- pkglts.option.base package
- pkglts.option.conda package
- pkglts.option.coverage package
- pkglts.option.coveralls package
- pkglts.option.data package
- pkglts.option.doc package
- pkglts.option.flake8 package
- pkglts.option.git package
- pkglts.option.github package
- pkglts.option.gitlab package
- pkglts.option.landscape package
- pkglts.option.license package
- pkglts.option.notebook package
- pkglts.option.plugin_project package
- pkglts.option.pypi package
- pkglts.option.pysetup package
- pkglts.option.readthedocs package
- pkglts.option.requires package
- pkglts.option.sphinx package
- pkglts.option.test package
- pkglts.option.tox package
- pkglts.option.travis package
- pkglts.option.version package
- Module contents
- Subpackages
Submodules¶
pkglts.config module¶
pkglts.config_management module¶
-
class
pkglts.config_management.
Config
(*args, **kwds)[source]¶ Bases:
dict
Object used to store both a templated version of the config as a dict interface its resolution and a jinja2 environment that reflect the config.
-
class
pkglts.config_management.
ConfigSection
[source]¶ Bases:
object
Small class to allow accessing parameters using the dot method instead of [‘param_name’] method
-
pkglts.config_management.
get_pkg_config
(rep='.')[source]¶ Read pkg_cfg file associated to this package.
Parameters: rep (str) – directory to search for info Returns: Config initialized with pkg_config Return type: (Config)
pkglts.data_access module¶
Set of function to work with resources that are located inside this package data
-
pkglts.data_access.
get
(file_name, mode='r')[source]¶ Retrieve the content of a given filename located in the data part of this package.
Parameters: - filename (-) – name of the file to read
- mode (-) – mode to use to read the file either ‘r’ or ‘rb’
Returns: content of the file red in ‘r’ mode
Return type: (str)
-
pkglts.data_access.
ls
(dir_name)[source]¶ List all files and directories in dir_name located in the data part of this package.
Parameters: dir_name (-) – name of the directory to walk Returns: - list the content of dir_name
- without any specific order, items are (entity_name, is_directory)
Return type: (list of [str, bool])
pkglts.dependency module¶
pkglts.file_management module¶
pkglts.hash_management module¶
-
pkglts.hash_management.
compute_hash
(txt)[source]¶ Compute hash summary of a text
Parameters: txt (str) – content to hash Returns: hash key Return type: (str)
-
pkglts.hash_management.
get_pkg_hash
(rep='.')[source]¶ Read pkg_hash file associated to this package
Parameters: rep (str) – directory to search for info Returns: - hash map of preserved sections in this
- package
Return type: (dict of str, list)
-
pkglts.hash_management.
modified_file_hash
(pth, pkg_hash)[source]¶ Check whether a file complies with previously stored hash
Parameters: Returns: whether this file has been modified or not
Return type: (bool)
pkglts.local module¶
Regroup set of functions that make use of local environment inside a package. Just a way to normalize pre defined paths.
-
pkglts.local.
init_namespace_dir
(pth, cfg)[source]¶ Populate a directory with specific __init__.py for namespace packages.
Parameters: Returns: None
pkglts.logging_tools module¶
pkglts.manage module¶
Contains functions to manage the structure of the package.
Use ‘setup.py’ for common tasks.
-
pkglts.manage.
add_option
(name, cfg)[source]¶ Add a new option to this package.
Notes: See the list of available options online
Parameters: Returns: updated package configuration
Return type: (Config)
-
pkglts.manage.
clean
(rep='.')[source]¶ Thorough cleaning of all arborescence rooting at rep.
Todo: exception list instead of hardcoded one
Parameters: rep (str) – default ”.”, top directory to clean Returns: None
-
pkglts.manage.
init_pkg
(rep='.')[source]¶ Initialise a package in given directory.
Parameters: rep (str) – directory to create pkg into, default current Returns: None
-
pkglts.manage.
install_example_files
(option, cfg, target='.')[source]¶ Install example files associated to an option.
Parameters: Returns: whether operation succeeded or not
Return type: (bool)
-
pkglts.manage.
regenerate_option
(cfg, name, target='.', overwrite=False)[source]¶ Call the regenerate function of a given option
Parameters: Returns: None
pkglts.manage_script module¶
-
pkglts.manage_script.
action_clear
(*args, **kwds)[source]¶ Attempt to free the package from pkglts interactions.
-
pkglts.manage_script.
action_example
(*args, **kwds)[source]¶ Install example files associated with options.
pkglts.manage_tools module¶
Specific helper function for manage script
-
pkglts.manage_tools.
check_option_parameters
(name, cfg)[source]¶ Check that the parameters associated to an option are valid.
Try to import Check function in option dir.
Parameters:
-
pkglts.manage_tools.
ensure_installed_packages
(requirements, msg, cfg)[source]¶ Ensure all packages in requirements are installed.
If not, ask user permission to install them.
Parameters: Returns: whether all required packages are installed or not
Return type: (bool)
pkglts.option_tools module¶
Some helpers for options
pkglts.templating module¶
-
pkglts.templating.
parse_source
(txt)[source]¶ Parse text to find preserved blocks
Parameters: txt (str) – full text to parse Returns: - ordered list of blocks:
- block_id (or None if content is not preserved
- line start before start for preserved content
- content
- line start before end for preserved content
Return type: (list of [str, str, str, str])
pkglts.tree_ascii_fmt module¶
pkglts.version module¶
-
pkglts.version.
major
= 2¶ (int) Version major component.
-
pkglts.version.
minor
= 1¶ (int) Version minor component.
-
pkglts.version.
post
= 0¶ (int) Version post or bugfix component.