Skip to content

Commit

Permalink
Merge pull request #13 from thmttch/conflict-with-python-cookbook
Browse files Browse the repository at this point in the history
Conflict with python cookbook
  • Loading branch information
thmttch committed Sep 7, 2014
2 parents a5f6269 + 5c0607d commit 7624c5f
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## 0.4.4

Backwards-compatible fix for issue when using both the python cookbook and this
one. Issue: https://github.com/thmttch/chef-continuum-anaconda/issues/12

## 0.4.3

Unintended release, thanks to Chef Supermarket's crappiness.

## 0.4.2

New resource 'anaconda_nbservice', for running an IPython notebook server.
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ gem 'chefspec'
gem 'kitchen-vagrant'

gem 'foodcritic'

gem 'chef-rewind'
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ To use it in a cookbook:
include_recipe 'anaconda::default'
```

## Warning! If you're also using the [python](https://github.com/poise/python) cookbook...

You MUST include `recipe[anaconda::python_workaround]`, otherwise subsequent
chef runs will fail. See [the
issue](https://github.com/thmttch/chef-continuum-anaconda/issues/12) for
details.

## Usage, recipes, attributes, and resources

The main recipe is `anaconda::default`. Include it in your runlist, and it will
Expand Down
22 changes: 22 additions & 0 deletions recipes/python_workaround.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Cookbook Name:: anaconda
# Recipe:: python_workaround
#
# Copyright (C) 2014 Matt Chu
#
# All rights reserved - Do Not Redistribute
#

# https://github.com/thmttch/chef-continuum-anaconda/issues/12

# hack: the standard python cookbook gets confused and tries to upgrade
# setuptools since it can't find it (TODO actually, i think because it's not
# the latest version); this will break the chef run.
Chef::Log.warn 'Applying the python workaround: https://github.com/thmttch/chef-continuum-anaconda/issues/12'

chef_gem 'chef-rewind'
require 'chef/rewind'

unwind 'python_pip[setuptools]' do
ignore_failure true
end
9 changes: 9 additions & 0 deletions script/release-to-supermarket.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

echo "Don't know how to automate this (creds), so here are the instructions:"
echo ""

echo 'knife cookbook site share anaconda "Programming Languages" --cookbook-path PATH --config KNIFE.RB'
echo ""

echo "https://docs.getchef.com/knife_cookbook_site.html#share"
9 changes: 9 additions & 0 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@
expect(chef_run).to create_remote_file_if_missing(installer_path)
end

it 'has a workaround for python: https://github.com/thmttch/chef-continuum-anaconda/issues/12' do
pending('How do you include a cookbook for testing purposes only?')

chef_run.converge('python::default')
chef_run.converge(described_recipe)

# TODO test that python_pip[setuptools] is removed/disabled
end

end
end

Expand Down

0 comments on commit 7624c5f

Please sign in to comment.