Skip to content

manager

dev_tool.services.python.package.manager

PackageManager

Bases: Protocol

A protocol for package managers.

This class defines the interface for package management operations.

is_available

A method that checks if the package manager is available on the system.

Returns:

  • bool

    True if the package manager is available, False otherwise.

Source code in dev_tool/services/python/package/manager.py
def is_available(self) -> bool:
    """
    A method that checks if the package manager is available on the system.

    :return: True if the package manager is available, False otherwise.
    """

    ...

install_package

A method that installs a package using the default package manager.

Source code in dev_tool/services/python/package/manager.py
def install_package(self, package: str) -> bool:
    """A method that installs a package using the default package manager."""

    ...

install_package_manager

A method that installs the package manager if it is not already installed.

Returns:

  • bool

    True if the installation was successful, False otherwise.

Source code in dev_tool/services/python/package/manager.py
def install_package_manager(self) -> bool:
    """
    A method that installs the package manager if it is not already installed.

    :return: True if the installation was successful, False otherwise.
    """

    ...

create_virtual_environment

A method that creates a virtual environment.

Returns:

  • bool

    True if the creation was successful, False otherwise.

Source code in dev_tool/services/python/package/manager.py
def create_virtual_environment(self) -> bool:
    """
    A method that creates a virtual environment.

    :return: True if the creation was successful, False otherwise.
    """

    ...

install_from_requirements

A method that installs dependencies from a requirements file.

Parameters:

  • requirements (Path) –

    The path to the requirements file.

Returns:

  • bool

    True if the installation was successful, False otherwise.

Source code in dev_tool/services/python/package/manager.py
def install_from_requirements(self, requirements: Path) -> bool:
    """
    A method that installs dependencies from a requirements file.

    :param requirements: The path to the requirements file.
    :return: True if the installation was successful, False otherwise.
    """

    ...

install_from_pyproject

A method that installs dependencies from pyproject.toml.

Parameters:

  • extras (list[str] | None, default: None ) –

    Optional list of extra dependency groups to install.

Returns:

  • bool

    True if the installation was successful, False otherwise.

Source code in dev_tool/services/python/package/manager.py
def install_from_pyproject(self, extras: list[str] | None = None) -> bool:
    """
    A method that installs dependencies from pyproject.toml.

    :param extras: Optional list of extra dependency groups to install.
    :return: True if the installation was successful, False otherwise.
    """

    ...

uninstall_package

A method that uninstalls a package.

Parameters:

  • package (str) –

    The name of the package to uninstall.

Returns:

  • bool

    True if the uninstallation was successful, False otherwise.

Source code in dev_tool/services/python/package/manager.py
def uninstall_package(self, package: str) -> bool:
    """
    A method that uninstalls a package.

    :param package: The name of the package to uninstall.
    :return: True if the uninstallation was successful, False otherwise.
    """

    ...

upgrade_package_manager

A method that upgrades the package manager to the latest version.

Returns:

  • bool

    True if the upgrade was successful, False otherwise.

Source code in dev_tool/services/python/package/manager.py
def upgrade_package_manager(self) -> bool:
    """
    A method that upgrades the package manager to the latest version.

    :return: True if the upgrade was successful, False otherwise.
    """

    ...

list_installed_packages

A method that lists all installed packages.

Returns:

  • list[str]

    A list of installed package names.

Source code in dev_tool/services/python/package/manager.py
def list_installed_packages(self) -> list[str]:
    """
    A method that lists all installed packages.

    :return: A list of installed package names.
    """

    ...