class documentation

class PackageIndex(Environment): (source)

View In Hierarchy

A distribution index that scans web pages for download URLs

Method __init__ Undocumented
Method add Undocumented
Method add_find_links Add `urls` to the list that will be prescanned for searches
Method check_hash checker is a ContentChecker
Method debug Undocumented
Method download Locate and/or download `spec` to `tmpdir`, returning a local path
Method fetch Obtain a file suitable for fulfilling `requirement`
Method fetch_distribution Obtain a distribution suitable for fulfilling `requirement`
Method find_packages Undocumented
Method gen_setup Undocumented
Method info Undocumented
Method need_version_info Undocumented
Method not_found_in_index Undocumented
Method obtain Undocumented
Method open_url Undocumented
Method prescan Scan urls scheduled for prescanning (e.g. --find-links)
Method process_filename Undocumented
Method process_index Process the contents of a PyPI page
Method process_url Evaluate a URL as a possible download, and maybe retrieve it
Method reporthook Undocumented
Method scan_all Undocumented
Method scan_egg_link Undocumented
Method scan_egg_links Undocumented
Method scan_url Undocumented
Method url_ok Undocumented
Method warn Undocumented
Class Variable dl_blocksize Undocumented
Instance Variable allows Undocumented
Instance Variable fetched_urls Undocumented
Instance Variable index_url Undocumented
Instance Variable opener Undocumented
Instance Variable package_pages Undocumented
Instance Variable scanned_urls Undocumented
Instance Variable to_scan Undocumented
Static Method _vcs_split_rev_from_url Undocumented
Method _attempt_download Undocumented
Method _download_git Undocumented
Method _download_hg Undocumented
Method _download_html Undocumented
Method _download_svn Undocumented
Method _download_to Undocumented
Method _download_url Undocumented
Method _scan Undocumented
def __init__(self, index_url='https://pypi.org/simple/', hosts=('*'), ca_bundle=None, verify_ssl=True, *args, **kw): (source)

Undocumented

def add(self, dist): (source)

Undocumented

def add_find_links(self, urls): (source)

Add `urls` to the list that will be prescanned for searches

def check_hash(self, checker, filename, tfp): (source)

checker is a ContentChecker

def debug(self, msg, *args): (source)

Undocumented

def download(self, spec, tmpdir): (source)

Locate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading.

def fetch(self, requirement, tmpdir, force_scan=False, source=False): (source)

Obtain a file suitable for fulfilling `requirement` DEPRECATED; use the ``fetch_distribution()`` method now instead. For backward compatibility, this routine is identical but returns the ``location`` of the downloaded distribution instead of a distribution object.

def fetch_distribution(self, requirement, tmpdir, force_scan=False, source=False, develop_ok=False, local_index=None): (source)

Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. If necessary, or if the `force_scan` flag is set, the requirement is searched for in the (online) package index as well as the locally installed packages. If a distribution matching `requirement` is found, the returned distribution's ``location`` is the value you would have gotten from calling the ``download()`` method with the matching distribution's URL or filename. If no matching distribution is found, ``None`` is returned. If the `source` flag is set, only source distributions and source checkout links will be considered. Unless the `develop_ok` flag is set, development and system eggs (i.e., those using the ``.egg-info`` format) will be ignored.

def find_packages(self, requirement): (source)

Undocumented

def gen_setup(self, filename, fragment, tmpdir): (source)

Undocumented

def info(self, msg, *args): (source)

Undocumented

def need_version_info(self, url): (source)

Undocumented

def not_found_in_index(self, requirement): (source)

Undocumented

def obtain(self, requirement, installer=None): (source)

Undocumented

def open_url(self, url, warning=None): (source)

Undocumented

def prescan(self): (source)

Scan urls scheduled for prescanning (e.g. --find-links)

def process_filename(self, fn, nested=False): (source)

Undocumented

def process_index(self, url, page): (source)

Process the contents of a PyPI page

def process_url(self, url, retrieve=False): (source)

Evaluate a URL as a possible download, and maybe retrieve it

def reporthook(self, url, filename, blocknum, blksize, size): (source)

Undocumented

def scan_all(self, msg=None, *args): (source)

Undocumented

def scan_egg_link(self, path, entry): (source)

Undocumented

def scan_egg_links(self, search_path): (source)

Undocumented

def scan_url(self, url): (source)

Undocumented

def url_ok(self, url, fatal=False): (source)

Undocumented

def warn(self, msg, *args): (source)

Undocumented

dl_blocksize: int = (source)

Undocumented

Undocumented

fetched_urls: dict = (source)

Undocumented

index_url = (source)

Undocumented

Undocumented

package_pages: dict = (source)

Undocumented

scanned_urls: dict = (source)

Undocumented

Undocumented

@staticmethod
def _vcs_split_rev_from_url(url, pop_prefix=False): (source)

Undocumented

def _attempt_download(self, url, filename): (source)

Undocumented

def _download_git(self, url, filename): (source)

Undocumented

def _download_hg(self, url, filename): (source)

Undocumented

def _download_html(self, url, headers, filename): (source)

Undocumented

def _download_svn(self, url, filename): (source)

Undocumented

def _download_to(self, url, filename): (source)

Undocumented

def _download_url(self, scheme, url, tmpdir): (source)

Undocumented

def _scan(self, link): (source)

Undocumented