Skip to content

Commit d073e59

Browse files
committed
[py] Fix how version numbers are handled
1 parent d266777 commit d073e59

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

Rakefile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,22 @@ namespace :py do
624624
bump_nightly = arguments[:version] === 'nightly'
625625
old_version = python_version
626626
new_version = nil
627-
if bump_nightly && old_version.include?('nightly')
628-
new_version = old_version.gsub('nightly', "#{Time.now.strftime("%Y%m%d%H%M")}")
627+
628+
# There are three cases we want to deal with:
629+
# 1. Switching from a release build to a nightly one
630+
# 2. Updating a nightly build for the next nightly build
631+
# 3. Switching from nightlies to a release build.
632+
# According to PEP440, the way to indicate a nightly build is `M.m.v.devN`
633+
# Where `N` is sorted numerically. That means we can create the dev
634+
# version number from today's date.
635+
636+
if bump_nightly && old_version.include?('.dev')
637+
new_version = old_version.gsub(/\d+$/, "#{Time.now.strftime("%Y%m%d%H%M")}")
638+
elsif bump_nightly
639+
new_version = old_version + ".dev#{Time.now.strftime("%Y%m%d%H%M")}"
629640
else
630-
new_version = updated_version(old_version, arguments[:version])
631-
new_version += '.nightly' unless old_version.include?('nightly')
641+
new_version = updated_version(old_version.gsub(/\.dev\d+$/, ''), arguments[:version])
642+
puts "Calculated new version to be #{new_version}"
632643
end
633644

634645
['py/setup.py',
@@ -1154,6 +1165,7 @@ task :create_release_notes do
11541165
end
11551166

11561167
def updated_version(current, desired = nil)
1168+
puts "Calculating "
11571169
version = desired ? desired.split('.') : current.split(/\.|-/)
11581170
if desired
11591171
# Allows user to pass in only major/minor versions

py/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ compile_pip_requirements(
3636
],
3737
)
3838

39-
SE_VERSION = "4.19.0.nightly"
39+
SE_VERSION = "4.19.0.dev202403101143"
4040

4141
BROWSER_VERSIONS = [
4242
"v85",

py/docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
# The short X.Y version.
5959
version = '4.19'
6060
# The full version, including alpha/beta/rc tags.
61-
release = '4.19.0.nightly'
61+
release = '4.19.0.dev202403101143'
6262

6363
# The language for content autogenerated by Sphinx. Refer to documentation
6464
# for a list of supported languages.

py/selenium/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
# under the License.
1717

1818

19-
__version__ = "4.19.0.nightly"
19+
__version__ = "4.19.0.dev202403101143"

py/selenium/webdriver/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from .wpewebkit.service import Service as WPEWebKitService # noqa
4545
from .wpewebkit.webdriver import WebDriver as WPEWebKit # noqa
4646

47-
__version__ = "4.19.0.nightly"
47+
__version__ = "4.19.0.dev202403101143"
4848

4949
# We need an explicit __all__ because the above won't otherwise be exported.
5050
__all__ = [

py/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
setup_args = {
2828
'cmdclass': {'install': install},
2929
'name': 'selenium',
30-
'version': "4.19.0.nightly",
30+
'version': "4.19.0.dev202403101143",
3131
'license': 'Apache 2.0',
3232
'description': 'Python bindings for Selenium',
3333
'long_description': open(join(abspath(dirname(__file__)), "README.rst")).read(),

0 commit comments

Comments
 (0)