1. 25 May, 2017 1 commit
    • Jason Madden's avatar
      Sort distributions when computing a signature. (#393) · 47bbc3c4
      Jason Madden authored
      This fixes #392.
      
      Previously under Python 3 (probably prior to 3.6, when dicts became
      ordered by default) or under Python 2 with ``-R`` or
      ``PYTHONHASHSEED=random`` the results were undefined because dict
      iteration order is undefined.
      
      The value being sorted is complex and defined by
      pkg_resources.Distribution:
      
      ```    @property
          def hashcmp(self):
              return (
                  self.parsed_version,
                  self.precedence,
                  self.key,
                  _remove_md5_fragment(self.location),
                  self.py_version or '',
                  self.platform or '',
              )
      
          def __hash__(self):
              return hash(self.hashcmp)
      
          def __lt__(self, other):
              return self.hashcmp < other.hashcmp
      ...
      ```
      47bbc3c4
  2. 30 Mar, 2017 5 commits
  3. 28 Mar, 2017 1 commit
  4. 07 Mar, 2017 10 commits
  5. 06 Mar, 2017 15 commits
  6. 05 Mar, 2017 1 commit
    • Leonardo Rochael Almeida's avatar
      Installer: Encapsulate all uses of `._env` and `._path` (#352) · fbb8c37b
      Leonardo Rochael Almeida authored
      * buildout.cfg: Remove redundancy
      
      Share the eggs definition between the the online and offline tests.
      
      * Remove redundant code
      
      Trying to insert `self._dest` in `self._path`  in `Installer.install()`
      is unnecessary since:
      
       * it's already done in `__init__()`
      
       * nothing changes either `self._path` or `self._dest` during the
         lifetime of `Installer`
      
      Remove `Installer._load_dist(self, dist)` since it has never been
      used in the whole history of Buildout.
      
      Finally, simplify the interface to `._get_dist()` and  `_call_easy_install()`:
      
      All callers to `._get_dist()` add the resulting dist to the WorkingSet. No
      reason to do it in `._get_dist()` or to pass the `ws` into
      `._call_easy_install()`.
      
      * Be stricter when adding setuptools as requirements
      
      Only do it for namespace package dists that actually need it. I.e. those
      that use `pkg_resources.declare_namespace()` instead of
      `pkg_util.extend_path()` or PEP 420.
      
      * easy_install: `eggs-directory` may contain more than eggs
      
      Modify the `easy_install.Installer` class to locate not only eggs, but
      anything that has a `.dist-info` inside `._dest` (i.e. the Buildout
      `eggs-directory`).
      
      This makes it easier for extensions like `buildout.wheel` to add non eggs
      inside it: by installing a distribution inside a subdirectory of `._dest` as if
      that subdirectory was `site-packages`, you can later locate that
      distribution with the Installer.
      
      Conversely, make sure any distribution found in a direct child of `.dest` is
      treated as if it was an `egg` distribution (as opposed to a develop
      distribution or a site-packages distribution).
      
      All access to `Installer._path` and all access that modifies `._env` is now
      done through `Installer` methods, so that Buildout extensions can install
      subclasses of `Installer` that alter their behaviour.
      
      * Refactor `_get_dist()` and `_call_easy_install()`
      
      Move the actual invocation of `easy_install` to a module global function
      `call_easy_install()`. Simplify its signature so it's simpler to
      override in Buildout extensions.
      
      Refactor `._get_dist()` and remove all unpack/install logic into
      `_move_to_eggs_dir_and_compile()`, bypassing
      `Installer._call_easy_install()`.
      
      `._get_dist()` now calls directly `call_easy_install()` instead. But
      only as a fallback to a dictionary lookup of filename extensions to
      distribution unpacking methods like:
      
       - `.egg`: `unpack_egg()`
       - `.whl`: `unpack_wheel()`
      
      This will make it easier for extensions to add support to new dist
      formats.
      fbb8c37b
  7. 03 Mar, 2017 1 commit
  8. 01 Mar, 2017 1 commit
  9. 28 Feb, 2017 5 commits