id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12,800 | sdispater/poetry | src/poetry/installation/operations/update.py | installation.operations.update.Update | from poetry.installation.operations.operation import Operation
class Update(Operation):
def __init__(self, initial: Package, target: Package, reason: str | None=None, priority: int=0) -> None:
self._initial_package = initial
self._target_package = target
super().__init__(reason, priority=p... |
class Update(Operation):
def __init__(self, initial: Package, target: Package, reason: str | None=None, priority: int=0) -> None:
pass
@property
def initial_package(self) -> Package:
pass
@property
def target_package(self) -> Package:
pass
@property
def package(self... | 12 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 3 | 0 | 0 | 7 | 2 | 7 | 36 | 44 | 7 | 37 | 24 | 19 | 0 | 21 | 14 | 13 | 1 | 5 | 0 | 7 |
12,801 | sdispater/poetry | src/poetry/installation/wheel_installer.py | installation.wheel_installer.WheelDestination | from pathlib import Path
from installer.destinations import SchemeDictionaryDestination
class WheelDestination(SchemeDictionaryDestination):
""" """
def write_to_fs(self, scheme: Scheme, path: str, stream: BinaryIO, is_executable: bool) -> RecordEntry:
from installer.records import Hash
from i... |
class WheelDestination(SchemeDictionaryDestination):
''' '''
def write_to_fs(self, scheme: Scheme, path: str, stream: BinaryIO, is_executable: bool) -> RecordEntry:
pass | 2 | 1 | 31 | 5 | 22 | 4 | 4 | 0.22 | 1 | 4 | 0 | 0 | 1 | 0 | 1 | 1 | 34 | 6 | 23 | 16 | 11 | 5 | 17 | 9 | 11 | 4 | 1 | 1 | 4 |
12,802 | sdispater/poetry | src/poetry/installation/wheel_installer.py | installation.wheel_installer.WheelInstaller | from installer.sources import WheelFile
from installer import install
import sys
from installer.sources import _WheelFileValidationError
import platform
from pathlib import Path
from poetry.utils._compat import WINDOWS
from poetry.__version__ import __version__
class WheelInstaller:
def __init__(self, env: Env) -... |
class WheelInstaller:
def __init__(self, env: Env) -> None:
pass
def enable_bytecode_compilation(self, enable: bool=True) -> None:
pass
def install(self, wheel: Path) -> None:
pass | 4 | 0 | 15 | 1 | 13 | 1 | 3 | 0.1 | 0 | 9 | 2 | 0 | 3 | 4 | 3 | 3 | 49 | 6 | 39 | 12 | 35 | 4 | 24 | 10 | 20 | 5 | 0 | 2 | 9 |
12,803 | sdispater/poetry | src/poetry/layouts/layout.py | layouts.layout.Layout | from poetry.core.utils.patterns import AUTHOR_REGEX
from tomlkit import inline_table
from typing import Any
from tomlkit import loads
from poetry.factory import Factory
from packaging.utils import canonicalize_name
from poetry.core.utils.helpers import module_name
from tomlkit.toml_document import TOMLDocument
from poe... |
class Layout:
def __init__(self, project: str, version: str='0.1.0', description: str='', readme_format: str='md', author: str | None=None, license: str | None=None, python: str | None=None, dependencies: Mapping[str, str | Mapping[str, Any]] | None=None, dev_dependencies: Mapping[str, str | Mapping[str, Any]] | ... | 14 | 0 | 16 | 3 | 13 | 1 | 3 | 0.05 | 0 | 7 | 0 | 1 | 9 | 11 | 10 | 10 | 177 | 37 | 133 | 61 | 106 | 7 | 107 | 44 | 96 | 13 | 0 | 2 | 29 |
12,804 | sdispater/poetry | src/poetry/layouts/src.py | layouts.src.SrcLayout | from poetry.layouts.layout import Layout
from pathlib import Path
class SrcLayout(Layout):
@property
def basedir(self) -> Path:
return Path('src') |
class SrcLayout(Layout):
@property
def basedir(self) -> Path:
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 11 | 4 | 0 | 4 | 3 | 1 | 0 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
12,805 | sdispater/poetry | src/poetry/masonry/builders/editable.py | masonry.builders.editable.EditableBuilder | from poetry.core.masonry.builders.builder import Builder
import json
from poetry.utils._compat import WINDOWS
from poetry.core.masonry.utils.package_include import PackageInclude
from poetry.utils.helpers import is_dir_writable
from poetry.utils.pip import pip_install
from poetry.utils.env import build_environment
impo... |
class EditableBuilder(Builder):
def __init__(self, poetry: Poetry, env: Env, io: IO) -> None:
pass
def build(self, target_dir: Path | None=None) -> Path:
pass
def _run_build_script(self, build_script: str) -> None:
pass
def _setup_build(self) -> None:
pass
def _... | 10 | 0 | 26 | 4 | 22 | 0 | 3 | 0.02 | 1 | 7 | 1 | 0 | 9 | 4 | 9 | 9 | 243 | 44 | 196 | 51 | 185 | 3 | 127 | 44 | 116 | 8 | 1 | 3 | 28 |
12,806 | sdispater/poetry | src/poetry/mixology/assignment.py | mixology.assignment.Assignment | from poetry.mixology.term import Term
class Assignment(Term):
"""
A term in a PartialSolution that tracks some additional metadata.
"""
def __init__(self, dependency: Dependency, is_positive: bool, decision_level: int, index: int, cause: Incompatibility | None=None) -> None:
super().__init__(d... |
class Assignment(Term):
'''
A term in a PartialSolution that tracks some additional metadata.
'''
def __init__(self, dependency: Dependency, is_positive: bool, decision_level: int, index: int, cause: Incompatibility | None=None) -> None:
pass
@property
def decision_level(self) -> int:
... | 13 | 1 | 5 | 0 | 4 | 0 | 1 | 0.08 | 1 | 4 | 1 | 0 | 5 | 3 | 7 | 20 | 48 | 8 | 37 | 30 | 10 | 3 | 18 | 11 | 10 | 1 | 1 | 0 | 7 |
12,807 | sdispater/poetry | src/poetry/mixology/failure.py | mixology.failure.SolveFailureError | class SolveFailureError(Exception):
def __init__(self, incompatibility: Incompatibility) -> None:
self._incompatibility = incompatibility
@property
def message(self) -> str:
return str(self)
def __str__(self) -> str:
return _Writer(self._incompatibility).write() | class SolveFailureError(Exception):
def __init__(self, incompatibility: Incompatibility) -> None:
pass
@property
def message(self) -> str:
pass
def __str__(self) -> str:
pass | 5 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 3 | 2 | 0 | 3 | 1 | 3 | 13 | 10 | 2 | 8 | 6 | 3 | 0 | 7 | 5 | 3 | 1 | 3 | 0 | 3 |
12,808 | sdispater/poetry | src/poetry/mixology/failure.py | mixology.failure._Writer | from poetry.mixology.incompatibility_cause import ConflictCauseError
from poetry.mixology.incompatibility_cause import PythonCauseError
from poetry.core.constraints.version import parse_constraint
class _Writer:
def __init__(self, root: Incompatibility) -> None:
self._root = root
self._derivations... |
class _Writer:
def __init__(self, root: Incompatibility) -> None:
pass
def write(self) -> str:
pass
def _write(self, incompatibility: Incompatibility, message: str, numbered: bool=False) -> None:
pass
def _visit(self, incompatibility: Incompatibility, conclusion: bool=False)... | 8 | 0 | 39 | 4 | 35 | 0 | 6 | 0.01 | 0 | 9 | 3 | 0 | 7 | 4 | 7 | 7 | 280 | 34 | 245 | 55 | 231 | 2 | 130 | 49 | 122 | 16 | 0 | 3 | 41 |
12,809 | sdispater/poetry | src/poetry/mixology/incompatibility.py | mixology.incompatibility.Incompatibility | from poetry.mixology.incompatibility_cause import NoVersionsCauseError
from poetry.mixology.incompatibility_cause import ConflictCauseError
from poetry.mixology.incompatibility_cause import DependencyCauseError
from poetry.mixology.incompatibility_cause import PlatformCauseError
from poetry.mixology.incompatibility_cau... |
class Incompatibility:
def __init__(self, terms: list[Term], cause: IncompatibilityCauseError) -> None:
pass
@property
def terms(self) -> list[Term]:
pass
@property
def cause(self) -> IncompatibilityCauseError:
pass
@property
def external_incompatibilities(self) -> ... | 17 | 1 | 32 | 5 | 25 | 1 | 6 | 0.05 | 0 | 8 | 1 | 0 | 13 | 2 | 13 | 13 | 429 | 81 | 333 | 96 | 294 | 15 | 230 | 71 | 216 | 19 | 0 | 3 | 75 |
12,810 | sdispater/poetry | src/poetry/mixology/incompatibility_cause.py | mixology.incompatibility_cause.ConflictCauseError | class ConflictCauseError(IncompatibilityCauseError):
"""
The incompatibility was derived from two existing incompatibilities
during conflict resolution.
"""
def __init__(self, conflict: Incompatibility, other: Incompatibility) -> None:
self._conflict = conflict
self._other = other
... | class ConflictCauseError(IncompatibilityCauseError):
'''
The incompatibility was derived from two existing incompatibilities
during conflict resolution.
'''
def __init__(self, conflict: Incompatibility, other: Incompatibility) -> None:
pass
@property
def conflict(self) -> Incompatib... | 7 | 1 | 2 | 0 | 2 | 0 | 1 | 0.33 | 1 | 2 | 1 | 0 | 4 | 2 | 4 | 14 | 20 | 4 | 12 | 9 | 5 | 4 | 10 | 7 | 5 | 1 | 4 | 0 | 4 |
12,811 | sdispater/poetry | src/poetry/mixology/incompatibility_cause.py | mixology.incompatibility_cause.DependencyCauseError | class DependencyCauseError(IncompatibilityCauseError):
pass | class DependencyCauseError(IncompatibilityCauseError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,812 | sdispater/poetry | src/poetry/mixology/incompatibility_cause.py | mixology.incompatibility_cause.IncompatibilityCauseError | class IncompatibilityCauseError(Exception):
"""
The reason and Incompatibility's terms are incompatible.
""" | class IncompatibilityCauseError(Exception):
'''
The reason and Incompatibility's terms are incompatible.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 0 | 0 | 6 | 0 | 0 | 0 | 10 | 4 | 0 | 1 | 1 | 0 | 3 | 1 | 1 | 0 | 0 | 3 | 0 | 0 |
12,813 | sdispater/poetry | src/poetry/mixology/incompatibility_cause.py | mixology.incompatibility_cause.NoVersionsCauseError | class NoVersionsCauseError(IncompatibilityCauseError):
pass | class NoVersionsCauseError(IncompatibilityCauseError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,814 | sdispater/poetry | src/poetry/mixology/incompatibility_cause.py | mixology.incompatibility_cause.PlatformCauseError | class PlatformCauseError(IncompatibilityCauseError):
"""
The incompatibility represents a package's platform constraint
(OS most likely) being incompatible with the current platform.
"""
def __init__(self, platform: str) -> None:
self._platform = platform
@property
def platform(sel... | class PlatformCauseError(IncompatibilityCauseError):
'''
The incompatibility represents a package's platform constraint
(OS most likely) being incompatible with the current platform.
'''
def __init__(self, platform: str) -> None:
pass
@property
def platform(self) -> str:
pas... | 4 | 1 | 2 | 0 | 2 | 0 | 1 | 0.67 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 12 | 12 | 2 | 6 | 5 | 2 | 4 | 5 | 4 | 2 | 1 | 4 | 0 | 2 |
12,815 | sdispater/poetry | src/poetry/mixology/incompatibility_cause.py | mixology.incompatibility_cause.PythonCauseError | class PythonCauseError(IncompatibilityCauseError):
"""
The incompatibility represents a package's python constraint
(Python versions) being incompatible
with the current python version.
"""
def __init__(self, python_version: str, root_python_version: str) -> None:
self._python_version =... | class PythonCauseError(IncompatibilityCauseError):
'''
The incompatibility represents a package's python constraint
(Python versions) being incompatible
with the current python version.
'''
def __init__(self, python_version: str, root_python_version: str) -> None:
pass
@property
... | 6 | 1 | 2 | 0 | 2 | 0 | 1 | 0.5 | 1 | 1 | 0 | 0 | 3 | 2 | 3 | 13 | 18 | 3 | 10 | 8 | 4 | 5 | 8 | 6 | 4 | 1 | 4 | 0 | 3 |
12,816 | sdispater/poetry | src/poetry/mixology/incompatibility_cause.py | mixology.incompatibility_cause.RootCauseError | class RootCauseError(IncompatibilityCauseError):
pass | class RootCauseError(IncompatibilityCauseError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
12,817 | sdispater/poetry | src/poetry/mixology/partial_solution.py | mixology.partial_solution.PartialSolution | from poetry.mixology.set_relation import SetRelation
from poetry.mixology.assignment import Assignment
class PartialSolution:
"""
# A list of Assignments that represent the solver's current best guess about
# what's true for the eventual set of package versions that will comprise the
# total solution.
... |
class PartialSolution:
'''
# A list of Assignments that represent the solver's current best guess about
# what's true for the eventual set of package versions that will comprise the
# total solution.
#
# See:
# https://github.com/dart-lang/mixology/tree/master/doc/solver.md#partial-solution... | 18 | 7 | 13 | 2 | 8 | 3 | 3 | 0.45 | 0 | 11 | 4 | 0 | 13 | 6 | 13 | 13 | 199 | 37 | 112 | 39 | 92 | 50 | 85 | 33 | 71 | 8 | 0 | 3 | 33 |
12,818 | sdispater/poetry | src/poetry/mixology/result.py | mixology.result.SolverResult | class SolverResult:
def __init__(self, root: ProjectPackage, packages: list[Package], attempted_solutions: int) -> None:
self._root = root
self._packages = packages
self._attempted_solutions = attempted_solutions
@property
def packages(self) -> list[Package]:
return self._p... | class SolverResult:
def __init__(self, root: ProjectPackage, packages: list[Package], attempted_solutions: int) -> None:
pass
@property
def packages(self) -> list[Package]:
pass
@property
def attempted_solutions(self) -> int:
pass | 6 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 3 | 3 | 3 | 3 | 18 | 2 | 16 | 14 | 5 | 0 | 9 | 7 | 5 | 1 | 0 | 0 | 3 |
12,819 | sdispater/poetry | src/poetry/mixology/set_relation.py | mixology.set_relation.SetRelation | class SetRelation:
"""
An enum of possible relationships between two sets.
"""
SUBSET = 'subset'
DISJOINT = 'disjoint'
OVERLAPPING = 'overlapping' | class SetRelation:
'''
An enum of possible relationships between two sets.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 3 | 4 | 4 | 3 | 3 | 4 | 4 | 3 | 0 | 0 | 0 | 0 |
12,820 | sdispater/poetry | src/poetry/mixology/term.py | mixology.term.Term | import functools
from poetry.mixology.set_relation import SetRelation
class Term:
"""
A statement about a package which is true or false for a given selection of
package versions.
See https://github.com/dart-lang/pub/tree/master/doc/solver.md#term.
"""
def __init__(self, dependency: Dependenc... |
class Term:
'''
A statement about a package which is true or false for a given selection of
package versions.
See https://github.com/dart-lang/pub/tree/master/doc/solver.md#term.
'''
def __init__(self, dependency: Dependency, is_positive: bool) -> None:
pass
@property
def inver... | 17 | 5 | 12 | 1 | 9 | 3 | 3 | 0.34 | 0 | 4 | 1 | 1 | 13 | 4 | 13 | 13 | 184 | 29 | 116 | 29 | 97 | 39 | 76 | 24 | 62 | 15 | 0 | 3 | 39 |
12,821 | sdispater/poetry | src/poetry/mixology/version_solver.py | mixology.version_solver.DependencyCache | import functools
import collections
from poetry.core.packages.dependency import Dependency
from poetry.packages import PackageCollection
class DependencyCache:
"""
A cache of the valid dependencies.
The key observation here is that during the search - except at backtracking
- once we have decided that... |
class DependencyCache:
'''
A cache of the valid dependencies.
The key observation here is that during the search - except at backtracking
- once we have decided that a dependency is invalid, we never need check it
again.
'''
def __init__(self, provider: Provider) -> None:
pass
... | 5 | 1 | 20 | 2 | 14 | 5 | 3 | 0.45 | 0 | 6 | 3 | 0 | 4 | 4 | 4 | 4 | 92 | 12 | 55 | 22 | 42 | 25 | 28 | 14 | 23 | 4 | 0 | 2 | 11 |
12,822 | sdispater/poetry | src/poetry/mixology/version_solver.py | mixology.version_solver.VersionSolver | import collections
from poetry.mixology.partial_solution import PartialSolution
from poetry.core.packages.dependency import Dependency
from poetry.mixology.incompatibility import Incompatibility
from poetry.mixology.result import SolverResult
from poetry.mixology.set_relation import SetRelation
from poetry.mixology.fai... |
class VersionSolver:
'''
The version solver that finds a set of package versions that satisfy the
root package's dependencies.
See https://github.com/dart-lang/pub/tree/master/doc/solver.md for details
on how this solver works.
'''
def __init__(self, root: ProjectPackage, provider: Provide... | 14 | 9 | 38 | 5 | 21 | 11 | 4 | 0.59 | 0 | 23 | 12 | 0 | 11 | 7 | 11 | 11 | 447 | 71 | 237 | 66 | 220 | 139 | 167 | 63 | 153 | 16 | 0 | 4 | 53 |
12,823 | sdispater/poetry | src/poetry/mixology/version_solver.py | mixology.version_solver.VersionSolver._choose_next.Preference | from enum import IntEnum
class Preference(IntEnum):
"""
Preference is one of the criteria for choosing which dependency to solve
first. A higher value means that there are "more options" to satisfy
a dependency. A lower value takes precedence.
"""
DIRECT_ORIGIN = 0
NO_CHOICE = 1
USE_LAT... |
class Preference(IntEnum):
'''
Preference is one of the criteria for choosing which dependency to solve
first. A higher value means that there are "more options" to satisfy
a dependency. A lower value takes precedence.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.83 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 1 | 6 | 6 | 5 | 5 | 6 | 6 | 5 | 0 | 0 | 0 | 0 |
12,824 | sdispater/poetry | src/poetry/packages/dependency_package.py | packages.dependency_package.DependencyPackage | class DependencyPackage:
def __init__(self, dependency: Dependency, package: Package) -> None:
self._dependency = dependency
self._package = package
@property
def dependency(self) -> Dependency:
return self._dependency
@property
def package(self) -> Package:
return... | class DependencyPackage:
def __init__(self, dependency: Dependency, package: Package) -> None:
pass
@property
def dependency(self) -> Dependency:
pass
@property
def package(self) -> Package:
pass
def clone(self) -> DependencyPackage:
pass
def with_features(... | 13 | 0 | 3 | 0 | 2 | 0 | 1 | 0 | 0 | 5 | 0 | 0 | 10 | 2 | 10 | 10 | 37 | 10 | 27 | 16 | 14 | 0 | 25 | 14 | 14 | 2 | 0 | 1 | 11 |
12,825 | sdispater/poetry | src/poetry/packages/direct_origin.py | packages.direct_origin.DirectOrigin | from poetry.utils.helpers import get_file_hash
from poetry.core.packages.utils.link import Link
from poetry.utils.authenticator import get_default_authenticator
from poetry.inspection.info import PackageInfoError
from poetry.utils.helpers import download_file
from poetry.config.config import Config
from poetry.inspecti... |
class DirectOrigin:
def __init__(self, artifact_cache: ArtifactCache) -> None:
pass
@classmethod
def get_package_from_file(cls, file_path: Path) -> Package:
pass
@classmethod
def get_package_from_directory(cls, directory: Path) -> Package:
pass
def _download_file(self,... | 10 | 0 | 10 | 1 | 9 | 0 | 1 | 0 | 0 | 8 | 4 | 0 | 3 | 3 | 6 | 6 | 66 | 10 | 56 | 26 | 38 | 0 | 28 | 15 | 21 | 2 | 0 | 1 | 8 |
12,826 | sdispater/poetry | src/poetry/packages/locker.py | packages.locker.Locker | from poetry.core.constraints.version import Version
from typing import cast
from poetry.core.constraints.version import parse_constraint
from poetry.core.version.markers import parse_marker
from packaging.utils import canonicalize_name
from tomlkit import table
from poetry.toml.file import TOMLFile
import warnings
impo... |
class Locker:
def __init__(self, lock: Path, pyproject_data: dict[str, Any]) -> None:
pass
@property
def lock(self) -> Path:
pass
@property
def lock_data(self) -> dict[str, Any]:
pass
def is_locked(self) -> bool:
'''
Checks whether the locker has been l... | 22 | 5 | 27 | 4 | 21 | 3 | 5 | 0.12 | 0 | 12 | 2 | 0 | 19 | 4 | 19 | 19 | 559 | 100 | 410 | 122 | 376 | 49 | 286 | 104 | 264 | 34 | 0 | 6 | 100 |
12,827 | sdispater/poetry | src/poetry/packages/package_collection.py | packages.package_collection.PackageCollection | from poetry.packages.dependency_package import DependencyPackage
class PackageCollection(list[DependencyPackage]):
def __init__(self, dependency: Dependency, packages: Iterable[Package | DependencyPackage]=()) -> None:
self._dependency = dependency
super().__init__()
for package in package... |
class PackageCollection(list[DependencyPackage]):
def __init__(self, dependency: Dependency, packages: Iterable[Package | DependencyPackage]=()) -> None:
pass
def append(self, package: Package | DependencyPackage) -> None:
pass | 3 | 0 | 9 | 2 | 7 | 0 | 2 | 0 | 1 | 3 | 1 | 0 | 2 | 1 | 2 | 35 | 20 | 5 | 15 | 9 | 8 | 0 | 11 | 5 | 8 | 2 | 2 | 1 | 4 |
12,828 | sdispater/poetry | src/poetry/packages/transitive_package_info.py | packages.transitive_package_info.TransitivePackageInfo | from poetry.core.version.markers import BaseMarker
from poetry.core.version.markers import EmptyMarker
from dataclasses import dataclass
@dataclass
class TransitivePackageInfo:
depth: int
groups: set[NormalizedName]
markers: dict[NormalizedName, BaseMarker]
def get_marker(self, groups: Iterable[Normal... | @dataclass
class TransitivePackageInfo:
def get_marker(self, groups: Iterable[NormalizedName]) -> BaseMarker:
pass | 3 | 0 | 6 | 0 | 6 | 0 | 3 | 0.2 | 0 | 2 | 0 | 0 | 1 | 0 | 1 | 1 | 11 | 1 | 10 | 5 | 8 | 2 | 10 | 4 | 8 | 3 | 0 | 2 | 3 |
12,829 | sdispater/poetry | src/poetry/plugins/application_plugin.py | plugins.application_plugin.ApplicationPlugin | from poetry.plugins.base_plugin import BasePlugin
class ApplicationPlugin(BasePlugin):
"""
Base class for application plugins.
"""
group = 'poetry.application.plugin'
@property
def commands(self) -> list[type[Command]]:
return []
def activate(self, application: Application) -> Non... |
class ApplicationPlugin(BasePlugin):
'''
Base class for application plugins.
'''
@property
def commands(self) -> list[type[Command]]:
pass
def activate(self, application: Application) -> None:
pass | 4 | 1 | 3 | 0 | 3 | 0 | 2 | 0.33 | 1 | 1 | 0 | 2 | 2 | 0 | 2 | 23 | 15 | 3 | 9 | 6 | 5 | 3 | 8 | 5 | 5 | 2 | 5 | 1 | 3 |
12,830 | sdispater/poetry | src/poetry/plugins/base_plugin.py | plugins.base_plugin.BasePlugin | from abc import abstractmethod
from abc import ABC
class BasePlugin(ABC):
"""
Base class for all plugin types
The `activate()` method must be implemented and receives the Poetry instance.
"""
PLUGIN_API_VERSION = '1.0.0'
@property
@abstractmethod
def group(self) -> str:
"""
... |
class BasePlugin(ABC):
'''
Base class for all plugin types
The `activate()` method must be implemented and receives the Poetry instance.
'''
@property
@abstractmethod
def group(self) -> str:
'''
Name of entrypoint group the plugin belongs to.
'''
pass | 4 | 2 | 4 | 0 | 1 | 3 | 1 | 1.4 | 1 | 1 | 0 | 2 | 1 | 0 | 1 | 21 | 15 | 3 | 5 | 4 | 1 | 7 | 3 | 3 | 1 | 1 | 4 | 0 | 1 |
12,831 | sdispater/poetry | src/poetry/plugins/plugin.py | plugins.plugin.Plugin | from poetry.plugins.base_plugin import BasePlugin
from abc import abstractmethod
class Plugin(BasePlugin):
"""
Generic plugin not related to the console application.
"""
group = 'poetry.plugin'
@abstractmethod
def activate(self, poetry: Poetry, io: IO) -> None:
... |
class Plugin(BasePlugin):
'''
Generic plugin not related to the console application.
'''
@abstractmethod
def activate(self, poetry: Poetry, io: IO) -> None:
pass | 3 | 1 | 1 | 0 | 1 | 0 | 1 | 0.75 | 1 | 0 | 0 | 2 | 1 | 0 | 1 | 22 | 9 | 2 | 4 | 4 | 2 | 3 | 4 | 3 | 2 | 1 | 5 | 0 | 1 |
12,832 | sdispater/poetry | src/poetry/plugins/plugin_manager.py | plugins.plugin_manager.PluginManager | from pathlib import Path
from poetry.plugins.plugin import Plugin
from poetry.utils.env import EnvManager
from poetry.plugins.application_plugin import ApplicationPlugin
from poetry.utils._compat import metadata
class PluginManager:
"""
This class registers and activates plugins.
"""
def __init__(self... |
class PluginManager:
'''
This class registers and activates plugins.
'''
def __init__(self, group: str) -> None:
pass
@staticmethod
def add_project_plugin_path(directory: Path) -> None:
pass
@classmethod
def ensure_project_plugins(cls, poetry: Poetry, io: IO) -> Non... | 11 | 1 | 6 | 1 | 5 | 0 | 2 | 0.1 | 0 | 11 | 4 | 0 | 6 | 2 | 8 | 8 | 59 | 15 | 40 | 20 | 28 | 4 | 34 | 18 | 24 | 3 | 0 | 1 | 14 |
12,833 | sdispater/poetry | src/poetry/plugins/plugin_manager.py | plugins.plugin_manager.ProjectPluginCache | from functools import cached_property
from poetry.core.packages.project_package import ProjectPackage
from poetry.repositories.installed_repository import InstalledRepository
from poetry.utils._compat import tomllib
from poetry.utils.env import Env
from poetry.utils.env import EnvManager
import hashlib
from pathlib imp... |
class ProjectPluginCache:
def __init__(self, poetry: Poetry, io: IO) -> None:
pass
@property
def _plugin_section(self) -> dict[str, Any]:
pass
@cached_property
def _config(self) -> dict[str, Any]:
pass
def ensure_plugins(self) -> None:
pass
def _is_fresh(s... | 11 | 0 | 25 | 2 | 19 | 3 | 4 | 0.15 | 0 | 11 | 3 | 0 | 8 | 5 | 8 | 8 | 208 | 27 | 158 | 47 | 141 | 23 | 102 | 38 | 92 | 17 | 0 | 3 | 30 |
12,834 | sdispater/poetry | src/poetry/poetry.py | poetry.poetry.Poetry | from typing import Any
from poetry.pyproject.toml import PyProjectTOML
from poetry.config.source import Source
from typing import cast
from poetry.core.poetry import Poetry as BasePoetry
from poetry.__version__ import __version__
class Poetry(BasePoetry):
VERSION = __version__
def __init__(self, file: Path, l... |
class Poetry(BasePoetry):
def __init__(self, file: Path, local_config: dict[str, Any], package: ProjectPackage, locker: Locker, config: Config, disable_cache: bool=False) -> None:
pass
@property
def pyproject(self) -> PyProjectTOML:
pass
@property
def file(self) -> TOMLFile:
... | 18 | 0 | 5 | 0 | 4 | 0 | 1 | 0 | 1 | 12 | 5 | 0 | 11 | 5 | 11 | 11 | 69 | 16 | 53 | 34 | 26 | 0 | 34 | 20 | 21 | 1 | 1 | 0 | 11 |
12,835 | sdispater/poetry | src/poetry/publishing/hash_manager.py | publishing.hash_manager.HashManager | import io
from contextlib import suppress
import hashlib
class HashManager:
def __init__(self) -> None:
self._sha2_hasher = hashlib.sha256()
self._md5_hasher = None
with suppress(ValueError):
self._md5_hasher = hashlib.md5()
self._blake_hasher = None
with suppre... |
class HashManager:
def __init__(self) -> None:
pass
def _md5_update(self, content: bytes) -> None:
pass
def _md5_hexdigest(self) -> str | None:
pass
def _blake_update(self, content: bytes) -> None:
pass
def _blake_hexdigest(self) -> str | None:
pass
... | 8 | 0 | 5 | 0 | 5 | 0 | 2 | 0.06 | 0 | 7 | 1 | 0 | 7 | 3 | 7 | 7 | 45 | 8 | 35 | 13 | 27 | 2 | 31 | 12 | 23 | 2 | 0 | 2 | 12 |
12,836 | sdispater/poetry | src/poetry/publishing/hash_manager.py | publishing.hash_manager.Hexdigest | from typing import NamedTuple
class Hexdigest(NamedTuple):
md5: str | None
sha256: str | None
blake2_256: str | None |
class Hexdigest(NamedTuple):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 1 | 3 | 0 | 4 | 1 | 3 | 0 | 1 | 0 | 0 |
12,837 | sdispater/poetry | src/poetry/publishing/publisher.py | publishing.publisher.Publisher | from poetry.utils.authenticator import Authenticator
from poetry.publishing.uploader import Uploader
class Publisher:
"""
Registers and publishes packages to remote repositories.
"""
def __init__(self, poetry: Poetry, io: IO, dist_dir: Path | None=None) -> None:
self._poetry = poetry
s... |
class Publisher:
'''
Registers and publishes packages to remote repositories.
'''
def __init__(self, poetry: Poetry, io: IO, dist_dir: Path | None=None) -> None:
pass
@property
def files(self) -> list[Path]:
pass
def publish(self, repository_name: str | None, username: str... | 5 | 1 | 21 | 2 | 19 | 1 | 3 | 0.08 | 0 | 7 | 2 | 0 | 3 | 5 | 3 | 3 | 72 | 8 | 59 | 25 | 45 | 5 | 35 | 15 | 31 | 7 | 0 | 3 | 9 |
12,838 | sdispater/poetry | src/poetry/publishing/uploader.py | publishing.uploader.UploadError | class UploadError(Exception):
pass | class UploadError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
12,839 | sdispater/poetry | src/poetry/publishing/uploader.py | publishing.uploader.Uploader | from poetry.__version__ import __version__
from poetry.publishing.hash_manager import HashManager
from pathlib import Path
from requests_toolbelt import user_agent
from requests_toolbelt.multipart import MultipartEncoder
from requests_toolbelt.multipart import MultipartEncoderMonitor
from poetry.utils.constants import ... | null | 21 | 1 | 18 | 2 | 15 | 1 | 3 | 0.07 | 0 | 14 | 2 | 0 | 16 | 6 | 16 | 16 | 308 | 50 | 241 | 92 | 199 | 17 | 136 | 66 | 118 | 11 | 0 | 4 | 41 |
12,840 | sdispater/poetry | src/poetry/puzzle/Solver.py | puzzle.Solver.PackageNode | from poetry.core.version.markers import AnyMarker
from poetry.core.version.markers import parse_marker
class PackageNode(DFSNode):
def __init__(self, package: Package, packages: list[Package], previous: PackageNode | None=None, dep: Dependency | None=None, marker: BaseMarker | None=None) -> None:
self.pac... |
class PackageNode(DFSNode):
def __init__(self, package: Package, packages: list[Package], previous: PackageNode | None=None, dep: Dependency | None=None, marker: BaseMarker | None=None) -> None:
pass
def reachable(self) -> Sequence[PackageNode]:
pass
def visit(self, parents: list[Package... | 4 | 0 | 23 | 2 | 21 | 1 | 3 | 0.03 | 1 | 6 | 0 | 0 | 3 | 7 | 3 | 7 | 72 | 7 | 63 | 23 | 52 | 2 | 27 | 16 | 23 | 5 | 1 | 4 | 10 |
12,841 | sdispater/poetry | src/poetry/puzzle/Solver.py | puzzle.Solver.Solver | from poetry.puzzle.exceptions import SolverProblemError
from contextlib import contextmanager
from poetry.puzzle.provider import Indicator
import time
from poetry.mixology import resolve_version
from poetry.mixology.failure import SolveFailureError
from poetry.puzzle.exceptions import OverrideNeededError
from poetry.pu... |
class Solver:
def __init__(self, package: ProjectPackage, pool: RepositoryPool, installed: list[Package], locked: list[Package], io: IO, active_root_extras: Collection[NormalizedName] | None=None) -> None:
pass
@property
def provider(self) -> Provider:
pass
@contextmanager
def use_... | 12 | 0 | 20 | 2 | 17 | 1 | 3 | 0.05 | 0 | 16 | 10 | 0 | 8 | 7 | 8 | 8 | 168 | 21 | 140 | 55 | 112 | 7 | 76 | 36 | 66 | 8 | 0 | 6 | 26 |
12,842 | sdispater/poetry | src/poetry/puzzle/exceptions.py | puzzle.exceptions.OverrideNeededError | class OverrideNeededError(Exception):
def __init__(self, *overrides: dict[Package, dict[str, Dependency]]) -> None:
self._overrides = overrides
@property
def overrides(self) -> tuple[dict[Package, dict[str, Dependency]], ...]:
return self._overrides | class OverrideNeededError(Exception):
def __init__(self, *overrides: dict[Package, dict[str, Dependency]]) -> None:
pass
@property
def overrides(self) -> tuple[dict[Package, dict[str, Dependency]], ...]:
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 3 | 0 | 0 | 2 | 1 | 2 | 12 | 7 | 1 | 6 | 5 | 2 | 0 | 5 | 4 | 2 | 1 | 3 | 0 | 2 |
12,843 | sdispater/poetry | src/poetry/puzzle/exceptions.py | puzzle.exceptions.SolverProblemError | class SolverProblemError(Exception):
def __init__(self, error: SolveFailureError) -> None:
self._error = error
super().__init__(str(error))
@property
def error(self) -> SolveFailureError:
return self._error | class SolverProblemError(Exception):
def __init__(self, error: SolveFailureError) -> None:
pass
@property
def error(self) -> SolveFailureError:
pass | 4 | 0 | 3 | 1 | 3 | 0 | 1 | 0 | 1 | 3 | 1 | 0 | 2 | 1 | 2 | 12 | 9 | 2 | 7 | 5 | 3 | 0 | 6 | 4 | 3 | 1 | 3 | 0 | 2 |
12,844 | sdispater/poetry | src/poetry/puzzle/provider.py | puzzle.provider.IncompatibleConstraintsError | class IncompatibleConstraintsError(Exception):
"""
Exception when there are duplicate dependencies with incompatible constraints.
"""
def __init__(self, package: Package, *dependencies: Dependency, with_sources: bool=False) -> None:
constraints = []
for dep in dependencies:
... | class IncompatibleConstraintsError(Exception):
'''
Exception when there are duplicate dependencies with incompatible constraints.
'''
def __init__(self, package: Package, *dependencies: Dependency, with_sources: bool=False) -> None:
pass | 2 | 1 | 17 | 0 | 15 | 2 | 4 | 0.31 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 11 | 22 | 1 | 16 | 7 | 12 | 5 | 11 | 5 | 9 | 4 | 3 | 2 | 4 |
12,845 | sdispater/poetry | src/poetry/puzzle/provider.py | puzzle.provider.Indicator | from cleo.ui.progress_indicator import ProgressIndicator
from contextlib import contextmanager
import time
class Indicator(ProgressIndicator):
CONTEXT: str | None = None
@staticmethod
@contextmanager
def context() -> Iterator[Callable[[str | None], None]]:
def _set_context(context: str | None... |
class Indicator(ProgressIndicator):
@staticmethod
@contextmanager
def context() -> Iterator[Callable[[str | None], None]]:
pass
def _set_context(context: str | None) -> None:
pass
def _formatter_context(self) -> str:
pass
def _formatter_elapsed(self) -> s... | 7 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 1 | 3 | 0 | 0 | 2 | 0 | 3 | 3 | 24 | 6 | 18 | 8 | 11 | 0 | 15 | 7 | 10 | 2 | 1 | 1 | 5 |
12,846 | sdispater/poetry | src/poetry/puzzle/provider.py | puzzle.provider.Provider | import itertools
from poetry.core.packages.utils.utils import get_python_constraint_from_marker
import functools
from poetry.core.version.markers import union as marker_union
from poetry.mixology.incompatibility_cause import PythonCauseError
from typing import cast
from typing import ClassVar
from poetry.puzzle.excepti... |
class Provider:
def __init__(self, package: Package, pool: RepositoryPool, io: IO, *, locked: list[Package] | None=None, active_root_extras: Collection[NormalizedName] | None=None) -> None:
pass
@property
def pool(self) -> RepositoryPool:
pass
@property
def use_latest(self) -> Coll... | 38 | 8 | 30 | 3 | 22 | 5 | 5 | 0.25 | 0 | 30 | 11 | 1 | 27 | 17 | 28 | 28 | 909 | 126 | 628 | 169 | 561 | 155 | 398 | 131 | 368 | 44 | 0 | 4 | 138 |
12,847 | sdispater/poetry | src/poetry/puzzle/solver.py | puzzle.solver.DFSNode | class DFSNode:
def __init__(self, id: DFSNodeID, name: str, base_name: str) -> None:
self.id = id
self.name = name
self.base_name = base_name
def reachable(self) -> Sequence[Self]:
return []
def visit(self, parents: list[PackageNode]) -> None:
pass
def __str__... | class DFSNode:
def __init__(self, id: DFSNodeID, name: str, base_name: str) -> None:
pass
def reachable(self) -> Sequence[Self]:
pass
def visit(self, parents: list[PackageNode]) -> None:
pass
def __str__(self) -> str:
pass | 5 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 4 | 1 | 1 | 4 | 3 | 4 | 4 | 14 | 3 | 11 | 8 | 6 | 0 | 11 | 8 | 6 | 1 | 0 | 0 | 4 |
12,848 | sdispater/poetry | src/poetry/puzzle/solver.py | puzzle.solver.PackageNode | from poetry.core.version.markers import parse_marker
from poetry.core.version.markers import AnyMarker
class PackageNode(DFSNode):
def __init__(self, package: Package, packages: list[Package], previous: PackageNode | None=None, dep: Dependency | None=None, marker: BaseMarker | None=None) -> None:
self.pac... |
class PackageNode(DFSNode):
def __init__(self, package: Package, packages: list[Package], previous: PackageNode | None=None, dep: Dependency | None=None, marker: BaseMarker | None=None) -> None:
pass
def reachable(self) -> Sequence[PackageNode]:
pass
def visit(self, parents: list[Package... | 4 | 0 | 23 | 2 | 21 | 1 | 3 | 0.03 | 1 | 6 | 0 | 0 | 3 | 7 | 3 | 7 | 72 | 7 | 63 | 23 | 52 | 2 | 27 | 16 | 23 | 5 | 1 | 4 | 10 |
12,849 | sdispater/poetry | src/poetry/puzzle/solver.py | puzzle.solver.Solver | from poetry.puzzle.provider import Provider
from poetry.puzzle.exceptions import SolverProblemError
from poetry.puzzle.exceptions import OverrideNeededError
from poetry.packages.transitive_package_info import TransitivePackageInfo
from contextlib import contextmanager
import time
from poetry.puzzle.provider import Indi... |
class Solver:
def __init__(self, package: ProjectPackage, pool: RepositoryPool, installed: list[Package], locked: list[Package], io: IO, active_root_extras: Collection[NormalizedName] | None=None) -> None:
pass
@property
def provider(self) -> Provider:
pass
@contextmanager
def use_... | 12 | 0 | 20 | 2 | 17 | 1 | 3 | 0.05 | 0 | 16 | 10 | 0 | 8 | 7 | 8 | 8 | 168 | 21 | 140 | 55 | 112 | 7 | 76 | 36 | 66 | 8 | 0 | 6 | 26 |
12,850 | sdispater/poetry | src/poetry/puzzle/transaction.py | puzzle.transaction.Transaction | from poetry.utils.extras import get_extra_package_names
from typing import Any
from collections import defaultdict
class Transaction:
def __init__(self, current_packages: list[Package], result_packages: list[Package] | dict[Package, TransitivePackageInfo], installed_packages: list[Package] | None=None, root_packa... |
class Transaction:
def __init__(self, current_packages: list[Package], result_packages: list[Package] | dict[Package, TransitivePackageInfo], installed_packages: list[Package] | None=None, root_package: Package | None=None, marker_env: Mapping[str, Any] | None=None, groups: set[NormalizedName] | None=None) -> Non... | 4 | 0 | 56 | 6 | 45 | 5 | 10 | 0.1 | 0 | 9 | 2 | 0 | 3 | 6 | 3 | 3 | 170 | 20 | 136 | 41 | 113 | 14 | 75 | 24 | 68 | 27 | 0 | 5 | 30 |
12,851 | sdispater/poetry | src/poetry/pyproject/toml.py | pyproject.toml.PyProjectTOML | from tomlkit.items import Table
from poetry.core.pyproject.toml import PyProjectTOML as BasePyProjectTOML
from tomlkit.toml_document import TOMLDocument
from poetry.toml import TOMLFile
from tomlkit.api import table
class PyProjectTOML(BasePyProjectTOML):
"""
Enhanced version of poetry-core's PyProjectTOML
... |
class PyProjectTOML(BasePyProjectTOML):
'''
Enhanced version of poetry-core's PyProjectTOML
which is capable of writing pyproject.toml
The poetry-core class uses tomli to read the file,
here we use tomlkit to preserve comments and formatting when writing.
'''
def __init__(self, path: Path)... | 8 | 1 | 6 | 1 | 5 | 0 | 2 | 0.21 | 1 | 2 | 0 | 0 | 5 | 3 | 5 | 5 | 46 | 11 | 29 | 13 | 21 | 6 | 26 | 11 | 20 | 3 | 1 | 2 | 9 |
12,852 | sdispater/poetry | src/poetry/repositories/Repository.py | repositories.Repository.Repository | from poetry.repositories.abstract_repository import AbstractRepository
from packaging.utils import canonicalize_name
import logging
from poetry.core.constraints.version import Version
from poetry.repositories.exceptions import PackageNotFoundError
class Repository(AbstractRepository):
def __init__(self, name: str... |
class Repository(AbstractRepository):
def __init__(self, name: str, packages: Sequence[Package] | None=None) -> None:
pass
@property
def packages(self) -> list[Package]:
pass
def find_packages(self, dependency: Dependency) -> list[Package]:
pass
def has_package(self, pack... | 13 | 0 | 7 | 1 | 6 | 0 | 2 | 0.06 | 1 | 7 | 1 | 0 | 11 | 1 | 11 | 36 | 88 | 18 | 67 | 30 | 52 | 4 | 51 | 26 | 39 | 5 | 5 | 2 | 21 |
12,853 | sdispater/poetry | src/poetry/repositories/abstract_repository.py | repositories.abstract_repository.AbstractRepository | from abc import abstractmethod
from abc import ABC
class AbstractRepository(ABC):
def __init__(self, name: str) -> None:
self._name = name
@property
def name(self) -> str:
return self._name
@abstractmethod
def find_packages(self, dependency: Dependency) -> list[Package]:
... |
class AbstractRepository(ABC):
def __init__(self, name: str) -> None:
pass
@property
def name(self) -> str:
pass
@abstractmethod
def find_packages(self, dependency: Dependency) -> list[Package]:
pass
@abstractmethod
def search(self, query: str | list[str]) -> list[P... | 10 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 2 | 0 | 3 | 5 | 1 | 5 | 25 | 16 | 4 | 12 | 11 | 5 | 0 | 11 | 7 | 5 | 1 | 4 | 0 | 5 |
12,854 | sdispater/poetry | src/poetry/repositories/cached_repository.py | repositories.cached_repository.CachedRepository | from packaging.utils import canonicalize_name
from typing import Any
from poetry.core.constraints.version import parse_constraint
from poetry.repositories.repository import Repository
from poetry.config.config import Config
from poetry.utils.cache import FileCache
from abc import abstractmethod
from abc import ABC
cla... |
class CachedRepository(Repository, ABC):
def __init__(self, name: str, *, disable_cache: bool=False, config: Config | None=None) -> None:
pass
@abstractmethod
def _get_release_info(self, name: NormalizedName, version: Version) -> dict[str, Any]:
pass
def get_release_info(self, name: N... | 6 | 1 | 11 | 2 | 8 | 2 | 2 | 0.18 | 2 | 8 | 3 | 1 | 4 | 3 | 4 | 40 | 49 | 10 | 33 | 17 | 23 | 6 | 22 | 12 | 16 | 3 | 6 | 1 | 6 |
12,855 | sdispater/poetry | src/poetry/repositories/exceptions.py | repositories.exceptions.InvalidSourceError | class InvalidSourceError(Exception):
pass | class InvalidSourceError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
12,856 | sdispater/poetry | src/poetry/repositories/exceptions.py | repositories.exceptions.PackageNotFoundError | class PackageNotFoundError(Exception):
pass | class PackageNotFoundError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
12,857 | sdispater/poetry | src/poetry/repositories/exceptions.py | repositories.exceptions.RepositoryError | class RepositoryError(Exception):
pass | class RepositoryError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
12,858 | sdispater/poetry | src/poetry/repositories/http_repository.py | repositories.http_repository.HTTPRepository | from poetry.repositories.exceptions import PackageNotFoundError
from poetry.repositories.exceptions import RepositoryError
from contextlib import contextmanager
from poetry.utils.constants import REQUESTS_TIMEOUT
from typing import Any
from poetry.utils.authenticator import Authenticator
from poetry.utils.patterns impo... |
class HTTPRepository(CachedRepository):
def __init__(self, name: str, url: str, *, config: Config | None=None, disable_cache: bool=False, pool_size: int=requests.adapters.DEFAULT_POOLSIZE) -> None:
pass
@property
def session(self) -> Authenticator:
pass
@property
def url(self) -> s... | 21 | 0 | 24 | 2 | 20 | 2 | 4 | 0.12 | 1 | 25 | 10 | 3 | 15 | 6 | 15 | 55 | 386 | 50 | 301 | 94 | 264 | 35 | 194 | 66 | 176 | 22 | 7 | 4 | 60 |
12,859 | sdispater/poetry | src/poetry/repositories/installed_repository.py | repositories.installed_repository.InstalledRepository | from poetry.core.packages.utils.utils import is_python_project
from poetry.utils._compat import getencoding
import itertools
from poetry.core.utils.helpers import module_name
from packaging.utils import canonicalize_name
from poetry.core.packages.utils.utils import url_to_path
from poetry.utils.env import VirtualEnv
im... |
class InstalledRepository(Repository):
def __init__(self, packages: Sequence[Package] | None=None) -> None:
pass
def add_package(self, package: Package, *, is_system_site: bool=False) -> None:
pass
@classmethod
def get_package_paths(cls, env: Env, name: str) -> set[Path]:
'''
... | 15 | 2 | 33 | 4 | 26 | 5 | 5 | 0.17 | 1 | 14 | 3 | 1 | 2 | 1 | 8 | 44 | 281 | 39 | 214 | 61 | 195 | 37 | 131 | 52 | 120 | 10 | 6 | 6 | 36 |
12,860 | sdispater/poetry | src/poetry/repositories/legacy_repository.py | repositories.legacy_repository.LegacyRepository | import requests.adapters
from contextlib import suppress
from typing import Any
from functools import cached_property
from poetry.repositories.link_sources.html import SimpleRepositoryRootPage
from poetry.repositories.link_sources.html import HTMLPage
from poetry.repositories.exceptions import PackageNotFoundError
from... |
class LegacyRepository(HTTPRepository):
def __init__(self, name: str, url: str, *, config: Config | None=None, disable_cache: bool=False, pool_size: int=requests.adapters.DEFAULT_POOLSIZE) -> None:
pass
def package(self, name: str, version: Version) -> Package:
'''
Retrieve the releas... | 10 | 2 | 15 | 2 | 12 | 2 | 2 | 0.12 | 1 | 14 | 5 | 2 | 8 | 2 | 8 | 63 | 132 | 21 | 99 | 38 | 77 | 12 | 51 | 21 | 42 | 3 | 8 | 3 | 16 |
12,861 | sdispater/poetry | src/poetry/repositories/link_sources/base.py | repositories.link_sources.base.LinkSource | from poetry.core.packages.package import Package
from functools import cached_property
from poetry.utils.patterns import wheel_file_re
import re
from poetry.utils.patterns import sdist_file_re
from poetry.core.constraints.version import Version
from poetry.core.version.exceptions import InvalidVersionError
from typing ... |
class LinkSource:
def __init__(self, url: str) -> None:
pass
@property
def url(self) -> str:
pass
def versions(self, name: NormalizedName) -> Iterator[Version]:
pass
@property
def packages(self) -> Iterator[Package]:
pass
@property
def links(self) -> It... | 16 | 1 | 7 | 0 | 6 | 1 | 2 | 0.08 | 0 | 5 | 0 | 2 | 9 | 1 | 10 | 10 | 96 | 14 | 77 | 35 | 59 | 6 | 58 | 28 | 47 | 6 | 0 | 3 | 23 |
12,862 | sdispater/poetry | src/poetry/repositories/link_sources/html.py | repositories.link_sources.html.HTMLPage | from functools import cached_property
from poetry.repositories.parsers.html_page_parser import HTMLPageParser
from poetry.core.packages.utils.link import Link
from html import unescape
import urllib.parse
from collections import defaultdict
from poetry.repositories.link_sources.base import LinkSource
class HTMLPage(Li... |
class HTMLPage(LinkSource):
def __init__(self, url: str, content: str) -> None:
pass
@cached_property
def _link_cache(self) -> LinkCache:
pass | 4 | 0 | 23 | 3 | 20 | 1 | 6 | 0.05 | 1 | 5 | 1 | 0 | 2 | 2 | 2 | 12 | 49 | 6 | 41 | 17 | 37 | 2 | 34 | 15 | 31 | 10 | 1 | 4 | 11 |
12,863 | sdispater/poetry | src/poetry/repositories/link_sources/html.py | repositories.link_sources.html.SimpleRepositoryRootPage | from poetry.repositories.parsers.html_page_parser import HTMLPageParser
from functools import cached_property
class SimpleRepositoryRootPage:
"""
This class represents the parsed content of a "simple" repository's root page. This follows the
specification laid out in PEP 503.
See: https://peps.python.... |
class SimpleRepositoryRootPage:
'''
This class represents the parsed content of a "simple" repository's root page. This follows the
specification laid out in PEP 503.
See: https://peps.python.org/pep-0503/
'''
def __init__(self, content: str | None=None) -> None:
pass
def search(s... | 5 | 1 | 7 | 1 | 6 | 0 | 3 | 0.25 | 0 | 3 | 1 | 0 | 3 | 1 | 3 | 3 | 33 | 8 | 20 | 14 | 15 | 5 | 19 | 12 | 15 | 4 | 0 | 2 | 8 |
12,864 | sdispater/poetry | src/poetry/repositories/link_sources/json.py | repositories.link_sources.json.SimpleJsonPage | from functools import cached_property
from typing import Any
from collections import defaultdict
from poetry.repositories.link_sources.base import LinkSource
from poetry.core.packages.utils.link import Link
class SimpleJsonPage(LinkSource):
"""Links as returned by PEP 691 compatible JSON-based Simple API."""
... |
class SimpleJsonPage(LinkSource):
'''Links as returned by PEP 691 compatible JSON-based Simple API.'''
def __init__(self, url: str, content: dict[str, Any]) -> None:
pass
@cached_property
def _link_cache(self) -> LinkCache:
pass | 4 | 1 | 17 | 3 | 14 | 1 | 4 | 0.1 | 1 | 6 | 0 | 0 | 2 | 1 | 2 | 12 | 39 | 7 | 29 | 15 | 25 | 3 | 25 | 14 | 22 | 7 | 1 | 4 | 8 |
12,865 | sdispater/poetry | src/poetry/repositories/lockfile_repository.py | repositories.lockfile_repository.LockfileRepository | from poetry.repositories import Repository
class LockfileRepository(Repository):
"""
Special repository that distinguishes packages not only by name and version,
but also by source type, url, etc.
"""
def __init__(self) -> None:
super().__init__('poetry-lockfile')
def has_package(self... |
class LockfileRepository(Repository):
'''
Special repository that distinguishes packages not only by name and version,
but also by source type, url, etc.
'''
def __init__(self) -> None:
pass
def has_package(self, package: Package) -> bool:
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.8 | 1 | 2 | 0 | 0 | 2 | 0 | 2 | 2 | 11 | 2 | 5 | 3 | 2 | 4 | 5 | 3 | 2 | 1 | 1 | 0 | 2 |
12,866 | sdispater/poetry | src/poetry/repositories/parsers/html_page_parser.py | repositories.parsers.html_page_parser.HTMLPageParser | from html.parser import HTMLParser
class HTMLPageParser(HTMLParser):
def __init__(self) -> None:
super().__init__()
self.base_url: str | None = None
self.anchors: list[dict[str, str | None]] = []
def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
... |
class HTMLPageParser(HTMLParser):
def __init__(self) -> None:
pass
def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
pass | 3 | 0 | 6 | 0 | 6 | 0 | 3 | 0 | 1 | 5 | 0 | 0 | 2 | 2 | 2 | 40 | 13 | 1 | 12 | 6 | 9 | 0 | 11 | 6 | 8 | 4 | 2 | 2 | 5 |
12,867 | sdispater/poetry | src/poetry/repositories/parsers/pypi_search_parser.py | repositories.parsers.pypi_search_parser.Result | from dataclasses import dataclass
@dataclass
class Result:
name: str = ''
version: str = ''
description: str = '' | @dataclass
class Result:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 0 | 0 | 0 |
12,868 | sdispater/poetry | src/poetry/repositories/parsers/pypi_search_parser.py | repositories.parsers.pypi_search_parser.SearchResultParser | from html.parser import HTMLParser
import functools
from typing import Callable
class SearchResultParser(HTMLParser):
"""A simple HTML parser for pypi.org search results."""
def __init__(self) -> None:
super().__init__()
self.results: list[Result] = []
self._current: Result | None = No... |
class SearchResultParser(HTMLParser):
'''A simple HTML parser for pypi.org search results.'''
def __init__(self) -> None:
pass
@staticmethod
def _match_class(attrs: list[tuple[str, str | None]], name: str) -> bool:
pass
def handle_starttag(self, tag: str, attrs: list[tuple[str, st... | 7 | 1 | 8 | 0 | 8 | 0 | 3 | 0.02 | 1 | 8 | 1 | 0 | 4 | 4 | 5 | 43 | 49 | 5 | 43 | 12 | 36 | 1 | 32 | 11 | 26 | 7 | 2 | 2 | 15 |
12,869 | sdispater/poetry | src/poetry/repositories/pypi_repository.py | repositories.pypi_repository.PyPiRepository | from poetry.core.packages.package import Package
from poetry.core.version.requirements import InvalidRequirementError
from poetry.utils.constants import REQUESTS_TIMEOUT
import contextlib
import requests.adapters
from poetry.repositories.parsers.pypi_search_parser import SearchResultParser
from typing import Any
from p... |
class PyPiRepository(HTTPRepository):
def __init__(self, url: str='https://pypi.org/', *, config: Config | None=None, disable_cache: bool=False, pool_size: int=requests.adapters.DEFAULT_POOLSIZE, fallback: bool=True) -> None:
pass
def search(self, query: str | list[str]) -> list[Package]:
pas... | 12 | 2 | 19 | 2 | 15 | 2 | 3 | 0.13 | 1 | 14 | 5 | 0 | 9 | 2 | 10 | 65 | 203 | 32 | 152 | 56 | 125 | 20 | 93 | 41 | 81 | 7 | 8 | 3 | 29 |
12,870 | sdispater/poetry | src/poetry/repositories/repository.py | repositories.repository.Repository | from poetry.repositories.abstract_repository import AbstractRepository
import logging
from poetry.repositories.exceptions import PackageNotFoundError
from poetry.core.constraints.version import Version
from packaging.utils import canonicalize_name
class Repository(AbstractRepository):
def __init__(self, name: str... |
class Repository(AbstractRepository):
def __init__(self, name: str, packages: Sequence[Package] | None=None) -> None:
pass
@property
def packages(self) -> list[Package]:
pass
def find_packages(self, dependency: Dependency) -> list[Package]:
pass
def has_package(self, pack... | 13 | 0 | 7 | 1 | 6 | 0 | 2 | 0.06 | 1 | 7 | 1 | 2 | 11 | 1 | 11 | 36 | 88 | 18 | 67 | 30 | 52 | 4 | 51 | 26 | 39 | 5 | 5 | 2 | 21 |
12,871 | sdispater/poetry | src/poetry/repositories/repository_pool.py | repositories.repository_pool.PrioritizedRepository | from poetry.repositories.repository import Repository
from dataclasses import dataclass
@dataclass(frozen=True)
class PrioritizedRepository:
repository: Repository
priority: Priority | @dataclass(frozen=True)
class PrioritizedRepository:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 3 | 1 | 2 | 0 | 3 | 1 | 2 | 0 | 0 | 0 | 0 |
12,872 | sdispater/poetry | src/poetry/repositories/repository_pool.py | repositories.repository_pool.Priority | from enum import IntEnum
import enum
class Priority(IntEnum):
PRIMARY = enum.auto()
SUPPLEMENTAL = enum.auto()
EXPLICIT = enum.auto() |
class Priority(IntEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 6 | 0 | 4 | 4 | 3 | 2 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
12,873 | sdispater/poetry | src/poetry/repositories/repository_pool.py | repositories.repository_pool.RepositoryPool | from poetry.repositories.repository import Repository
from poetry.repositories.exceptions import PackageNotFoundError
from poetry.config.config import Config
from poetry.repositories.abstract_repository import AbstractRepository
from poetry.utils.cache import ArtifactCache
from collections import OrderedDict
class Rep... |
class RepositoryPool(AbstractRepository):
def __init__(self, repositories: list[Repository] | None=None, *, config: Config | None=None) -> None:
pass
@staticmethod
def from_packages(packages: list[Package], config: Config | None) -> RepositoryPool:
pass
@property
def repositories(s... | 23 | 2 | 7 | 1 | 6 | 1 | 2 | 0.09 | 1 | 13 | 6 | 0 | 16 | 2 | 17 | 42 | 147 | 25 | 112 | 47 | 80 | 10 | 82 | 33 | 64 | 5 | 5 | 2 | 33 |
12,874 | sdispater/poetry | src/poetry/repositories/single_page_repository.py | repositories.single_page_repository.SinglePageRepository | from poetry.repositories.legacy_repository import LegacyRepository
from poetry.repositories.exceptions import PackageNotFoundError
from poetry.repositories.link_sources.html import HTMLPage
class SinglePageRepository(LegacyRepository):
def _get_page(self, name: NormalizedName) -> HTMLPage:
"""
Sin... |
class SinglePageRepository(LegacyRepository):
def _get_page(self, name: NormalizedName) -> HTMLPage:
'''
Single page repositories only have one page irrespective of endpoint.
'''
pass | 2 | 1 | 8 | 0 | 5 | 3 | 2 | 0.5 | 1 | 2 | 2 | 1 | 1 | 0 | 1 | 64 | 9 | 0 | 6 | 3 | 4 | 3 | 6 | 3 | 4 | 2 | 9 | 1 | 2 |
12,875 | sdispater/poetry | src/poetry/toml/exceptions.py | toml.exceptions.TOMLError | from poetry.core.exceptions import PoetryCoreError
from tomlkit.exceptions import TOMLKitError
class TOMLError(TOMLKitError, PoetryCoreError):
pass |
class TOMLError(TOMLKitError, PoetryCoreError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
12,876 | sdispater/poetry | src/poetry/toml/file.py | toml.file.TOMLFile | from tomlkit.toml_file import TOMLFile as BaseTOMLFile
class TOMLFile(BaseTOMLFile):
def __init__(self, path: Path) -> None:
super().__init__(path)
self.__path = path
@property
def path(self) -> Path:
return self.__path
def exists(self) -> bool:
return self.__path.exi... |
class TOMLFile(BaseTOMLFile):
def __init__(self, path: Path) -> None:
pass
@property
def path(self) -> Path:
pass
def exists(self) -> bool:
pass
def read(self) -> TOMLDocument:
pass
def __str__(self) -> str:
pass | 7 | 0 | 4 | 0 | 3 | 0 | 1 | 0 | 1 | 6 | 1 | 1 | 5 | 1 | 5 | 5 | 24 | 6 | 18 | 11 | 9 | 0 | 17 | 9 | 9 | 2 | 1 | 1 | 6 |
12,877 | sdispater/poetry | src/poetry/utils/authenticator.py | utils.authenticator.Authenticator | from pathlib import Path
import urllib.parse
import time
from cachecontrol import CacheControlAdapter
from poetry.console.exceptions import ConsoleMessage
from typing import Any
from poetry.utils.constants import REQUESTS_TIMEOUT
from requests_toolbelt import user_agent
from poetry.console.exceptions import PoetryRunti... |
class Authenticator:
def __init__(self, config: Config | None=None, io: IO | None=None, cache_id: str | None=None, disable_cache: bool=False, pool_size: int=requests.adapters.DEFAULT_POOLSIZE) -> None:
pass
def create_session(self) -> requests.Session:
pass
def get_session(self, url: str... | 27 | 0 | 13 | 2 | 11 | 1 | 3 | 0.05 | 0 | 21 | 8 | 0 | 25 | 11 | 25 | 25 | 358 | 65 | 280 | 102 | 238 | 13 | 194 | 85 | 168 | 10 | 0 | 4 | 67 |
12,878 | sdispater/poetry | src/poetry/utils/authenticator.py | utils.authenticator.AuthenticatorRepositoryConfig | import dataclasses
from poetry.utils.password_manager import PasswordManager
import urllib.parse
from poetry.config.config import Config
from poetry.utils.password_manager import HTTPAuthCredential
@dataclasses.dataclass
class AuthenticatorRepositoryConfig:
name: str
url: str
netloc: str = dataclasses.fiel... | @dataclasses.dataclass
class AuthenticatorRepositoryConfig:
def __post_init__(self) -> None:
pass
def certs(self, config: Config) -> RepositoryCertificateConfig:
pass
def get_http_credentials(self, password_manager: PasswordManager) -> HTTPAuthCredential: | 5 | 0 | 7 | 1 | 6 | 1 | 2 | 0.09 | 0 | 4 | 4 | 0 | 3 | 0 | 3 | 3 | 30 | 6 | 22 | 10 | 16 | 2 | 18 | 8 | 14 | 3 | 0 | 1 | 5 |
12,879 | sdispater/poetry | src/poetry/utils/authenticator.py | utils.authenticator.RepositoryCertificateConfig | import dataclasses
from pathlib import Path
from poetry.config.config import Config
@dataclasses.dataclass(frozen=True)
class RepositoryCertificateConfig:
cert: Path | None = dataclasses.field(default=None)
client_cert: Path | None = dataclasses.field(default=None)
verify: bool = dataclasses.field(default=... | @dataclasses.dataclass(frozen=True)
class RepositoryCertificateConfig:
@classmethod
def create(cls, repository: str, config: Config | None) -> RepositoryCertificateConfig:
pass | 4 | 0 | 16 | 2 | 14 | 0 | 5 | 0 | 0 | 4 | 1 | 0 | 0 | 0 | 1 | 1 | 22 | 3 | 19 | 10 | 14 | 0 | 9 | 7 | 7 | 5 | 0 | 0 | 5 |
12,880 | sdispater/poetry | src/poetry/utils/cache.py | utils.cache.ArtifactCache | from poetry.utils.wheel import InvalidWheelNameError
from poetry.utils.wheel import Wheel
import threading
from typing import overload
from poetry.utils.helpers import get_highest_priority_hash_type
import json
from collections import defaultdict
from pathlib import Path
import hashlib
class ArtifactCache:
def __... |
class ArtifactCache:
def __init__(self, *, cache_dir: Path) -> None:
pass
def get_cache_directory_for_link(self, link: Link) -> Path:
pass
def _get_directory_from_hash(self, key_parts: object) -> Path:
pass
def get_cache_directory_for_git(self, url: str, ref: str, subdirecto... | 13 | 0 | 14 | 2 | 11 | 1 | 3 | 0.06 | 0 | 12 | 3 | 0 | 10 | 2 | 10 | 10 | 150 | 28 | 115 | 62 | 72 | 7 | 73 | 27 | 62 | 9 | 0 | 4 | 25 |
12,881 | sdispater/poetry | src/poetry/utils/cache.py | utils.cache.CacheItem | from typing import Generic
import dataclasses
import time
@dataclasses.dataclass(frozen=True)
class CacheItem(Generic[T]):
"""
Stores data and metadata for cache items.
"""
data: T
expires: int | None = None
@property
def expired(self) -> bool:
"""
Return true if the cache ... | @dataclasses.dataclass(frozen=True)
class CacheItem(Generic[T]):
'''
Stores data and metadata for cache items.
'''
@property
def expired(self) -> bool:
'''
Return true if the cache item has exceeded its expiration period.
'''
pass | 4 | 2 | 5 | 0 | 2 | 3 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 3 | 14 | 2 | 6 | 4 | 3 | 6 | 5 | 3 | 3 | 1 | 1 | 0 | 1 |
12,882 | sdispater/poetry | src/poetry/utils/cache.py | utils.cache.FileCache | import json
import dataclasses
from poetry.utils._compat import encode
from poetry.utils._compat import decode
from typing import Generic
from typing import Any
import shutil
from pathlib import Path
@dataclasses.dataclass(frozen=True)
class FileCache(Generic[T]):
"""
Cachy-compatible minimal file cache. Store... | @dataclasses.dataclass(frozen=True)
class FileCache(Generic[T]):
'''
Cachy-compatible minimal file cache. Stores subsequent data in a JSON format.
:param path: The path that the cache starts at.
:param hash_type: The hash to use for encoding keys/building directories.
'''
def __post_init__(self... | 13 | 6 | 8 | 1 | 6 | 2 | 2 | 0.45 | 1 | 11 | 1 | 0 | 11 | 0 | 11 | 13 | 114 | 20 | 65 | 32 | 51 | 29 | 58 | 28 | 46 | 4 | 1 | 1 | 19 |
12,883 | sdispater/poetry | src/poetry/utils/dependency_specification.py | utils.dependency_specification.RequirementsParser | from poetry.packages.direct_origin import DirectOrigin
import urllib.parse
import re
import os
from pathlib import Path
import contextlib
from poetry.core.packages.dependency import Dependency
class RequirementsParser:
def __init__(self, *, artifact_cache: ArtifactCache, env: Env | None=None, cwd: Path | None=Non... |
class RequirementsParser:
def __init__(self, *, artifact_cache: ArtifactCache, env: Env | None=None, cwd: Path | None=None) -> None:
pass
def parse(self, requirement: str) -> DependencySpec:
pass
def _parse_pep508(self, requirement: str) -> DependencySpec | None:
pass
def _p... | 8 | 0 | 24 | 4 | 20 | 0 | 4 | 0.01 | 0 | 8 | 3 | 0 | 7 | 3 | 7 | 7 | 173 | 34 | 138 | 46 | 119 | 1 | 99 | 37 | 89 | 8 | 0 | 3 | 30 |
12,884 | sdispater/poetry | src/poetry/utils/env/base_env.py | utils.env.base_env.Env | from subprocess import CalledProcessError
from abc import abstractmethod
import os
import re
from poetry.utils.helpers import get_real_windows_path
from poetry.utils.env.exceptions import EnvCommandError
from poetry.utils.helpers import is_dir_writable
from virtualenv.seed.wheels.embed import get_embed_wheel
import sys... |
class Env(ABC):
'''
An abstract Python environment.
'''
def __init__(self, path: Path, base: Path | None=None) -> None:
pass
@property
def bin_dir(self) -> Path:
pass
@property
def path(self) -> Path:
pass
@property
def base(self) -> Path:
pass
... | 78 | 8 | 8 | 1 | 6 | 1 | 2 | 0.18 | 1 | 15 | 3 | 1 | 47 | 14 | 48 | 68 | 462 | 93 | 312 | 134 | 232 | 57 | 241 | 99 | 191 | 6 | 4 | 3 | 94 |
12,885 | sdispater/poetry | src/poetry/utils/env/env_manager.py | utils.env.env_manager.EnvManager | import hashlib
import plistlib
from poetry.utils.env.python.exceptions import PythonVersionNotFoundError
import sys
from poetry.utils.env.generic_env import GenericEnv
from poetry.utils.env.exceptions import IncorrectEnvError
from poetry.utils.env.python.exceptions import NoCompatiblePythonVersionFoundError
import subp... |
class EnvManager:
'''
Environments manager
'''
def __init__(self, poetry: Poetry, io: None | IO=None) -> None:
pass
@property
def in_project_venv(self) -> Path:
pass
@cached_property
def envs_file(self) -> EnvsFile:
pass
@cached_property
def base_env_nam... | 28 | 3 | 28 | 5 | 21 | 3 | 5 | 0.15 | 0 | 19 | 11 | 0 | 12 | 2 | 18 | 18 | 544 | 105 | 384 | 120 | 343 | 56 | 281 | 96 | 261 | 21 | 0 | 4 | 96 |
12,886 | sdispater/poetry | src/poetry/utils/env/env_manager.py | utils.env.env_manager.EnvsFile | from poetry.toml.file import TOMLFile
class EnvsFile(TOMLFile):
"""
This file contains one section per project with the project's base env name
as section name. Each section contains the minor and patch version of the
python executable used to create the currently active virtualenv.
Example:
... |
class EnvsFile(TOMLFile):
'''
This file contains one section per project with the project's base env name
as section name. Each section contains the minor and patch version of the
python executable used to create the currently active virtualenv.
Example:
[poetry-QRErDmmj]
minor = "3.9"
... | 2 | 2 | 19 | 3 | 10 | 6 | 2 | 1.64 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 6 | 36 | 7 | 11 | 4 | 9 | 18 | 11 | 4 | 9 | 2 | 2 | 1 | 2 |
12,887 | sdispater/poetry | src/poetry/utils/env/exceptions.py | utils.env.exceptions.EnvCommandError | from poetry.utils._compat import decode
class EnvCommandError(EnvError):
def __init__(self, e: CalledProcessError) -> None:
self.e = e
message_parts = [f'Command {e.cmd} errored with the following return code {e.returncode}']
if e.output:
message_parts.append(f'Output:\n{decode... |
class EnvCommandError(EnvError):
def __init__(self, e: CalledProcessError) -> None:
pass | 2 | 0 | 11 | 1 | 10 | 0 | 3 | 0 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 11 | 12 | 1 | 11 | 4 | 9 | 0 | 9 | 4 | 7 | 3 | 4 | 1 | 3 |
12,888 | sdispater/poetry | src/poetry/utils/env/exceptions.py | utils.env.exceptions.EnvError | class EnvError(Exception):
pass | class EnvError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
12,889 | sdispater/poetry | src/poetry/utils/env/exceptions.py | utils.env.exceptions.IncorrectEnvError | class IncorrectEnvError(EnvError):
def __init__(self, env_name: str) -> None:
message = f"Env {env_name} doesn't belong to this project."
super().__init__(message) | class IncorrectEnvError(EnvError):
def __init__(self, env_name: str) -> None:
pass | 2 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 11 | 4 | 0 | 4 | 3 | 2 | 0 | 4 | 3 | 2 | 1 | 4 | 0 | 1 |
12,890 | sdispater/poetry | src/poetry/utils/env/generic_env.py | utils.env.generic_env.GenericEnv | import re
import subprocess
from poetry.utils.env.script_strings import GET_PATHS
import os
from poetry.utils.env.virtual_env import VirtualEnv
from typing import Any
import json
class GenericEnv(VirtualEnv):
def __init__(self, path: Path, base: Path | None=None, child_env: Env | None=None) -> None:
self.... |
class GenericEnv(VirtualEnv):
def __init__(self, path: Path, base: Path | None=None, child_env: Env | None=None) -> None:
pass
def find_executables(self) -> None:
pass
def get_paths(self) -> dict[str, str]:
pass
def execute(self, bin: str, *args: str, **kwargs: Any) -> int:
... | 7 | 0 | 13 | 2 | 10 | 0 | 3 | 0 | 1 | 9 | 0 | 0 | 6 | 3 | 6 | 20 | 82 | 19 | 63 | 26 | 54 | 0 | 48 | 24 | 41 | 12 | 2 | 4 | 18 |
12,891 | sdispater/poetry | src/poetry/utils/env/mock_env.py | utils.env.mock_env.MockEnv | from typing import Any
from poetry.utils.env.null_env import NullEnv
class MockEnv(NullEnv):
def __init__(self, version_info: tuple[int, int, int] | PythonVersion=(3, 7, 0), *, python_implementation: str='CPython', platform: str='darwin', platform_machine: str='amd64', os_name: str='posix', is_venv: bool=False, s... |
class MockEnv(NullEnv):
def __init__(self, version_info: tuple[int, int, int] | PythonVersion=(3, 7, 0), *, python_implementation:
pass
@property
def platform(self) -> str:
pass
@property
def platform_machine(self) -> str:
pass
@property
def os(self) -> str:
... | 12 | 0 | 8 | 1 | 7 | 0 | 1 | 0 | 1 | 9 | 0 | 2 | 7 | 9 | 7 | 87 | 66 | 10 | 56 | 35 | 31 | 0 | 37 | 18 | 29 | 2 | 7 | 1 | 9 |
12,892 | sdispater/poetry | src/poetry/utils/env/null_env.py | utils.env.null_env.NullEnv | from pathlib import Path
from poetry.utils.env.system_env import SystemEnv
import sys
from functools import cached_property
from typing import Any
class NullEnv(SystemEnv):
def __init__(self, path: Path | None=None, base: Path | None=None, execute: bool=False) -> None:
if path is None:
path = ... |
class NullEnv(SystemEnv):
def __init__(self, path: Path | None=None, base: Path | None=None, execute: bool=False) -> None:
pass
@cached_property
def paths(self) -> dict[str, str]:
pass
def _run(self, cmd: list[str], **kwargs: Any) -> str:
pass
def execute(self, bin: str, ... | 7 | 0 | 6 | 1 | 5 | 0 | 2 | 0 | 1 | 8 | 0 | 1 | 5 | 2 | 5 | 80 | 37 | 8 | 29 | 12 | 20 | 0 | 26 | 9 | 20 | 2 | 6 | 1 | 8 |
12,893 | sdispater/poetry | src/poetry/utils/env/python/exceptions.py | utils.env.python.exceptions.InvalidCurrentPythonVersionError | class InvalidCurrentPythonVersionError(PythonVersionError):
def __init__(self, expected: str, given: str) -> None:
message = f'Current Python version ({given}) is not allowed by the project ({expected}).\nPlease change python executable via the "env use" command.'
super().__init__(message) | class InvalidCurrentPythonVersionError(PythonVersionError):
def __init__(self, expected: str, given: str) -> None:
pass | 2 | 0 | 8 | 1 | 7 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 11 | 9 | 1 | 8 | 3 | 6 | 0 | 4 | 3 | 2 | 1 | 4 | 0 | 1 |
12,894 | sdispater/poetry | src/poetry/utils/env/python/exceptions.py | utils.env.python.exceptions.NoCompatiblePythonVersionFoundError | class NoCompatiblePythonVersionFoundError(PythonVersionError):
def __init__(self, expected: str, given: str | None=None) -> None:
if given:
message = f'The specified Python version ({given}) is not supported by the project ({expected}).\nPlease choose a compatible version or loosen the python c... | class NoCompatiblePythonVersionFoundError(PythonVersionError):
def __init__(self, expected: str, given: str | None=None) -> None:
pass | 2 | 0 | 17 | 1 | 16 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 11 | 18 | 1 | 17 | 3 | 15 | 0 | 6 | 3 | 4 | 2 | 4 | 1 | 2 |
12,895 | sdispater/poetry | src/poetry/utils/env/python/exceptions.py | utils.env.python.exceptions.PythonVersionNotFoundError | class PythonVersionNotFoundError(PythonVersionError):
def __init__(self, expected: str) -> None:
super().__init__(f'Could not find the python executable {expected}') | class PythonVersionNotFoundError(PythonVersionError):
def __init__(self, expected: str) -> None:
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 11 | 3 | 0 | 3 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
12,896 | sdispater/poetry | src/poetry/utils/env/python/manager.py | utils.env.python.manager.Python | from cleo.io.outputs.output import Verbosity
import os
from poetry.utils.env.python.exceptions import NoCompatiblePythonVersionFoundError
from typing import cast
from functools import cached_property
from pbs_installer._install import THIS_PLATFORM
from poetry.core.constraints.version import Version
from poetry.core.co... |
class Python:
@overload
def __init__(self, *, python: findpython.PythonVersion) -> None:
pass
@overload
def __init__(self, *, python: findpython.PythonVersion) -> None:
pass
def __init__(self, *, python: findpython.PythonVersion) -> None:
pass
@classmethod
def find_... | 44 | 4 | 11 | 1 | 6 | 3 | 2 | 0.44 | 0 | 10 | 3 | 0 | 7 | 1 | 13 | 13 | 166 | 28 | 96 | 40 | 65 | 42 | 55 | 19 | 41 | 5 | 0 | 2 | 25 |
12,897 | sdispater/poetry | src/poetry/utils/env/python/providers.py | utils.env.python.providers.ShutilWhichPythonProvider | from pathlib import Path
import findpython
import shutil
class ShutilWhichPythonProvider(findpython.BaseProvider):
@classmethod
def create(cls) -> Self | None:
return cls()
def find_pythons(self) -> Iterable[findpython.PythonVersion]:
if (python := self.find_python_by_name('python')):
... |
class ShutilWhichPythonProvider(findpython.BaseProvider):
@classmethod
def create(cls) -> Self | None:
pass
def find_pythons(self) -> Iterable[findpython.PythonVersion]:
pass
@classmethod
def find_python_by_name(cls, name: str) -> findpython.PythonVersion | None:
pass | 6 | 0 | 3 | 0 | 3 | 0 | 2 | 0.13 | 1 | 2 | 0 | 0 | 1 | 0 | 2 | 2 | 9 | 1 | 8 | 5 | 4 | 1 | 7 | 3 | 4 | 2 | 1 | 1 | 3 |
12,898 | sdispater/poetry | src/poetry/utils/env/site_packages.py | utils.env.site_packages.SitePackages | import itertools
from poetry.utils.helpers import is_dir_writable
from poetry.utils.helpers import remove_directory
from poetry.utils.helpers import paths_csv
from typing import Any
from poetry.utils._compat import metadata
from typing import Literal
from pathlib import Path
from typing import overload
import contextli... |
class SitePackages:
def __init__(self, purelib: Path, platlib: Path | None=None, fallbacks: list[Path] | None=None) -> None:
pass
@property
def path(self) -> Path:
pass
@property
def purelib(self) -> Path:
pass
@property
def platlib(self) -> Path:
pass
@... | 27 | 0 | 10 | 1 | 9 | 0 | 2 | 0.01 | 0 | 15 | 0 | 0 | 19 | 5 | 19 | 19 | 214 | 36 | 178 | 99 | 110 | 1 | 98 | 49 | 78 | 6 | 0 | 3 | 43 |
12,899 | sdispater/poetry | src/poetry/utils/env/system_env.py | utils.env.system_env.SystemEnv | import platform
from poetry.utils.env.base_env import MarkerEnv
from poetry.utils.env.base_env import Env
import site
from packaging.tags import Tag
from packaging.tags import sys_tags
from pathlib import Path
import sys
import os
from packaging.tags import interpreter_name
import sysconfig
from packaging.tags import i... |
class SystemEnv(Env):
'''
A system (i.e. not a virtualenv) Python environment.
'''
@property
def python(self) -> Path:
pass
@property
def sys_path(self) -> list[str]:
pass
def get_paths(self) -> dict[str, str]:
pass
def get_supported_tags(self) -> list[Tag]... | 10 | 1 | 7 | 1 | 6 | 0 | 1 | 0.09 | 1 | 8 | 0 | 1 | 7 | 0 | 7 | 75 | 63 | 12 | 47 | 16 | 36 | 4 | 29 | 14 | 20 | 3 | 5 | 2 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.