Skip to content

Commit

Permalink
Merge pull request #163 from sarugaku:separate-resolvers-modules
Browse files Browse the repository at this point in the history
fix: separate resolvers into different modules
  • Loading branch information
frostming authored Aug 1, 2024
2 parents 7961d60 + 59a5e38 commit d4a1da9
Show file tree
Hide file tree
Showing 10 changed files with 620 additions and 610 deletions.
3 changes: 2 additions & 1 deletion examples/reporter_demo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from collections import namedtuple

import resolvelib
from packaging.specifiers import SpecifierSet
from packaging.version import Version

import resolvelib

index = """
first 1.0.0
second == 1.0.0
Expand Down
17 changes: 6 additions & 11 deletions src/resolvelib/reporters.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
from __future__ import annotations

from typing import Generic

from .structs import (
CT,
KT,
RT,
Collection,
Criterion,
RequirementInformation,
State,
)
from typing import TYPE_CHECKING, Collection, Generic

from .structs import CT, KT, RT, RequirementInformation, State

if TYPE_CHECKING:
from .resolvers.criterion import Criterion


class BaseReporter(Generic[RT, CT, KT]):
Expand Down
5 changes: 3 additions & 2 deletions src/resolvelib/resolvers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
from ..structs import RequirementInformation
from .abstract import AbstractResolver, Result
from .criterion import (
from .exceptions import (
InconsistentCandidate,
RequirementsConflicted,
ResolutionError,
ResolutionImpossible,
ResolutionTooDeep,
Resolver,
ResolverException,
)
from .resolution import Resolution, Resolver

__all__ = [
"AbstractResolver",
"InconsistentCandidate",
"Resolver",
"Resolution",
"RequirementsConflicted",
"ResolutionError",
"ResolutionImpossible",
Expand Down
8 changes: 4 additions & 4 deletions src/resolvelib/resolvers/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import collections
from typing import TYPE_CHECKING, Any, Generic, Iterable, Mapping, NamedTuple

from resolvelib.providers import AbstractProvider
from resolvelib.reporters import BaseReporter

from ..structs import CT, KT, RT, Criterion, DirectedGraph
from ..providers import AbstractProvider
from ..reporters import BaseReporter
from ..structs import CT, KT, RT, DirectedGraph
from .criterion import Criterion

if TYPE_CHECKING:

Expand Down
Loading

0 comments on commit d4a1da9

Please sign in to comment.