import configparser
from _typeshed import Incomplete
from typing import Any

from pkg_resources import Environment

def parse_bdist_wininst(name): ...
def distros_for_url(url, metadata: Incomplete | None = ...) -> None: ...
def interpret_distro_name(
    location, basename, metadata, py_version: Incomplete | None = ..., precedence=..., platform: Incomplete | None = ...
) -> None: ...

class ContentChecker:
    def feed(self, block) -> None: ...
    def is_valid(self): ...
    def report(self, reporter, template) -> None: ...

class HashChecker(ContentChecker):
    pattern: Any
    hash_name: Any
    hash: Any
    expected: Any
    def __init__(self, hash_name, expected) -> None: ...
    @classmethod
    def from_url(cls, url): ...
    def feed(self, block) -> None: ...
    def is_valid(self): ...
    def report(self, reporter, template): ...

class PackageIndex(Environment):
    index_url: Any
    scanned_urls: Any
    fetched_urls: Any
    package_pages: Any
    allows: Any
    to_scan: Any
    opener: Any
    def __init__(
        self, index_url: str = ..., hosts=..., ca_bundle: Incomplete | None = ..., verify_ssl: bool = ..., *args, **kw
    ) -> None: ...
    def process_url(self, url, retrieve: bool = ...) -> None: ...
    def process_filename(self, fn, nested: bool = ...) -> None: ...
    def url_ok(self, url, fatal: bool = ...): ...
    def scan_egg_links(self, search_path) -> None: ...
    def scan_egg_link(self, path, entry) -> None: ...
    def process_index(self, url, page): ...
    def need_version_info(self, url) -> None: ...
    def scan_all(self, msg: Incomplete | None = ..., *args) -> None: ...
    def find_packages(self, requirement) -> None: ...
    def obtain(self, requirement, installer: Incomplete | None = ...): ...
    def check_hash(self, checker, filename, tfp) -> None: ...
    def add_find_links(self, urls) -> None: ...
    def prescan(self) -> None: ...
    def not_found_in_index(self, requirement) -> None: ...
    def download(self, spec, tmpdir): ...
    def fetch_distribution(
        self,
        requirement,
        tmpdir,
        force_scan: bool = ...,
        source: bool = ...,
        develop_ok: bool = ...,
        local_index: Incomplete | None = ...,
    ): ...
    def fetch(self, requirement, tmpdir, force_scan: bool = ..., source: bool = ...): ...
    def gen_setup(self, filename, fragment, tmpdir): ...
    dl_blocksize: int
    def reporthook(self, url, filename, blocknum, blksize, size) -> None: ...
    def open_url(self, url, warning: Incomplete | None = ...): ...
    def scan_url(self, url) -> None: ...
    def debug(self, msg, *args) -> None: ...
    def info(self, msg, *args) -> None: ...
    def warn(self, msg, *args) -> None: ...

class Credential:
    username: Any
    password: Any
    def __init__(self, username, password) -> None: ...
    def __iter__(self): ...

class PyPIConfig(configparser.RawConfigParser):
    def __init__(self) -> None: ...
    @property
    def creds_by_repository(self): ...
    def find_credential(self, url): ...
