From ec1dd90b462b1edfacf25a0091f89a099596cbda Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Jun 2014 19:24:13 -0700 Subject: [PATCH 01/10] Bump default version Closes #106. --- attributes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index d0a32c4..e78d47b 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -34,7 +34,7 @@ default['python']['binary'] = "#{node['python']['prefix_dir']}/bin/python" default['python']['url'] = 'http://www.python.org/ftp/python' -default['python']['version'] = '2.7.5' +default['python']['version'] = '2.7.7' default['python']['checksum'] = '3b477554864e616a041ee4d7cef9849751770bc7c39adaf78a94ea145c488059' default['python']['configure_options'] = %W{--prefix=#{python['prefix_dir']}} default['python']['make_options'] = %W{install} From f6d0837197d09eeed799073758d7c7a341512877 Mon Sep 17 00:00:00 2001 From: Mal Graty Date: Sat, 1 Mar 2014 12:39:05 +0000 Subject: [PATCH 02/10] Fix version detection (setuptools and distribute) The versions of `distribute`, `pip`, `setuptools` and `wsgiref` are excluded from the output of `pip freeze`, however they do show up in the output from `pip list`. This allows us to use a more general implentation of parsing the output from `pip list` to get the current version of all distributions. Also removes a dependency on `grep`. Distributions excluded from `pip freeze`: /pypa/pip/blob/2ad8888901c041b8f9aacebb3a16d55bf631e867/pip/util.py#L372 --- providers/pip.rb | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/providers/pip.rb b/providers/pip.rb index 328bbf5..bdd8142 100644 --- a/providers/pip.rb +++ b/providers/pip.rb @@ -106,17 +106,13 @@ def load_current_resource def current_installed_version @current_installed_version ||= begin - delimeter = /==/ - - normalized_package_name = new_resource.package_name.gsub('_', '-') - version_check_cmd = "#{which_pip(new_resource)} freeze | grep -i '^#{normalized_package_name}=='" - # incase you upgrade pip with pip! - if new_resource.package_name.eql?('pip') - delimeter = /\s/ - version_check_cmd = "#{which_pip(@new_resource)} --version" + out = nil + package_name = new_resource.package_name.gsub('_', '-') + pattern = Regexp.new("^#{Regexp.escape(package_name)} \\(([^)]+)\\)$", true) + shell_out("#{which_pip(new_resource)} list").stdout.lines.find do |line| + out = pattern.match(line) end - result = shell_out(version_check_cmd) - (result.exitstatus == 0) ? result.stdout.split(delimeter)[1].strip : nil + out.nil? ? nil : out[1] end end From d13e97ca2b7bbc887a976a36981adba501fb215d Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 19 Aug 2014 14:09:15 -0700 Subject: [PATCH 03/10] Using the package resource isn't supported. --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index dd0b046..6397114 100644 --- a/README.md +++ b/README.md @@ -77,13 +77,6 @@ python_pip "django" do end ``` -```ruby -# use this provider with the core package resource -package "django" do - provider Chef::Provider::PythonPip -end -``` - ### python_virtualenv [`virtualenv`](http://pypi.python.org/pypi/virtualenv) is a great tool that creates isolated python environments. Think of it as RVM without all those hipsters and tight jeans. From c3ed4e2831d4caa0fa84b001f571a7f574f75cf0 Mon Sep 17 00:00:00 2001 From: Nathan Hernandez Date: Sat, 20 Sep 2014 23:27:04 -0400 Subject: [PATCH 04/10] Update README.md Fixed typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6397114..ee71683 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ python_pip "gunicorn" # target a virtualenv python_pip "gunicorn" do - virtualenv "/home/ubunut/my_ve" + virtualenv "/home/ubuntu/my_ve" end ``` From 9c6d0aae483ce579847302e9080b76b015a99c30 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Mon, 22 Sep 2014 12:57:32 -0700 Subject: [PATCH 05/10] @ranjib pointed out I hard-wired to upgrade Use the correct semantics of upgrade unless version locked. --- recipes/pip.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/pip.rb b/recipes/pip.rb index 17110fa..77f0440 100644 --- a/recipes/pip.rb +++ b/recipes/pip.rb @@ -48,6 +48,6 @@ end python_pip 'setuptools' do - action :upgrade + action :upgrade unless node['python']['setuptools_version'] version node['python']['setuptools_version'] end From 234852013622673c106a21c0abaa291280e46c4e Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Mon, 22 Sep 2014 13:10:51 -0700 Subject: [PATCH 06/10] Revert "@ranjib pointed out I hard-wired to upgrade" This reverts commit 9c6d0aae483ce579847302e9080b76b015a99c30. --- recipes/pip.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/pip.rb b/recipes/pip.rb index 77f0440..17110fa 100644 --- a/recipes/pip.rb +++ b/recipes/pip.rb @@ -48,6 +48,6 @@ end python_pip 'setuptools' do - action :upgrade unless node['python']['setuptools_version'] + action :upgrade version node['python']['setuptools_version'] end From a553743ce4d77735229b56aad226703c1ce8fbe8 Mon Sep 17 00:00:00 2001 From: chantra Date: Fri, 12 Dec 2014 02:00:41 -0800 Subject: [PATCH 07/10] fix python install from source to work with chef 12 Also update the test suite to reflect the right python version --- attributes/default.rb | 4 ++-- test/integration/source/bats/source.bats | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index e78d47b..39bf96c 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -35,8 +35,8 @@ default['python']['url'] = 'http://www.python.org/ftp/python' default['python']['version'] = '2.7.7' -default['python']['checksum'] = '3b477554864e616a041ee4d7cef9849751770bc7c39adaf78a94ea145c488059' -default['python']['configure_options'] = %W{--prefix=#{python['prefix_dir']}} +default['python']['checksum'] = '7f49c0a6705ad89d925181e27d0aaa025ee4731ce0de64776c722216c3e66c42' +default['python']['configure_options'] = %W{--prefix=#{node['python']['prefix_dir']}} default['python']['make_options'] = %W{install} default['python']['pip_location'] = "#{node['python']['prefix_dir']}/bin/pip" diff --git a/test/integration/source/bats/source.bats b/test/integration/source/bats/source.bats index ae1fe98..dd35c75 100644 --- a/test/integration/source/bats/source.bats +++ b/test/integration/source/bats/source.bats @@ -4,6 +4,6 @@ [ -x "/usr/local/bin/python" ] } -@test "python should be version 2.7.5" { - /usr/local/bin/python -c 'import sys; print sys.version' | grep '2.7.5' +@test "python should be version 2.7.7" { + /usr/local/bin/python -c 'import sys; print sys.version' | grep '2.7.7' } From 8ae142f23bccee1b0a73f20bccc76bd375d86591 Mon Sep 17 00:00:00 2001 From: Sean OMeara Date: Wed, 18 Feb 2015 16:14:23 -0500 Subject: [PATCH 08/10] opscode2chef --- Berksfile | 2 +- CHANGELOG.md | 12 ++++++------ README.md | 4 ++-- attributes/default.rb | 4 ++-- providers/pip.rb | 4 ++-- providers/virtualenv.rb | 4 ++-- recipes/default.rb | 4 ++-- recipes/package.rb | 4 ++-- recipes/pip.rb | 4 ++-- recipes/source.rb | 4 ++-- recipes/virtualenv.rb | 4 ++-- resources/pip.rb | 4 ++-- resources/virtualenv.rb | 4 ++-- 13 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Berksfile b/Berksfile index f795efe..f59fa9c 100644 --- a/Berksfile +++ b/Berksfile @@ -1,4 +1,4 @@ -site :opscode +site 'https://supermarket.chef.io' metadata diff --git a/CHANGELOG.md b/CHANGELOG.md index 83d283c..a6df03d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,23 +22,23 @@ v1.4.4 v1.4.2 ------ ### Bug -- **[COOK-3796](https://tickets.opscode.com/browse/COOK-3796)** - Virtualenv can fail +- **[COOK-3796](https://tickets.chef.io/browse/COOK-3796)** - Virtualenv can fail ### Improvement -- **[COOK-3719](https://tickets.opscode.com/browse/COOK-3719)** - Allow alternative install python, update pip location -- **[COOK-3703](https://tickets.opscode.com/browse/COOK-3703)** - Create symlink for source built python [python3 support] +- **[COOK-3719](https://tickets.chef.io/browse/COOK-3719)** - Allow alternative install python, update pip location +- **[COOK-3703](https://tickets.chef.io/browse/COOK-3703)** - Create symlink for source built python [python3 support] v1.4.0 ------ ### New Feature -- **[COOK-3248](https://tickets.opscode.com/browse/COOK-3248)** - Improve testing suite +- **[COOK-3248](https://tickets.chef.io/browse/COOK-3248)** - Improve testing suite ### Improvement -- **[COOK-3125](https://tickets.opscode.com/browse/COOK-3125)** - Don't use `normal` attributes +- **[COOK-3125](https://tickets.chef.io/browse/COOK-3125)** - Don't use `normal` attributes ### Bug -- **[COOK-3084](https://tickets.opscode.com/browse/COOK-3084)** - Fix `python_virtualenv` on EL 5 +- **[COOK-3084](https://tickets.chef.io/browse/COOK-3084)** - Fix `python_virtualenv` on EL 5 v1.3.6 ------ diff --git a/README.md b/README.md index ee71683..440c835 100644 --- a/README.md +++ b/README.md @@ -144,10 +144,10 @@ Installs virtualenv using the `python_pip` resource. License & Authors ----------------- -- Author:: Seth Chisamore () +- Author:: Seth Chisamore () ```text -Copyright:: 2011, Opscode, Inc +Copyright:: 2011, Chef Software, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/attributes/default.rb b/attributes/default.rb index 39bf96c..699df21 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,9 +1,9 @@ # -# Author:: Seth Chisamore () +# Author:: Seth Chisamore () # Cookbook Name:: python # Attribute:: default # -# Copyright 2011, Opscode, Inc. +# Copyright 2011, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/providers/pip.rb b/providers/pip.rb index bdd8142..bc0d559 100644 --- a/providers/pip.rb +++ b/providers/pip.rb @@ -1,9 +1,9 @@ # -# Author:: Seth Chisamore +# Author:: Seth Chisamore # Cookbook Name:: python # Provider:: pip # -# Copyright:: 2011, Opscode, Inc +# Copyright:: 2011, Chef Software, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/providers/virtualenv.rb b/providers/virtualenv.rb index 904c1b4..a04147b 100644 --- a/providers/virtualenv.rb +++ b/providers/virtualenv.rb @@ -1,9 +1,9 @@ # -# Author:: Seth Chisamore +# Author:: Seth Chisamore # Cookbook Name:: python # Provider:: virtualenv # -# Copyright:: 2011, Opscode, Inc +# Copyright:: 2011, Chef Software, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/default.rb b/recipes/default.rb index ee9afe8..725b6cb 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,9 +1,9 @@ # -# Author:: Seth Chisamore +# Author:: Seth Chisamore # Cookbook Name:: python # Recipe:: default # -# Copyright 2011, Opscode, Inc. +# Copyright 2011, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/package.rb b/recipes/package.rb index 115b53b..38ea3b3 100644 --- a/recipes/package.rb +++ b/recipes/package.rb @@ -1,9 +1,9 @@ # -# Author:: Seth Chisamore +# Author:: Seth Chisamore # Cookbook Name:: python # Recipe:: package # -# Copyright 2011, Opscode, Inc. +# Copyright 2011, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/pip.rb b/recipes/pip.rb index 17110fa..ad02ab7 100644 --- a/recipes/pip.rb +++ b/recipes/pip.rb @@ -1,9 +1,9 @@ # -# Author:: Seth Chisamore +# Author:: Seth Chisamore # Cookbook Name:: python # Recipe:: pip # -# Copyright 2011, Opscode, Inc. +# Copyright 2011, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/source.rb b/recipes/source.rb index ac8ed86..c6256f7 100644 --- a/recipes/source.rb +++ b/recipes/source.rb @@ -1,9 +1,9 @@ # -# Author:: Seth Chisamore +# Author:: Seth Chisamore # Cookbook Name:: python # Recipe:: source # -# Copyright 2011, Opscode, Inc. +# Copyright 2011, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/virtualenv.rb b/recipes/virtualenv.rb index 8098492..e0626a4 100644 --- a/recipes/virtualenv.rb +++ b/recipes/virtualenv.rb @@ -1,9 +1,9 @@ # -# Author:: Seth Chisamore +# Author:: Seth Chisamore # Cookbook Name:: python # Recipe:: virtualenv # -# Copyright 2011, Opscode, Inc. +# Copyright 2011, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/resources/pip.rb b/resources/pip.rb index 1475b3a..2b9f13e 100644 --- a/resources/pip.rb +++ b/resources/pip.rb @@ -1,9 +1,9 @@ # -# Author:: Seth Chisamore +# Author:: Seth Chisamore # Cookbook Name:: python # Resource:: pip # -# Copyright:: 2011, Opscode, Inc +# Copyright:: 2011, Chef Software, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/resources/virtualenv.rb b/resources/virtualenv.rb index e9f7327..8de75be 100644 --- a/resources/virtualenv.rb +++ b/resources/virtualenv.rb @@ -1,9 +1,9 @@ # -# Author:: Seth Chisamore +# Author:: Seth Chisamore # Cookbook Name:: python # Resource:: virtualenv # -# Copyright:: 2011, Opscode, Inc +# Copyright:: 2011, Chef Software, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From d843d80e0e7c2bfde2d3c2a376877ea847660297 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Wed, 15 Jul 2015 10:28:16 -0700 Subject: [PATCH 09/10] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 440c835..3555324 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ python Cookbook Installs and configures Python. Also includes LWRPs for managing python packages with `pip` and `virtualenv` isolated Python environments. +## **THIS COOKBOOK IS IN LIMBO** + +Development on a new replacement is happening at [poise/poise-python](https://github.com/poise/poise-python). When that cookbook is complete, this cookbook may be stripped and turned in to compat wrapper for it if possible, or it may be removed entirely. Requirements ------------ From 711e4d98c25643be2df5afaf3cfc2e811eaee18f Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Mon, 24 Aug 2015 16:46:33 -0700 Subject: [PATCH 10/10] Deprecated. [ci skip] --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3555324..9087145 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,14 @@ python Cookbook Installs and configures Python. Also includes LWRPs for managing python packages with `pip` and `virtualenv` isolated Python environments. -## **THIS COOKBOOK IS IN LIMBO** +## **THIS COOKBOOK IS DEPRECATED** -Development on a new replacement is happening at [poise/poise-python](https://github.com/poise/poise-python). When that cookbook is complete, this cookbook may be stripped and turned in to compat wrapper for it if possible, or it may be removed entirely. +[Poise-python](https://github.com/poise/poise-python) is a vastly better cookbook +for managing Python-related things. This cookbook will remain for compatibility +but any future release will only be to gut it and turn it into a wrapper for +`poise-python`. + +## **I REPEAT, THIS COOKBOOK IS DEPRECATED** Requirements ------------