Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With 270 days left until Python 2 EOL, it is time to upgrade default Python #1678

Merged
merged 4 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/travis/build/script/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Build
class Script
class Python < Script
DEFAULTS = {
python: '2.7',
python: '3.6',
virtualenv: { system_site_packages: false }
}

Expand Down
16 changes: 8 additions & 8 deletions spec/build/script/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
end

it 'sets TRAVIS_PYTHON_VERSION' do
should include_sexp [:export, ['TRAVIS_PYTHON_VERSION', '2.7']]
should include_sexp [:export, ['TRAVIS_PYTHON_VERSION', '3.6']]
end

it 'sets up the python version (pypy)' do
Expand Down Expand Up @@ -56,8 +56,8 @@
should include_sexp [:cmd, 'source ~/virtualenv/pypy3/bin/activate', assert: true, echo: true, timing: true]
end

it 'sets up the python version (2.7)' do
should include_sexp [:cmd, 'source ~/virtualenv/python2.7/bin/activate', assert: true, echo: true, timing: true]
it 'sets up the python version (3.6)' do
should include_sexp [:cmd, 'source ~/virtualenv/python3.6/bin/activate', assert: true, echo: true, timing: true]
end

context "with minimal config" do
Expand Down Expand Up @@ -92,9 +92,9 @@


context "when python version is given as an array" do
before { data[:config][:python] = %w(2.7) }
it 'sets up the python version (2.7)' do
should include_sexp [:cmd, 'source ~/virtualenv/python2.7/bin/activate', assert: true, echo: true, timing: true]
before { data[:config][:python] = %w(3.6) }
it 'sets up the python version (3.6)' do
should include_sexp [:cmd, 'source ~/virtualenv/python3.6/bin/activate', assert: true, echo: true, timing: true]
end
end

Expand All @@ -105,7 +105,7 @@
end

context 'when specified Python is not pre-installed' do
let(:version) { '2.7' }
let(:version) { '3.6' }
let(:sexp) { sexp_find(subject, [:if, "! -f ~/virtualenv/python#{version}/bin/activate"]) }

it "downloads archive" do
Expand Down Expand Up @@ -180,6 +180,6 @@

it 'sets up python with system site packages enabled' do
data[:config][:virtualenv] = { 'system_site_packages' => true }
should include_sexp [:cmd, 'source ~/virtualenv/python2.7_with_system_site_packages/bin/activate', assert: true, echo: true, timing: true]
should include_sexp [:cmd, 'source ~/virtualenv/python3.6_with_system_site_packages/bin/activate', assert: true, echo: true, timing: true]
end
end