thoth.solver package

Subpackages

Submodules

thoth.solver.cli module

Thoth-solver CLI.

thoth.solver.exceptions module

Exception hierarchy used in thoth-solver.

exception thoth.solver.exceptions.NoReleasesFound[source]

Bases: thoth.solver.exceptions.SolverException

Exception raised if no releases were found for the given package.

exception thoth.solver.exceptions.SolverException[source]

Bases: Exception

Exception to be raised in Solver.

Module contents

Thoth’s solver package.

class thoth.solver.PythonDependencyParser[source]

Bases: thoth.solver.python.base.DependencyParser

Python Dependency parsing.

parse(specs: List[str]) List[Requirement][source]

Parse specs.

static parse_python(spec: str) packaging.requirements.Requirement[source]

Parse PyPI specification of a single dependency.

Parameters

spec – str, for example “Django>=1.5,<1.8”

Returns

requirement for the Python package

class thoth.solver.PythonReleasesFetcher(*, source: thoth.python.source.Source)[source]

Bases: thoth.solver.python.base.ReleasesFetcher

A releases fetcher based on PEP compatible simple API (also supporting Warehouse API).

fetch_releases(package_name: str) Tuple[str, List[Tuple[str, str]]][source]

Fetch package and index_url for a package_name.

property index_url

Get URL to package source index from where releases are fetched.

source
class thoth.solver.PythonSolver(*, dependency_parser: thoth.solver.python.python_solver.PythonDependencyParser, releases_fetcher: thoth.solver.python.python_solver.PythonReleasesFetcher)[source]

Bases: thoth.solver.python.base.Solver

PyPI dependencies solver.

dependency_parser
releases_fetcher
thoth.solver.get_ecosystem_solver(ecosystem_name: str) thoth.solver.python.base.Solver[source]

Get Solver subclass instance for particular ecosystem.

Parameters

ecosystem_name – name of ecosystem for which solver should be get

Returns

Solver

thoth.solver.resolve(requirements: List[str], *, index_urls: List[str], dependency_index_urls: Optional[List[str]], python_version: int, exclude_packages: Optional[Set[str]], transitive: bool, virtualenv: Optional[str], limited_output: bool = True) Dict[str, Any][source]

Resolve given requirements for the given Python version.