59 Commits

Author SHA1 Message Date
Jack Nagel
4d5c152666 Remove unnecessary nil check
The backticks will either return a string or raise an exception, so
`executable` cannot be nil.
2015-03-05 20:48:47 -05:00
Jack Nagel
db772eee8a Use env DSL 2015-03-05 20:39:57 -05:00
Mike McQuaid
515395171c Set cask and download DSL values on requirements.
Closes Homebrew/homebrew#35257.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-12-28 12:14:49 +00:00
Jack Nagel
330e18bb17 Use predicate methods instead of inspecting the tags array 2014-07-01 21:57:30 -05:00
Mike McQuaid
efe7fe77a1 python_dependency: don't block pour when :build. 2014-04-04 11:55:36 +01:00
Mike McQuaid
1207ba4f8c python_dependency: only pour with system python.
This is as Python bindings are not build in a way that can have
system or Homebrew Python used interchangeably.
2014-04-03 19:47:15 +01:00
Mike McQuaid
8dcadc54d2 python_dependency: no brewed python for bottles 2014-03-18 12:08:12 +00:00
Mike McQuaid
afec712a86 python_dependency: move bottle check into method. 2014-03-14 18:21:29 +00:00
Mike McQuaid
5b6d872459 python_dependency: always bottle with brew Python. 2014-03-13 10:05:20 +00:00
Mike McQuaid
c594053449 python_dependency: fixes, features, cleanup.
- PythonDependency now implies Python 2.7
- PythonDependency now uses brewed Python for bottling
- Use double-quotes everywhere

Closes Homebrew/homebrew#27112.
2014-03-12 13:56:41 +00:00
Mike McQuaid
f42f4e45c1 python_dependency: only set PYTHONPATH for system. 2014-02-10 18:49:26 +00:00
Mike McQuaid
ed53bb333b python_dependency: cleanup and fix build env.
* Only set PYTHONPATH for Python 2.
* Set the Python binary for superenv.

References Homebrew/homebrew#24842.
Closes Homebrew/homebrew#26197.
Closes Homebrew/homebrew#26216.
Closes Homebrew/homebrew#26218.
Closes Homebrew/homebrew#26228.
2014-01-29 17:49:57 +01:00
Mike McQuaid
689be66203 python_dependency: cleanup, fix satisfy.
Closes Homebrew/homebrew#26067.
2014-01-20 23:30:32 -08:00
Mike McQuaid
28143fb653 PythonDependency: massive refactoring.
Closes Homebrew/homebrew#24842.
2014-01-20 15:42:52 -08:00
Mike McQuaid
4c2e7b1659 Update docs, comment mxcl/homebrew refs. 2013-12-14 18:18:35 +00:00
MinRK
cb7f158663 safer check for sys.executable in sitecustomize.py
make sure it doesn't actually point to something else

since sitecustomize.py is put in a location found by pypy,
it breaks pypy by setting sys.executable to a path that is definitely wrong,
and may not even exist.

Closes Homebrew/homebrew#24581.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-11-25 20:48:41 -08:00
Jack Nagel
4943a81373 Python might not be up-to-date, so use opt_prefix
Fixes Homebrew/homebrew#24456.
2013-11-18 17:08:04 -06:00
Adam Vandenberg
7df136cd50 grammar edits 2013-11-13 20:23:27 -08:00
Mike McQuaid
bdbaf61304 python_dependency: fix includes location on 10.9.
Fixes Homebrew/homebrew#23837.
Fixes Homebrew/homebrew#23866.
2013-11-01 11:19:23 -07:00
Jack Nagel
3df31557c8 Avoid the need to defensively flatten tags array 2013-10-15 13:26:23 -05:00
Mike McQuaid
315c7a1212 Rename PythonInstalled to PythonDependency.
Make it more consistent with other requirements.
2013-09-14 12:21:49 +01:00
Samuel John
5515fda59a PythonInstalled: Allow formulae to set/append PYTHONPATH
Improve robustness of `PYTHONPATH` by first unsetting it (during
`satisfy`) so that the `PythonInstalled` can get the `python.version`
and so forth and then, after that, setting the `PYTHONPATH` to our
`global_site_packages`.
In the `python_helper` we append to the `PYTHONPATH` so if that var has
been set in a formula, it is respected.
Brew audit does no longer complain about setting the
`ENV['PYTHONPATH']`.
2013-09-03 10:46:06 +02:00
Samuel John
dbaac79f17 PythonInstalled: Adding a private_site_packages
that live in the `libexec` dir of a `Cellar`.
2013-09-03 10:41:54 +02:00
Samuel John
2e2e46b5b4 PythonInstalled, name includes modules
If `depends_on :python => ['modulename', :optional]` then the generated
option is now `--with-python-modulename`, so that it is possible to
actually make depending on python modules optional.
Further, `brew options` becomes more meaningful.
2013-08-27 09:48:12 +02:00
Samuel John
c4d8917f3f PythonInstalled: Unset PYTHONPATH for satisfied?
When a formula `depends_on :python` *and* `depends_on :python3`
the `modify_build_environment` method sets the PYTHONPATH
and the Python 3.x requirement then fails because it finds
the sitecustomize.py from Python 2.x in the PYTHONPATH.
2013-08-23 20:26:47 +02:00
Jack Nagel
4a3dac82ef Use ENV.prepend_path 2013-08-19 17:21:13 -05:00
Jack Nagel
ea8f51256b Use ENV.append_path 2013-08-19 17:21:13 -05:00
Jack Nagel
1ffd40821a which in requirements always uses ORIGINAL_PATHS now
Fixes Homebrew/homebrew#22002.
2013-08-19 13:54:09 -05:00
Amos Wenger
52ace99f14 Use File::PATH_SEPARATOR globally instead of ':'
On Unix, the path separator is ':', whereas on Windows,
it is ';'. This is the first of a series of patch to bring
macbrew's and winbrew's codebases closer together.

The main places the magic constant ':' was being used were:
  - the $PATH environment variable
  - CMAKE-related environment variables
  - pkg-config related environment variables

Closes Homebrew/homebrew#21921.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-08-19 13:35:44 -05:00
Samuel John
a7a35efff4 Unlinked brewed python -> use system python
Up to now a brewed Python, even if not linked, was preferred over
and external Python, so that you had to completely `brew rm python`
to have a formula link against external (mostly system) Python.

From now on it is okay to `brew unlink python`.
2013-08-15 02:03:55 +02:00
Jack Nagel
d77240a98c Iterate over these directly rather than mapping first 2013-08-14 13:02:50 -05:00
Jack Nagel
603d8f9d4d Return value of modify_build_environment is unimportant 2013-08-14 13:01:35 -05:00
Jack Nagel
f8c34b5dc1 Reverse conditional 2013-08-14 12:46:37 -05:00
Jack Nagel
3857f83e9c Collapse to one-liner 2013-08-14 12:46:12 -05:00
Jack Nagel
3d39a57118 No need to map, all? takes a block 2013-08-14 12:45:54 -05:00
Jack Nagel
4d2188cc90 Add missing false 2013-08-14 12:41:52 -05:00
Jack Nagel
5561d3d09c Remove stray space 2013-08-14 12:41:15 -05:00
Jack Nagel
23fbe23426 Allow specifying a custom PATH for which method
Closes Homebrew/homebrew#21794.
2013-08-10 19:01:50 -05:00
Samuel John
a73012def4 Python: Exit if PYTHONPATH is wrong
In our sitecustomize.py we instruct python to exit with an error message
if the PYTHONPATH is pointing to a wrong homebrew site-packages dir.
With wrong meaning another major python version.

If you set the PYTHONPATH to include
    $(brew --prefix)/lib/python2.7/site-packages
and start python3, it may pick up modules from there, wich can result
in errors for non pure python modules (such as PyQt).
2013-08-08 11:54:42 +02:00
Samuel John
c968f8302f For brewed python, make sure to unset the PYTHONPATH
during building of python software inside of a `python do … end` block.
2013-08-08 11:50:46 +02:00
Adam Vandenberg
73547fc750 Remove ARCHFLAGS fixme from Python dependency
This will be handled by env/superenv, not Python.
2013-08-03 10:28:57 -07:00
Jack Nagel
6090b9b2bf Silence warnings 2013-07-22 11:41:47 -05:00
Jack Nagel
e33cdb2f8b Fix python dependency hash equality
eql? should not depend on the hash value as hash values of uneql objects
can collide, but eql values may only collide for objects that are
actually eql.

Further, python dependencies are uniquely identified by the combination
of the name and imports attributes, so there is no reason to involved
the expensive binary computation for simple equality checks.

Fixes Homebrew/homebrew#20840.
2013-07-22 11:41:46 -05:00
Jack Nagel
b0138b9c9b Remove redundant reader method 2013-07-22 11:41:46 -05:00
Samuel John
1721cd9c08 Typo in comments 2013-07-17 09:52:30 +02:00
Samuel John
fb7f16fc94 Allow specifying version in depends_on :python
Note, in the explict form:

    PythonInstalled.new('2.7') => :recommended

the tag :recommended is ignored (not a limitation
of PythonInstalled itself). One solution was to write

    PythonInstalled.new('2.7', [:recommended])

but that is not as beautiful as we like it.

Therefore, now it is possible to:

    depends_on :python => ['2.7', :recommended]

Only the first tag is attempted to be parsed as
a version specifyer "x" or "x.y" or "x.y.z"...
2013-07-16 11:04:57 +02:00
Jack Nagel
52574240af Use old #eql? for python reqs, for now 2013-06-27 01:43:30 -05:00
Samuel John
215b584c3b depends_on :python => 'module' allow user packages
Some prefer to install with `--user` into their
home. For example to avoid `sudo` with system's
python. Now Homebrew can use those modules to
satisfy a python dependency on a certain module.
2013-06-19 12:18:48 +02:00
Samuel John
a3a0146d7c Python module deps, ext. python fix and 10.6 fix
* Fixes Homebrew/homebrew#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-18 10:30:17 +02:00
Jack Nagel
113125d394 Remove Version#to_a alias
Exposing this as "to_a" was a mistake, versions are not arrays and it
causes incorrect behavior when splatted or using Kernel#Array(). Use the
more correct name "tokens" instead.
2013-06-14 18:37:27 -05:00