From df2e570fefccf4f006049d326366e6826e797764 Mon Sep 17 00:00:00 2001 From: "Tim D. Smith" Date: Thu, 11 Dec 2014 07:55:32 -0800 Subject: [PATCH] Python docs: use prepend_create_path prepend_path doesn't do anything if path doesn't already exist, so use prepend_create_path. --- share/doc/homebrew/Python-for-Formula-Authors.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/doc/homebrew/Python-for-Formula-Authors.md b/share/doc/homebrew/Python-for-Formula-Authors.md index 0a5073a62d..1f69e42394 100644 --- a/share/doc/homebrew/Python-for-Formula-Authors.md +++ b/share/doc/homebrew/Python-for-Formula-Authors.md @@ -58,7 +58,7 @@ Applications should be installed to `libexec`. This prevents the app's Python mo In your formula's `install` method, first set the `PYTHONPATH` environment variable to your package's libexec site-packages directory with: ```ruby -ENV.prepend_path "PYTHONPATH", libexec/"lib/python2.7/site-packages" +ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages" ``` Then, use `system` with `Language::Python.setup_install_args` to invoke `setup.py` like: ```ruby @@ -81,7 +81,7 @@ Each dependency **should** be explicitly installed; please do not rely on setup. Set `PYTHONPATH` to include the `libexec/"vendor"` site-packages path with: ```ruby -ENV.prepend_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages" +ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages" ``` before staging and installing each resourced dependency with: ```ruby @@ -107,14 +107,14 @@ class Foo < Formula end def install - ENV.prepend_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages" + ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages" %w[six parsedatetime].each do |r| resource(r).stage do system "python", *Language::Python.setup_install_args(libexec/"vendor") end end - ENV.prepend_path "PYTHONPATH", libexec/"lib/python2.7/site-packages" + ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages" system "python", *Language::Python.setup_install_args(libexec) bin.install Dir[libexec/"bin/*"]