module packaged.automate_install

Inheritance diagram of pymyinstall.packaged.automate_install

Short summary

module pymyinstall.packaged.automate_install

Install or update all packages.

Classes

class

truncated documentation

FileShouldNotBeFound

Raised by function check_sys_path().

Functions

function

truncated documentation

_build_reverse_index

builds a reverse index of the module,

check_sys_path

An issue is happening during unit test as pymyinstall could be imported from two locations. We check this is not …

download_module

Downloads the module without installation.

find_module_install

Checks if there are specific instructions to run before installing module name, on Windows, some modules requires …

install_all

Installs modules in list_module if None, this list will be returned by ensae_fullset(), the function starts …

install_module

Installs a module.

install_module_deps

Installs a module with its dependencies, if a module is already installed, it installs the missing dependencies. …

reorder_module_list

reorder a list of modules to install, a module at position p should not depend not module at position p+1

update_all

Updates modules in list_module if None, this list will be returned by ensae_fullset(), the function starts …

update_module

Updates modules in list_module if None, this list will be returned by ensae_fullset(), the function starts …

Documentation

Install or update all packages.

Skipped modules

Some modules are still marked as a dependency by others even if they are not needed or cannot be installed.

source on GitHub

exception pymyinstall.packaged.automate_install.FileShouldNotBeFound[source]

Bases: Exception

Raised by function check_sys_path.

source on GitHub

pymyinstall.packaged.automate_install._build_reverse_index()[source]

builds a reverse index of the module,

source on GitHub

pymyinstall.packaged.automate_install.check_sys_path()[source]

An issue is happening during unit test as pymyinstall could be imported from two locations. We check this is not the case.

source on GitHub

pymyinstall.packaged.automate_install.download_module(module_name, temp_folder='.', force=False, unzipFile=True, file_save=None, deps=False, source=None, fLOG=<built-in function print>)[source]

Downloads the module without installation.

Parameters
  • temp_folder – destination

  • force – force the installation even if already installed

  • unzipFile – if it can be unzipped, it will be (for github, mostly)

  • file_save – for debug purposes, do not change it unless you know what you are doing

  • deps – download the dependencies too (only available for pip)

  • source – overwrite the wheels location, see get_exewheel_url_link2

Returns

downloaded files

source on GitHub

pymyinstall.packaged.automate_install.find_module_install(name, must_exist=False)[source]

Checks if there are specific instructions to run before installing module name, on Windows, some modules requires compilation, if not uses default option with pip.

Parameters
  • name – module name, the name can include a specific version number with ‘==’

  • must_exist – if True, raise an exception if not found

Returns

ModuleInstall

source on GitHub

pymyinstall.packaged.automate_install.install_all(temp_folder='.', fLOG=<built-in function print>, verbose=True, list_module=None, reorder=True, skip_module=None, up_pip=True, skip_missing=False, deps=False, schedule_only=False, deep_deps=False, _memory=None, source=None, download_only=False, force=False)[source]

Installs modules in list_module if None, this list will be returned by ensae_fullset, the function starts by updating pip.

Parameters
  • temp_folder – temporary folder

  • verbose – more display

  • list_module – None or of list of str or ModuleInstall or a name set

  • fLOG – logging function

  • reorder – reorder the modules to update first modules with less dependencies (as much as as possible)

  • skip_module – module to skip (list of str)

  • up_pip – upgrade pip (pip must not be in skip_module)

  • skip_missing – skip the checking of the missing dependencies

  • deps – install the dependencies of the installed modules

  • schedule_only – if True, the function returns the list of modules scheduled to be installed

  • deep_deps – check dependencies for dependencies

  • _memory – stores installed packages, avoid going into an infinite loop

  • source – overwrite the location of the wheels, see get_exewheel_url_link2

  • download_only – only downloads the module, no installation

  • force – force the installation or the download

Returns

output streams

list_module can be a set of modules of a name set. Name sets can be accesses by function get_package_set. See the function to get the list of possible name sets.

About name set, the function can install a set of modules but these set of modules have dependencies:

  • extended_set, sphinx_theme_set() requires small_set()

  • ml_set, ensae_set(), teachings_set(), iot_set(), scraping_set() requires small_set and extended_set()

If you want to install a specific module with its dependencies, I suggest to use option deep_deps.

New in version 1.1.

source on GitHub

pymyinstall.packaged.automate_install.install_module(module_name, temp_folder='.', fLOG=<built-in function print>, verbose=True, reorder=True, skip_module=None, up_pip=True, skip_missing=False, deps=False, schedule_only=False, deep_deps=False, _memory=None, source=None, download_only=False, force=False)[source]

Installs a module.

Parameters
  • module_name – module to install

  • temp_folder – temporary folder

  • verbose – more display

  • fLOG – logging function

  • reorder – reorder the modules to update first modules with less dependencies (as much as as possible)

  • skip_module – module to skip (list of str)

  • up_pip – upgrade pip (pip must not be in skip_module)

  • skip_missing – skip the checking of the missing dependencies

  • deps – install the dependencies of the installed modules

  • schedule_only – if True, the function returns the list of modules scheduled to be installed

  • deep_deps – check dependencies for dependencies

  • _memory – stores installed packages, avoid going into an infinite loop

  • source – overwrite the wheels location, see get_exewheel_url_link2

  • download_only – only downloads the module, no installation

  • force – force the download or the install

New in version 1.1.

source on GitHub

pymyinstall.packaged.automate_install.install_module_deps(name, temp_folder='.', fLOG=<built-in function print>, verbose=True, deps=True, deep_deps=False, _memory=None, source=None, download_only=False, force=False)[source]

Installs a module with its dependencies, if a module is already installed, it installs the missing dependencies.

Parameters
  • module – module name

  • temp_folder – where to download

  • fLOG – logging function

  • verbose – more display

  • deps – add dependencies

  • deep_deps – check dependencies for dependencies

  • _memory – stores installed packages, avoid going into an infinite loop

  • source – overwrite the wheels location, see get_exewheel_url_link2

  • download_only – only downloads the module, no installation

  • force – force the download or the update

Returns

list of installed modules

The function does not handle properly contraints on versions. It checks in the registered list of modules if name is present. If it is the case, it uses it, otherwise, it uses pip.

New in version 1.1.

source on GitHub

pymyinstall.packaged.automate_install.reorder_module_list(list_module)[source]

reorder a list of modules to install, a module at position p should not depend not module at position p+1

Parameters

list_module – list of module (ModuleInstall)

Returns

list of modules

The function uses modules stored in pyminstall.packaged.packaged_config, it does not go to pypi. If a module was not registered, it will be placed at the end in the order it was given to this function.

source on GitHub

pymyinstall.packaged.automate_install.update_all(temp_folder='.', fLOG=<built-in function print>, verbose=True, list_module=None, reorder=True, skip_module=None, schedule_only=False, source=None, download_only=False)[source]

Updates modules in list_module if None, this list will be returned by ensae_fullset, the function starts by updating pip.

Parameters
  • temp_folder – temporary folder

  • verbose – more display

  • list_module – None or of list of str or ModuleInstall or a name set

  • fLOG – logging function

  • reorder – reorder the modules to update first modules with less dependencies (as much as as possible)

  • skip_module – module to skip (list of str)

  • schedule_only – if True, the function returns the list of modules scheduled to be installed

  • source – overwrite the wheels location, see get_exewheel_url_link2

  • download_only – only downloads the module, no installation

list_module can be a set of modules of a name set. Name sets can be accesses by function get_package_set. See the function to get the list of possible name sets.

Changed in version 1.1: Catch an exception while updating modules and walk through the end of the list. The function should be run a second time to make sure an exception remains. It can be due to python keeping in memory an updated module. Parameters source, download_only were added.

source on GitHub

pymyinstall.packaged.automate_install.update_module(module_name, temp_folder='.', fLOG=<built-in function print>, verbose=True, reorder=True, skip_module=None, schedule_only=False, source=None)[source]

Updates modules in list_module if None, this list will be returned by ensae_fullset, the function starts by updating pip.

Parameters
  • module_name – module to update

  • temp_folder – temporary folder

  • verbose – more display

  • fLOG – logging function

  • reorder – reorder the modules to update first modules with less dependencies (as much as as possible)

  • skip_module – module to skip (list of str)

  • schedule_only – if True, the function returns the list of modules scheduled to be installed

  • source – overwrite the wheels location, see get_exewheel_url_link2

source on GitHub