aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorTim D. Smith2014-12-11 07:55:32 -0800
committerTim D. Smith2014-12-11 07:55:32 -0800
commit6dc27a526e6f6ead3a2f787d93fbbc4056f0656b (patch)
treef11b135b4a620920738ad056c79c3f2cab9e645a /share
parent66951d95700396b771f660f5d3a95583a9d672ab (diff)
downloadhomebrew-6dc27a526e6f6ead3a2f787d93fbbc4056f0656b.tar.bz2
Python docs: use prepend_create_path
prepend_path doesn't do anything if path doesn't already exist, so use prepend_create_path.
Diffstat (limited to 'share')
-rw-r--r--share/doc/homebrew/Python-for-Formula-Authors.md8
1 files 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 0a5073a62..1f69e4239 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/*"]