Skip to content

Commit 4241425

Browse files
committed
[build] Adapting Rakefile to bump nightly for Python
1 parent 32cf182 commit 4241425

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

Rakefile

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,13 @@ namespace :py do
622622
desc 'Update Python version'
623623
task :version, [:version] do |_task, arguments|
624624
old_version = python_version
625-
new_version = updated_version(old_version, arguments[:version])
625+
new_version = nil
626+
if arguments[:version] === 'nightly' && old_version.include?('nightly')
627+
new_version = old_version + ".#{Time.now.strftime("%Y%m%d")}"
628+
else
629+
new_version = updated_version(old_version, arguments[:version])
630+
new_version += '.nightly' unless old_version.include?('nightly')
631+
end
626632

627633
['py/setup.py',
628634
'py/BUILD.bazel',
@@ -639,7 +645,7 @@ namespace :py do
639645
text = File.read('py/docs/source/conf.py').gsub(old_short_version, new_short_version)
640646
File.open('py/docs/source/conf.py', "w") { |f| f.puts text }
641647

642-
Rake::Task['py:changelog'].invoke
648+
Rake::Task['py:changelog'].invoke unless new_version.include?('nightly')
643649
end
644650

645651
desc 'Update Python Syntax'
@@ -1016,12 +1022,17 @@ namespace :all do
10161022

10171023
puts "Committing nightly version updates"
10181024
commit!('update versions to nightly', ['java/version.bzl',
1019-
'rb/lib/selenium/webdriver/version.rb',
1020-
'rb/Gemfile.lock',
1021-
'rust/BUILD.bazel',
1022-
'rust/Cargo.Bazel.lock',
1023-
'rust/Cargo.lock',
1024-
'rust/Cargo.toml'])
1025+
'rb/lib/selenium/webdriver/version.rb',
1026+
'rb/Gemfile.lock',
1027+
'py/setup.py',
1028+
'py/BUILD.bazel',
1029+
'py/selenium/__init__.py',
1030+
'py/selenium/webdriver/__init__.py',
1031+
'py/docs/source/conf.py',
1032+
'rust/BUILD.bazel',
1033+
'rust/Cargo.Bazel.lock',
1034+
'rust/Cargo.lock',
1035+
'rust/Cargo.toml'])
10251036

10261037
print 'Do you want to push the committed changes? (Y/n): '
10271038
response = STDIN.gets.chomp.downcase
@@ -1087,6 +1098,7 @@ namespace :all do
10871098
Rake::Task['java:version'].invoke
10881099
Rake::Task['rb:version'].invoke
10891100
Rake::Task['rust:version'].invoke
1101+
Rake::Task['py:version'].invoke
10901102
else
10911103
Rake::Task['java:version'].invoke(version)
10921104
Rake::Task['rb:version'].invoke(version)

0 commit comments

Comments
 (0)