aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/python_helper.rb
AgeCommit message (Collapse)Author
2013-07-15Fix multiple execution of python do ... end blocksSamuel John
Only run the `python do ... end` loop once even if multiple `depends_on :python => 'module-name'` are present.
2013-07-02Remove more nesting in python_helperAdam Vandenberg
2013-07-02Reduce nesting and remove extra whitespace in python_helperAdam Vandenberg
2013-06-18Python module deps, ext. python fix and 10.6 fixSamuel John
* Fixes #20572 by tweaking the logic that decides which python is used by the `python` object inside a formula. There was a bug when on 10.6 there is no Python 2.7 but a :recommended Python was still treated as being available. * Use the user's PATH when looking for an external Python. Until now only brewed or OS X system's python have been found by `depends_on :python`. But now we support any Python in PATH (e.g. pyenv's python). * Further, instead of handling python modules and import tests in LanguageModuleDependency, these are now handled by: depends_on :python => 'numpy' # for example The old style depends_on 'numpy' => :python is still supported and is only an alias for the newer style (only for :python, the other languages are not altered by this commit). The reasoning is that if a formula requires a python module, it basically also needs python itself - and further that specific version of python has to provide the module. So the `PythonInstalled` is the natural place to check for the availability of a python module. Using a python module and other tags like :optional or :recommended is done like so: depends_on :python => [:optional, 'numpy'] Specifying another PyPi (Python Package index) name than the module import name is seldom used but supported, too: depends_on :python => ['enchant'=>'pyenchant'] A last note: For clarity, you can define multiple depends_on statements with different modules to be importable.`
2013-06-07python_helper.rb: Little comment improvementSamuel John
2013-06-06depends_on :python don't set any LDFLAGSSamuel John
Setting LDFLAGS to `-F HOMEBREW_PREFIX/opt/python/Frameworks` breaks at least the scipy build. Perhaps others, too.
2013-06-06Hotfix: Revert Python moduleSamuel John
2013-06-06PythonInstalled: Don't require superenvSamuel John
* The python do ... end block does no longer require 'superenv' but saves and restores the ENV by using ENV.to_hash and `ensure`. This should resolve some build problems with formulae using `env :std`! * `python_helper` is now in a module `Python`. * Imporoved some comments in python_dependency.rb
2013-06-05depends_on :python sets PYTHONPATH internallySamuel John
This applies only to non-brewed python: The user will still have to set his PYTHONPATH in order to import python modules in an external python interpreter. However, a warning will be displayed, now. Further, during the build, the PYTHONPATH will be set to Homebrew's global site-packages so that software (like PyQt and others) that need to `import sipconfig` in python can find the brewed sip and its python module.
2013-06-05Python add -F#{python.framework} for brewed PythonSamuel John
Since Python has been removed from superenv and added as an explicit `depends_on :python`, we should add `-F#{HOMEBREW_PREFIX}/opt/python/Framewoks` so that build tools that don't use `python-config --ldflags` (as they should!) can link against brewed Python.
2013-06-04python_helper style bitSamuel John
2013-06-04Python is less verbose with "brew: Using python.."Samuel John
Now it is only shown for an `python do ... end` block and not for ordinary python.site_packages or other methods.
2013-06-03Python 2.x and 3.x supportSamuel John
New `depends_on :python` Dependency. New `depends_on :python3` Dependency. To avoid having multiple formulae with endings -py2 and -py3, we will handle support for different pythons (2.x vs. 3.x) in the same formula. Further brewed vs. external python will be transparently supported. The formula also gets a new object `python`, which is false if no Python is available or the user has disabled it. Otherwise it is defined and provides several support methods: python.site_packages # the site-packages in the formula's Cellar python.global_site_packages python.binary # the full path to the python binary python.prefix python.version python.version.major python.version.minor python.xy # => e.g. "python2.7" python.incdir # includes of python python.libdir # the python dylib library python.pkg_config_path # used internally by brew python.from_osx? python.framework? python.universal? python.pypy? python.standard_caveats # Text to set PYTHONPATH for python.from_osx? python.if3then3 # => "" for 2.x and to "3" for 3.x. Further, to avoid code duplication, `python` takes an optional block that is run twice if the formula defines depends_on :python AND :python3. python do system python, 'setup.py', "--prefix=#{prefix}" end Read more in the Homebrew wiki.