Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit da8476f

Browse files
AC-9419 - Cleaning up code for fixing the issue with Chef/python3.6 not installing correctly.
1 parent 0be4a07 commit da8476f

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

recipes/pip.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
not_if { ::File.exists?(pip_binary) }
4040
end
4141

42+
#because the latest version of the get-pip.py script requires >=python3.7, this is now hardcoded to the 3.6 version as recommended by pypa.io
4243
execute "install-pip" do
4344
cwd Chef::Config[:file_cache_path]
4445
command <<-EOF

recipes/python.rb

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,25 @@
1-
# apt_repository "python3" do
2-
# uri 'http://ppa.launchpad.net/deadsnakes/ppa/ubuntu'
3-
# components ['trusty main']
4-
# end
5-
1+
#Add in the deadsnakes ppa repository to app
2+
#note the fkrull/deadsnakes url is correct for Ubuntu 14.04. For higher versions of Ubuntu (>16.0), this is instead "ppa:deadsnakes/ppa"
63
bash 'add deadsnakes ppa' do
74
code <<-EOH
85
sudo add-apt-repository ppa:fkrull/deadsnakes -y;
96
EOH
107
flags "-x"
118
end
129

10+
#Update the apt repository list
1311
bash 'update apt-get repos' do
1412
code <<-EOH
1513
sudo apt update;
1614
EOH
1715
flags "-x"
1816
end
1917

18+
#install python3.6 and python3.6-dev via apt
19+
#note that this is using the fkrull/deadsnakes repository listed above
2020
bash 'install python3.6' do
2121
code <<-EOH
2222
sudo apt install python3.6 python3.6-dev -y;
2323
EOH
2424
flags "-x"
25-
end
26-
27-
# execute "update" do
28-
# command 'sudo apt-get update'
29-
# end
30-
31-
# package 'python3.6' do
32-
# options '--force-yes'
33-
# action :install
34-
# end
35-
36-
# package 'python3.6-dev' do
37-
# options '--force-yes'
38-
# action :install
39-
# end
40-
41-
# alternatives 'python-set-version-3' do
42-
# link_name 'python3'
43-
# path '/opt/python/3.6/bin/python3.6'
44-
# priority 100
45-
# action :install
46-
# end
25+
end

0 commit comments

Comments
 (0)