From 6f68806f91fd51b5fb79012d894c0b5e7bbd611f Mon Sep 17 00:00:00 2001 From: Ryan Sheppard Date: Mon, 13 Jan 2020 18:24:16 -0500 Subject: [PATCH 1/3] override default setuptools version --- attributes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index 699df21..5e31b05 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -41,5 +41,5 @@ default['python']['pip_location'] = "#{node['python']['prefix_dir']}/bin/pip" default['python']['virtualenv_location'] = "#{node['python']['prefix_dir']}/bin/virtualenv" -default['python']['setuptools_version'] = nil # defaults to latest +default['python']['setuptools_version'] = "44.0.0" default['python']['virtualenv_version'] = nil From 822a9ff0f71f232b129191dd4ca51fcdca241244 Mon Sep 17 00:00:00 2001 From: Ryan Sheppard Date: Tue, 21 Jan 2020 10:13:09 -0500 Subject: [PATCH 2/3] install pip via apt instead --- recipes/pip.rb | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/recipes/pip.rb b/recipes/pip.rb index ad02ab7..3ea5fb4 100644 --- a/recipes/pip.rb +++ b/recipes/pip.rb @@ -23,29 +23,7 @@ # redhat/package: /usr/bin/pip (sha a8a3a3) # omnibus/source: /opt/local/bin/pip (sha 29ce9874) -if node['python']['install_method'] == 'source' - pip_binary = "#{node['python']['prefix_dir']}/bin/pip" -elsif platform_family?("rhel", "fedora") - pip_binary = "/usr/bin/pip" -elsif platform_family?("smartos") - pip_binary = "/opt/local/bin/pip" -else - pip_binary = "/usr/local/bin/pip" -end - -cookbook_file "#{Chef::Config[:file_cache_path]}/get-pip.py" do - source 'get-pip.py' - mode "0644" - not_if { ::File.exists?(pip_binary) } -end - -execute "install-pip" do - cwd Chef::Config[:file_cache_path] - command <<-EOF - #{node['python']['binary']} get-pip.py - EOF - not_if { ::File.exists?(pip_binary) } -end +package 'python-pip' python_pip 'setuptools' do action :upgrade From 58b6ca193c7138699d837447478970a9c841b2ae Mon Sep 17 00:00:00 2001 From: Ryan Sheppard Date: Tue, 28 Apr 2020 15:57:36 -0400 Subject: [PATCH 3/3] locking the virtualenv version --- attributes/default.rb | 2 +- recipes/virtualenv.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 5e31b05..65a8318 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -42,4 +42,4 @@ default['python']['pip_location'] = "#{node['python']['prefix_dir']}/bin/pip" default['python']['virtualenv_location'] = "#{node['python']['prefix_dir']}/bin/virtualenv" default['python']['setuptools_version'] = "44.0.0" -default['python']['virtualenv_version'] = nil +default['python']['virtualenv_version'] = "16.7.9" diff --git a/recipes/virtualenv.rb b/recipes/virtualenv.rb index e0626a4..d2a6775 100644 --- a/recipes/virtualenv.rb +++ b/recipes/virtualenv.rb @@ -21,6 +21,6 @@ include_recipe "python::pip" python_pip "virtualenv" do - action :upgrade + action :install version node['python']['virtualenv_version'] end