Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

New formula: Ansible #21602

Closed
wants to merge 2 commits into from
Closed

New formula: Ansible #21602

wants to merge 2 commits into from

Conversation

ches
Copy link
Contributor

@ches ches commented Aug 2, 2013

Configuration management and IT orchestration tool.

This is a Python package that is published to PyPI, but its installation is broken with Homebrew pip because of hardcoded paths. In discussions about fixing standard Python installation mechanisms, the maintainer has stated pretty resolutely that he wants it to be considered an application and not a Python library/package. It is also in MacPorts.

I first did this with a less brute-force approach that requires a two-line patch, but it leaves the user to add a config file to change an essential default path, and it leaves incorrect paths indicated in man pages, etc. So I've ended up doing exactly what MacPorts does.

/cc @mpdehaan

Configuration management and IT orchestration tool.
@mpdehaan
Copy link

mpdehaan commented Aug 2, 2013

Ansible project lead here :)

Hi, glad to see a pull request to add this to homebrew!

Looks good.

A few comments:

Think you MAY want the release tarball instead -
ansible-1.2.2.tar.gzhttp://ansibleworks.com/releases/ansible-1.2.2.tar.gz
?
This comes from make sdist.

Also can this maybe set up a proper ansible.cfg to pick the install path so
the user does not have to specify -M each time (or at least output a
message to configure this?)

  • s.gsub! %r{/usr/share/ansible}, "#{share}/ansible", false

Might avoid user Q&A about where to find the module paths.

Thanks!

On Thu, Aug 1, 2013 at 9:22 PM, Ches Martin notifications@github.comwrote:

Configuration management and IT orchestration tool.

This is a Python package that is published to PyPI, but its installation
is broken with Homebrew pip because of hardcoded paths. In discussions
about fixing standard Python installation mechanisms, the maintainer has
stated pretty resolutelyhttps://groups.google.com/forum/#!topic/ansible-project/eEZ968npkDw/discussionthat he wants it to be considered an application and not a Python
library/package. It is also in MacPorts.

I first did this with a less brute-force approach that requires a two-line
patch, but it leaves the user to add a config file to change an essential
default path, and it leaves incorrect paths indicated in man pages, etc. So
I've ended up doing exactly what MacPorts doeshttps://trac.macports.org/browser/trunk/dports/sysutils/ansible/Portfile
.

/cc @mpdehaan https://github.com/mpdehaan

You can merge this Pull Request by running

git pull https://github.com/ches/homebrew ansible

Or view, comment on, or merge it at:

#21602
Commit Summary

  • New formula: Ansible

File Changes

Patch Links:

@MikeMcQuaid
Copy link
Member

This was rejected in Homebrew previously. See the discussions in #20554 and #21585. As we have the project lead here: for this to be in Homebrew it needs to be installable in a form similar to something like ack i.e. no interaction with pip (or, in ack's case, cpan) should be required for it to be installed with Homebrew. Whether the Python way of doing this is vendored libraries I'm not sure. Will leave this open for discussion.

@ches
Copy link
Contributor Author

ches commented Aug 2, 2013

@mpdehaan Ah, I didn't find an official release tarball linked on the site, thanks, I'll update this.

About the module path though, it works out of the box since it gsubs everything, including constants.py, so effectively Ansible on Homebrew will look to /usr/local/share/ansible by default (or a user's chosen Homebrew prefix). That's why I went this route instead of a simpler patch as mentioned. And again this is exactly what MacPorts has done.

If you think there's otherwise anything that should be mentioned in a post-install message though, you're the man to say it 😄

@ches
Copy link
Contributor Author

ches commented Aug 2, 2013

@MikeMcQuaid Sorry about the dupe, I think I was searching with closed issues filtered 😩

@mpdehaan
Copy link

mpdehaan commented Aug 2, 2013

@ches, ok good to know.

@MikeMcQuaid

Vendoring is kind of unacceptable to me, especially for a general perspective on security and package management. In general, the Python community is a lot less open to vendoring than Ruby land, but there's also a lot more focus on API compatibility and interfaces change a lot less.

It seems if you had recipes for paramiko and PyYAML and Jinja2 that had similar, you would have it solved?

It seems to be an of an issue of "don't cross the package manager streams and I need to pin versions", which seems to be a reasonable goal.

I'm not really sure how else you would handle dependencies from an upstream source, but vendoring seems to be a no-go.

@MikeMcQuaid
Copy link
Member

If there's vendoring within the formula that's potentially fine for this use-case (but other maintainers would need to agree). I do get that you have other dependencies you'd rather not vendor but unfortunately the harder these things are to package/distribute the less likely they are to be treated as "applications" that exist outside of a particular language ecosystem. Incidentally when I was referring to vendoring previously that doesn't necessarily have to mean "put these libraries in your source tree" but could mean "optionally install these libraries at ansible installation time".

@ches
Copy link
Contributor Author

ches commented Aug 2, 2013

As an aside, FWIW it's well-known to me that a package available from PyPI, Rubygems, etc. won't be accepted (though I thought exceptions might be up for discussion if, like this one, they aren't Homebrew-compatible), but it was not clear to me that one requiring pip dependencies would be rejected -- the docs illustrate DSL support for declaring Python module dependencies!

IMO some clarification should be noted on that wiki page about the dependency policy. If it's there, I missed it.

@adamv
Copy link
Contributor

adamv commented Aug 2, 2013

It seems if you had recipes for paramiko and PyYAML and Jinja2 that had similar, you would have it solved?

We're not importing "all of PyPy" here. That's an overgeneralization, of course, but we're not going to start pulling in Python packages en masse.

@singingwolfboy
Copy link
Member

For the time being, I've set up an ansible tap based on @ches's formula -- which seems to work perfectly. Thanks!

If/when ansible gets into Homebrew proper, I'd be perfectly happy to take down my tap and redirect users to the official Homebrew-packaged version of ansible. This is just meant to be a stop-gap solution.

@mistydemeo
Copy link
Member

It seems if you had recipes for paramiko and PyYAML and Jinja2 that had similar, you would have it solved?

To expand on Adam's answer a bit more...

We do package some standalone CLI tools written in Python even if they're also on PyPi, but the deeper into PyPi dependencies things get, the less likely we are to package them. We don't repackage general Python libraries unless there's a really compelling reason to make an exception.

Our thinking is: PyPi already handles Python dependencies, etc. We don't want to duplicate that work. If there are multiple Python dependencies for a given package, which the user will need pip to install, then that's a sign that there's less value in Homebrew packaging it unless there are very specific reasons why that would be better.

In this case, the easiest route to packaging Ansible would be if a standalone tarball was available that packaged all of the required dependencies with it. The authors of, for example, gist (Ruby) and ack (Perl) do this to make packaging easier without requiring interacting with those languages' package managers, and to help their goals of making the software usable as a standalone CLI tool independent of that language's package management ecosystem. If there isn't interest in doing that, then maybe Ansible isn't a good fit for Homebrew (or vice versa).

@singingwolfboy Thanks for setting that up!

@mpdehaan
Copy link

mpdehaan commented Aug 7, 2013

"In this case, the easiest route to packaging Ansible would be if a
standalone tarball was available that packaged all of the required
dependencies with it. "

We believe vendoring is a very bad practice for software keeping up to date
so I do not see this happening.

On Wed, Aug 7, 2013 at 3:16 PM, Misty De Meo notifications@github.comwrote:

It seems if you had recipes for paramiko and PyYAML and Jinja2 that had
similar, you would have it solved?

To expand on Adam's answer a bit more...

We do package some standalone CLI tools written in Python even if
they're also on PyPi, but the deeper into PyPi dependencies things get, the
less likely we are to package them. We don't repackage general Python
libraries unless there's a really compelling reason to make an
exception.

Our thinking is: PyPi already handles Python dependencies, etc. We don't
want to duplicate that work. If there are multiple Python dependencies for
a given package, which the user will need pip to install, then that's a
sign that there's less value in Homebrew packaging it unless there are very
specific reasons why that would be better.

In this case, the easiest route to packaging Ansible would be if a
standalone tarball was available that packaged all of the required
dependencies with it. The authors of, for example, gist (Ruby) and ack
(Perl) do this to make packaging easier without requiring interacting with
those languages' package managers, and to help their goals of making the
software usable as a standalone CLI tool independent of that language's
package management ecosystem. If there isn't interest in doing that, then
maybe Ansible isn't a good fit for Homebrew (or vice versa).

@singingwolfboy https://github.com/singingwolfboy Thanks for setting
that up!


Reply to this email directly or view it on GitHubhttps://github.com//pull/21602#issuecomment-22276283
.

@MikeMcQuaid
Copy link
Member

@mpdehaan As mentioned previously, you only have to vendor within the OSX formula. Also, vendoring tends to be the OSX way of doing things; it is how all .app bundles are managed, it's how Railsland does things and it's how the other utilities that get included in Homebrew do things. Sadly it sounds like we're at a blocking point here where this isn't going to get resolved so closing (but will feel free to reopen or review a approach that doesn't rely on the user using pip to install dependencies).

@MikeMcQuaid MikeMcQuaid closed this Aug 7, 2013
@MikeMcQuaid MikeMcQuaid mentioned this pull request Aug 17, 2013
@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants