1. 31 Mar, 2016 1 commit
  2. 30 Mar, 2016 1 commit
  3. 29 Mar, 2016 2 commits
  4. 23 Mar, 2016 1 commit
    • Switch to using os.path for outdated file checks in compilers. · 930b12c9
      The outdated file checks in the compilers were using django storages to check
      file existence and compare mtimes, but with my recent change (which restored
      the older behavior of comparing the infile and outfile), these were operating
      on absolute, local files, which could result in a SuspiciousFileOperation.
      
      The compilers always operate on local files, so we can switch to using the
      os.path methods for these instead. This is both more correct and more
      efficient.
      David Trowbridge committed
  5. 22 Mar, 2016 2 commits
  6. 21 Mar, 2016 2 commits
    • Merge pull request #552 from chipx86/templatetags/split-render-func · 0dc58580
      Split render_compressed in templatetags for easier subclassing
      David Trowbridge committed
    • Split the render_compressed method in templatetags for easier subclassing. · b647cf55
      The base mixin for the template tags, PipelineMixin, performed the bulk
      of its rendering logic in the render_compressed() method. It handled
      both rendering output files (if PIPELINE_ENABLED was True), or source
      files (if False). Due to the complexity of this method, it was difficult
      for a subclass (which may need to perform more specialized logic) to
      override this method without copying the code.
      
      This splits out that function into two new utility methods,
      render_compressed_sources() and render_compressed_output(). These take
      the same arguments as render_compressed(), and are called by that method
      as well. This allows a subclass to more easily replace the logic for
      determining which to call, or to replace the logic for either of these
      renders.
      Christian Hammond committed
  7. 10 Mar, 2016 6 commits
  8. 07 Mar, 2016 1 commit
  9. 06 Mar, 2016 1 commit
    • Add error output for compiler errors within the browser. · 3b5c5a22
      Debugging CSS/JavaScript compilation errors can be difficult when viewed
      within the context of a Django error page, and if there's a wider
      problem with other CSS/JavaScript packages, they won't show up until the
      first compilation error is fixed. This is worse if running in a mode
      where Pipeline is running but Django error pages aren't being shown.
      
      This change introduces an option, PIPELINE.SHOW_ERRORS_INLINE (now
      enabled by default) that outputs any compilation errors at the top of
      the page, visually distinguished from the rest of the page, and
      containing information on the failing package, command line, and output.
      This makes it much easier to debug what went wrong.
      
      The errors are outputted into a hidden div, and then once the page has
      fully loaded, they're placed at the top. This allows Pipeline usage
      anywhere on the page to promote errors to the top, in the order in which
      they're loaded. These also have a default style, but that can be
      overridden (and in fact the whole error template overridden) by the
      consuming application.
      Christian Hammond committed
  10. 26 Feb, 2016 1 commit
  11. 24 Feb, 2016 2 commits
  12. 23 Feb, 2016 2 commits
  13. 22 Feb, 2016 12 commits
  14. 18 Feb, 2016 1 commit
    • Fix paths given to compiler.is_outdated. · c4ff03e5
      The check to see whether or not a source file is outdated was being passed the
      `input_path` and `output_path` variables, which are not the actual paths to
      files on disk. In particular, `input_path` is the path which will be searched
      for using the staticfiles finders, and `output_path` is the relative path
      within the staticfiles root. If the staticfiles root was not the same as the
      root directory of the project, this would result in the check always reporting
      that the file was outdated. In addition, if a source file required a finder to
      locate, the check would fail.
      
      Changing this to use `infile` and `outfile` instead means that the check
      operates on the same file paths that the compiler will. This therefore checks
      the files that were copied by the collector against the files which are
      outputted by the compiler, which is a much more correct idea of whether
      something is out of date.
      
      This was tested in conjunction with a custom LessCompiler that uses a helper to
      introspect dependencies. Before this change, that helper was seeing file paths
      that did not exist (since STATIC_ROOT is a few subdirectories deep in our
      codebase). Afterwards, it is able to successfully introspect all the source
      files to build the dependency tree.
      David Trowbridge committed
  15. 17 Feb, 2016 1 commit
    • Fix an UnboundLocalError if a compiler fails. · c0937f1a
      Depending on where an exception is raised inside a compiler's
      `execute_command`, the `stdout` variable may not be assigned. In this case, the
      finally handler would fail with an `UnboundLocalError`, hiding the true cause
      of the exception. This change adds a new variable, `stdout_name`, which is
      populated once we've actually created the file. After this, the `CompilerError`
      is successfully raised with the contents of the true error.
      David Trowbridge committed
  16. 16 Feb, 2016 1 commit
  17. 14 Feb, 2016 1 commit
  18. 10 Feb, 2016 1 commit
    • Allow compilers to override output_path. · 2899300f
      The current logic for compilers to manipulate output paths is pretty simple,
      using `os.path.splitext` and the compiler's `output_extension`. This precludes
      doing fancier things by just implementing one's own compiler class.
      
      This change moves the `output_file` method into the CompilerBase class, so that
      subclasses can override its behavior to suit their own needs.
      David Trowbridge committed
  19. 09 Feb, 2016 1 commit
    • Fix unit tests for glob updates. · b2be56f9
      The aforementioned change to `glob` surfaced a couple errors in the unit tests:
      
      1. `test_glob_literal` was still testing the old behavior of non-existing paths
         being filtered out.
      2. The post-process tests (`test_post_process_dry_run` and `test_post_process`)
         were now failing because post-process was being run without first collecting
         the media. This is a case where non-existing files were previously being
         filtered out silently but now cause an error. Running the collection stage
         before testing `post_process.
      David Trowbridge committed