The PEAK Developers' Center   Diff for "PkgResources" UserPreferences
 
HelpContents Search Diffs Info Edit Subscribe XML Print View
Ignore changes in the amount of whitespace

Differences between version dated 2006-03-29 18:53:51 and 2010-01-31 00:36:31 (spanning 17 versions)

Deletions are marked like this.
Additions are marked like this.

    the global ``working_set`` to reflect the change. This method is also
    called by the ``WorkingSet()`` constructor during initialization.
 
    This method uses ``find_distributions(entry,False)`` to find distributions
    This method uses ``find_distributions(entry, True)`` to find distributions
    corresponding to the path entry, and then ``add()`` them. `entry` is
    always appended to the ``entries`` attribute, even if it is already
    present, however. (This is because ``sys.path`` can contain the same value

``Environment`` objects are used by ``pkg_resources`` to index available
distributions during dependency resolution.
 
``Environment(search_path=None, platform=get_platform(), python=PY_MAJOR)``
``Environment(search_path=None, platform=get_supported_platform(), python=PY_MAJOR)``
    Create an environment snapshot by scanning `search_path` for distributions
    compatible with `platform` and `python`. `search_path` should be a
    sequence of strings such as might be used on ``sys.path``. If a

    parsed using the ``parse_version()`` utility function. Otherwise, it is
    assumed to be an already-parsed version.
 
    The ``Requirement`` object's version specifiers (``.specs``) are internally
    sorted into ascending version order, and used to establish what ranges of
    versions are acceptable. Adjacent redundant conditions are effectively
    consolidated (e.g. ``">1, >2"`` produces the same results as ``">1"``, and
    ``"<2,<3"`` produces the same results as``"<3"``). ``"!="`` versions are
    excised from the ranges they fall within. The version being tested for
    acceptability is then checked for membership in the resulting ranges.
    (Note that providing conflicting conditions for the same version (e.g.
    ``"<2,>=2"`` or ``"==2,!=2"``) is meaningless and may therefore produce
    bizarre results when compared with actual version number(s).)
 
``__eq__(other_requirement)``
    A requirement compares equal to another requirement if they have
    case-insensitively equal project names, version specifiers, and "extras".

    function, so they may not exactly equal the extras the requirement was
    created with.)
 
``specs``
    A list of ``(op,version)`` tuples, sorted in ascending parsed-version
    order. The `op` in each tuple is a comparison operator, represented as
    a string. The `version` is the (unparsed) version number. The relative
    order of tuples containing the same version numbers is undefined, since
    having more than one operator for a given version is either redundant or
    self-contradictory.
 
 
Entry Points
============

    to the working set). If the named package can't be imported, or the
    ``Requirement`` can't be satisfied, an exception is raised.
 
    Note also that if you supply a package name, and the package is not part
    of a pluggable distribution (i.e., it has no metadata), then you will still
    get an ``IResourceProvider`` object, but it will return ``False`` when
    asked if any metadata files or directories exist.
    NOTE: if you use a package name rather than a ``Requirement``, the object
    you get back may not be a pluggable distribution, depending on the method
    by which the package was installed. In particular, "development" packages
    and "single-version externally-managed" packages do not have any way to
    map from a package name to the corresponding project's metadata. Do not
    write code that passes a package name to ``get_provider()`` and then tries
    to retrieve project metadata from the returned object. It may appear to
    work when the named package is in an ``.egg`` file or directory, but
    it will fail in other installation scenarios. If you want project
    metadata, you need to ask for a *project*, not a package.
 
 
``IMetadataProvider`` Methods

    Finally, to handle miscellaneous cases, the strings "pre", "preview", and
    "rc" are treated as if they were "c", i.e. as though they were release
    candidates, and therefore are not as new as a version string that does not
    contain them.
    contain them. And the string "dev" is treated as if it were an "@" sign;
    that is, a version coming before even "a" or "alpha".
 
.. _yield_lines():
 

Platform Utilities
------------------
 
``get_platform()``
``get_build_platform()``
    Return this platform's identifier string. For Windows, the return value
    is ``"win32"``, and for Mac OS X it is a string of the form
    ``"macosx-10.4-ppc"``. All other platforms return the same uname-based
    string that the ``distutils.util.get_platform()`` function returns.
    This string is the minimum platform version required by distributions built
    on the local machine. (Backward compatibility note: setuptools versions
    prior to 0.6b1 called this function ``get_platform()``, and the function is
    still available under that name for backward compatibility reasons.)
 
``get_supported_platform()`` (New in 0.6b1)
    This is the similar to ``get_build_platform()``, but is the maximum
    platform version that the local machine supports. You will usually want
    to use this value as the ``provided`` argument to the
    ``compatible_platforms()`` function.
 
``compatible_platforms(provided, required)``
    Return true if a distribution built on the `provided` platform may be used

    for obtaining an "importer" object. It first checks for an importer for
    the path item in ``sys.path_importer_cache``, and if not found it calls
    each of the ``sys.path_hooks`` and caches the result if a good importer is
    found. If no importer is found, this routine returns an ``ImpWrapper``
    instance that wraps the builtin import machinery as a PEP 302-compliant
    "importer" object. This ``ImpWrapper`` is *not* cached; instead a new
    instance is returned each time.
    found. If no importer is found, this routine returns a wrapper object
    that wraps the builtin import machinery as a PEP 302-compliant "importer"
    object. This wrapper object is *not* cached; instead a new instance is
    returned each time.
 
 
File/Path Utilities

Release Notes/Change History
----------------------------
 
0.6c10
 * Prevent lots of spurious "already imported from another path" warnings (e.g.
   when pkg_resources is imported late).
 
0.6c9
 * Fix ``resource_listdir('')`` always returning an empty list for zipped eggs.
 
0.6c7
 * Fix package precedence problem where single-version eggs installed in
   ``site-packages`` would take precedence over ``.egg`` files (or directories)
   installed in ``site-packages``.
   
0.6c6
 * Fix extracted C extensions not having executable permissions under Cygwin.
 
 * Allow ``.egg-link`` files to contain relative paths.
 
 * Fix cache dir defaults on Windows when multiple environment vars are needed
   to construct a path.
 
0.6c4
 * Fix "dev" versions being considered newer than release candidates.
 
0.6c3
 * Python 2.5 compatibility fixes.
 
0.6c2
 * Fix a problem with eggs specified directly on ``PYTHONPATH`` on
   case-insensitive filesystems possibly not showing up in the default
   working set, due to differing normalizations of ``sys.path`` entries.
 
0.6b3
 * Fixed a duplicate path insertion problem on case-insensitive filesystems.
 
0.6b1
 * Split ``get_platform()`` into ``get_supported_platform()`` and
   ``get_build_platform()`` to work around a Mac versioning problem that caused
   the behavior of ``compatible_platforms()`` to be platform specific.
 
 * Fix entry point parsing when a standalone module name has whitespace
   between it and the extras.
 
0.6a11
 * Added ``ExtractionError`` and ``ResourceManager.extraction_error()`` so that
   cache permission problems get a more user-friendly explanation of the

 
0.3a1
 * Initial release.
 

PythonPowered
ShowText of this page
EditText of this page
FindPage by browsing, title search , text search or an index
Or try one of these actions: AttachFile, DeletePage, LikePages, LocalSiteMap, SpellCheck