1. 21 Mar, 2024 9 commits
    • Kazuhiko Shiozaki's avatar
      [feat] Revert "Removing develop-eggs/ directory before bootstrapping." · 2887d268
      Kazuhiko Shiozaki authored
      In SlapOS, bootstrap is called each time software release is invoked and
      we do not want to delete develop-eggs directory.
      
      This reverts commit 55d76b34.
      2887d268
    • Kazuhiko Shiozaki's avatar
    • Kazuhiko Shiozaki's avatar
    • Kazuhiko Shiozaki's avatar
      [why?] Ignore empty value for 'download-cache' in 'buildout' section · 07a3a7e4
      Kazuhiko Shiozaki authored
      Even though such configuration is wrong...
      07a3a7e4
    • Xavier Thompson's avatar
      [test] Disable extends-cache.txt test · 7a7f56e8
      Xavier Thompson authored
      This test asserts buildout's behavior with regards to download options,
      and this was changed by the new algorithm for extends. Tests for the
      new behavior have not been written yet.
      7a7f56e8
    • Xavier Thompson's avatar
      [feat] Reimplement the extends algorithm · fa08764e
      Xavier Thompson authored
      The new algorithm avoids fetching the same extended file more than once
      and correctly handles overriding values and += and -=:
      
      The new algorithm starts as if there was a buildout file containing
      
      ```
      [buildout]
      extends =
        user/defaults.cfg # if it exists
        buildout.cfg # if it exists
        command_line_extends.cfg # if passed on the command line
      ```
      
      The files are then fetched in depth-first-search postorder and fetching
      child nodes in the order given by the extends directive, ignoring files
      that have already been fetched.
      
      The buildout dicts are then collected in order, and this linearisation
      is then merged at the end, overriding the first configs collected with
      the later ones. The first dict in the linearisation is not from a file,
      but the dict of buildout's (hardcoded) defaults. This is equivalent to
      acting as though every file that does not extend anything extends these
      defaults.
      
      The first time a file must be downloaded from a url, the linearisation
      is merged with the configs already collected, and the resulting options
      are then used to determine the download options for this download, and
      every subsequent download.
      
      This is a break with buildout's current logic for download options.
      
      By analogy with classes in Python, we are computing a linearisation of
      the class hierarchy to determine the method resolution order (MRO).
      This algorithm is not the same as Python's MRO since Python 2.3 (C3).
      
      It could be good to switch to a C3 linearisation like Python.
      fa08764e
    • Xavier Thompson's avatar
      [opti] Unannotate sections in-place · fdbf7d14
      Xavier Thompson authored
      This avoids unecessary copies. This is a preparatory step to
      reimplementing the extends algorithm. It may be that this breaks
      the extends algorithm as it is currently implemented.
      fdbf7d14
    • Xavier Thompson's avatar
      [opti] Update sections in-place · aa0abf19
      Xavier Thompson authored
      This avoids unecessary deepcopies. This is a preparatory step to
      reimplementing the extends algorithm. It may be that this breaks
      the extends algorithm as it is currently implemented.
      aa0abf19
    • Xavier Thompson's avatar
      [opti] Remove redundant deepcopies · 30d45f18
      Xavier Thompson authored
      30d45f18
  2. 13 Mar, 2024 2 commits
    • Xavier Thompson's avatar
      [feat] Respect pinned versions in bootstrap · 0dcfd8c2
      Xavier Thompson authored
      If zc.buildout or its dependencies have pinned versions that do not
      match the currently running versions, they are now installed in the
      local eggs directory from scratch according to the pinned versions.
      
      In offline mode this merely ensures that versions that satisfy the
      requirements are already available. This is the case when the eggs
      are already installed, or when the running versions are a match to
      the pinned versions or the absence of a pinned version.
      
      If after this matching versions of zc.buildout and its dependencies
      are not located in the local eggs or develop-eggs directories, they
      are copied there as was already the case before.
      0dcfd8c2
    • Xavier Thompson's avatar
      [bug] Fix accidental changes to PYTHONPATH in os.environ · e521348b
      Xavier Thompson authored
      When generating an environment dict for subprocess calls to pip,
      os.environ was accidentally modified despite efforts to copy it
      and modify only the copy, as copy.copy(os.environ) is not enough.
      e521348b
  3. 08 Nov, 2022 2 commits
  4. 06 Nov, 2022 27 commits