solve#
SolveStrategy = Literal['highest', 'lowest', 'lowest-direct']
module-attribute
#
Defines the strategy to use when multiple versions of a package are available during solving.
solve(channels, specs, gateway=Gateway(), platforms=None, locked_packages=None, pinned_packages=None, virtual_packages=None, timeout=None, channel_priority=ChannelPriority.Strict, exclude_newer=None, strategy='highest', constraints=None)
async
#
Resolve the dependencies and return the RepoDataRecord
s
that should be present in the environment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
channels
|
Sequence[Channel | str]
|
The channels to query for the packages. |
required |
specs
|
Sequence[MatchSpec | str]
|
A list of matchspec to solve. |
required |
platforms
|
Optional[Sequence[Platform | PlatformLiteral]]
|
The platforms to query for the packages. If |
None
|
gateway
|
Gateway
|
The gateway to use for acquiring repodata. |
Gateway()
|
locked_packages
|
Optional[Sequence[RepoDataRecord]]
|
Records of packages that are previously selected. If the solver encounters multiple variants of a single package (identified by its name), it will sort the records and select the best possible version. However, if there exists a locked version it will prefer that variant instead. This is useful to reduce the number of packages that are updated when installing new packages. Usually you add the currently installed packages or packages from a lock-file here. |
None
|
pinned_packages
|
Optional[Sequence[RepoDataRecord]]
|
Records of packages that are previously selected and CANNOT
be changed. If the solver encounters multiple variants of
a single package (identified by its name), it will sort the
records and select the best possible version. However, if
there is a variant available in the |
None
|
virtual_packages
|
Optional[Sequence[GenericVirtualPackage | VirtualPackage]]
|
A list of virtual packages considered active. |
None
|
channel_priority
|
ChannelPriority
|
(Default = ChannelPriority.Strict) When |
Strict
|
timeout
|
Optional[timedelta]
|
The maximum time the solver is allowed to run. |
None
|
exclude_newer
|
Optional[datetime]
|
Exclude any record that is newer than the given datetime. |
None
|
strategy
|
SolveStrategy
|
The strategy to use when multiple versions of a package are available.
|
'highest'
|
constraints
|
Optional[Sequence[MatchSpec | str]]
|
Additional constraints that should be satisfied by the solver.
Packages included in the |
None
|
Returns:
Type | Description |
---|---|
List[RepoDataRecord]
|
Resolved list of |
solve_with_sparse_repodata(specs, sparse_repodata, locked_packages=None, pinned_packages=None, virtual_packages=None, timeout=None, channel_priority=ChannelPriority.Strict, exclude_newer=None, strategy='highest', constraints=None)
async
#
Resolve the dependencies and return the RepoDataRecord
s
that should be present in the environment.
This function is similar to solve
but instead of querying for repodata
with a Gateway
object this function allows you to manually pass in the
repodata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
specs
|
Sequence[MatchSpec | str]
|
A list of matchspec to solve. |
required |
sparse_repodata
|
Sequence[SparseRepoData]
|
The repodata to query for the packages. |
required |
locked_packages
|
Optional[Sequence[RepoDataRecord]]
|
Records of packages that are previously selected. If the solver encounters multiple variants of a single package (identified by its name), it will sort the records and select the best possible version. However, if there exists a locked version it will prefer that variant instead. This is useful to reduce the number of packages that are updated when installing new packages. Usually you add the currently installed packages or packages from a lock-file here. |
None
|
pinned_packages
|
Optional[Sequence[RepoDataRecord]]
|
Records of packages that are previously selected and CANNOT
be changed. If the solver encounters multiple variants of
a single package (identified by its name), it will sort the
records and select the best possible version. However, if
there is a variant available in the |
None
|
virtual_packages
|
Optional[Sequence[GenericVirtualPackage | VirtualPackage]]
|
A list of virtual packages considered active. |
None
|
channel_priority
|
ChannelPriority
|
(Default = ChannelPriority.Strict) When |
Strict
|
timeout
|
Optional[timedelta]
|
The maximum time the solver is allowed to run. |
None
|
exclude_newer
|
Optional[datetime]
|
Exclude any record that is newer than the given datetime. |
None
|
strategy
|
SolveStrategy
|
The strategy to use when multiple versions of a package are available.
|
'highest'
|
constraints
|
Optional[Sequence[MatchSpec | str]]
|
Additional constraints that should be satisfied by the solver.
Packages included in the |
None
|
Returns:
Type | Description |
---|---|
List[RepoDataRecord]
|
Resolved list of |