<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[283824] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/283824">283824</a></dd>
<dt>Author</dt> <dd>jbedard@apple.com</dd>
<dt>Date</dt> <dd>2021-10-08 12:19:16 -0700 (Fri, 08 Oct 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[webkitcorepy] Not possible to autoinstall a package with micro version 0
https://bugs.webkit.org/show_bug.cgi?id=230540
<rdar://problem/83613371>

Reviewed by Michael Catanzaro.

* Scripts/libraries/webkitcorepy/setup.py: Bump version.
* Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Ditto.
* Scripts/libraries/webkitcorepy/webkitcorepy/tests/version_unittest.py:
(VersionTestCase.test_int_constructor): Default values are 'None.'
* Scripts/libraries/webkitcorepy/webkitcorepy/version.py:
(Version.from_iterable):
(Version.__init__): Use 'None' as the default value instead of 0.
(Version.__setitem__): Support 'None' as a version value.
(Version.__contains__): Ditto.
(Version.__hash__): Ditto.
(Version.__cmp__): Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptslibrarieswebkitcorepysetuppy">trunk/Tools/Scripts/libraries/webkitcorepy/setup.py</a></li>
<li><a href="#trunkToolsScriptslibrarieswebkitcorepywebkitcorepy__init__py">trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py</a></li>
<li><a href="#trunkToolsScriptslibrarieswebkitcorepywebkitcorepytestsversion_unittestpy">trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/tests/version_unittest.py</a></li>
<li><a href="#trunkToolsScriptslibrarieswebkitcorepywebkitcorepyversionpy">trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/version.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (283823 => 283824)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2021-10-08 19:16:57 UTC (rev 283823)
+++ trunk/Tools/ChangeLog       2021-10-08 19:19:16 UTC (rev 283824)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2021-10-08  Jonathan Bedard  <jbedard@apple.com>
+
+        [webkitcorepy] Not possible to autoinstall a package with micro version 0
+        https://bugs.webkit.org/show_bug.cgi?id=230540
+        <rdar://problem/83613371>
+
+        Reviewed by Michael Catanzaro.
+
+        * Scripts/libraries/webkitcorepy/setup.py: Bump version.
+        * Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Ditto.
+        * Scripts/libraries/webkitcorepy/webkitcorepy/tests/version_unittest.py:
+        (VersionTestCase.test_int_constructor): Default values are 'None.'
+        * Scripts/libraries/webkitcorepy/webkitcorepy/version.py:
+        (Version.from_iterable):
+        (Version.__init__): Use 'None' as the default value instead of 0.
+        (Version.__setitem__): Support 'None' as a version value.
+        (Version.__contains__): Ditto.
+        (Version.__hash__): Ditto.
+        (Version.__cmp__): Ditto.
+
</ins><span class="cx"> 2021-10-08  Andres Gonzalez  <andresg_22@apple.com>
</span><span class="cx"> 
</span><span class="cx">         AX: AXMathRootRadicand should return an array of elements, not just the first
</span></span></pre></div>
<a id="trunkToolsScriptslibrarieswebkitcorepysetuppy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/libraries/webkitcorepy/setup.py (283823 => 283824)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/libraries/webkitcorepy/setup.py      2021-10-08 19:16:57 UTC (rev 283823)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/setup.py 2021-10-08 19:19:16 UTC (rev 283824)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> setup(
</span><span class="cx">     name='webkitcorepy',
</span><del>-    version='0.11.1',
</del><ins>+    version='0.11.2',
</ins><span class="cx">     description='Library containing various Python support classes and functions.',
</span><span class="cx">     long_description=readme(),
</span><span class="cx">     classifiers=[
</span></span></pre></div>
<a id="trunkToolsScriptslibrarieswebkitcorepywebkitcorepy__init__py"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py (283823 => 283824)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py      2021-10-08 19:16:57 UTC (rev 283823)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py 2021-10-08 19:19:16 UTC (rev 283824)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> from webkitcorepy.editor import Editor
</span><span class="cx"> from webkitcorepy.file_lock import FileLock
</span><span class="cx"> 
</span><del>-version = Version(0, 11, 1)
</del><ins>+version = Version(0, 11, 2)
</ins><span class="cx"> 
</span><span class="cx"> from webkitcorepy.autoinstall import Package, AutoInstall
</span><span class="cx"> if sys.version_info > (3, 0):
</span></span></pre></div>
<a id="trunkToolsScriptslibrarieswebkitcorepywebkitcorepytestsversion_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/tests/version_unittest.py (283823 => 283824)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/tests/version_unittest.py        2021-10-08 19:16:57 UTC (rev 283823)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/tests/version_unittest.py   2021-10-08 19:19:16 UTC (rev 283824)
</span><span class="lines">@@ -52,10 +52,10 @@
</span><span class="cx">     def test_int_constructor(self):
</span><span class="cx">         v = Version(1)
</span><span class="cx">         self.assertEqual(v.major, 1)
</span><del>-        self.assertEqual(v.minor, 0)
-        self.assertEqual(v.tiny, 0)
-        self.assertEqual(v.micro, 0)
-        self.assertEqual(v.nano, 0)
</del><ins>+        self.assertEqual(v.minor, None)
+        self.assertEqual(v.tiny, None)
+        self.assertEqual(v.micro, None)
+        self.assertEqual(v.nano, None)
</ins><span class="cx"> 
</span><span class="cx">     def test_len(self):
</span><span class="cx">         self.assertEqual(len(Version(1, 2, 3, 4, 5)), 5)
</span></span></pre></div>
<a id="trunkToolsScriptslibrarieswebkitcorepywebkitcorepyversionpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/version.py (283823 => 283824)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/version.py       2021-10-08 19:16:57 UTC (rev 283823)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/version.py  2021-10-08 19:19:16 UTC (rev 283824)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">     def from_iterable(val):
</span><span class="cx">         result = Version()
</span><span class="cx">         for i in range(len(val)):
</span><del>-            result[i] = int(val[i])
</del><ins>+            result[i] = None if val[i] is None else int(val[i])
</ins><span class="cx">         return result
</span><span class="cx"> 
</span><span class="cx">     @staticmethod
</span><span class="lines">@@ -45,12 +45,12 @@
</span><span class="cx">         from webkitpy.common.version_name_map import VersionNameMap
</span><span class="cx">         return VersionNameMap.map().from_name(name)[1]
</span><span class="cx"> 
</span><del>-    def __init__(self, major=0, minor=0, tiny=0, micro=0, nano=0):
</del><ins>+    def __init__(self, major=0, minor=None, tiny=None, micro=None, nano=None):
</ins><span class="cx">         self.major = int(major)
</span><del>-        self.minor = int(minor)
-        self.tiny = int(tiny)
-        self.micro = int(micro)
-        self.nano = int(nano)
</del><ins>+        self.minor = None if minor is None else int(minor)
+        self.tiny = None if tiny is None else int(tiny)
+        self.micro = None if micro is None else int(micro)
+        self.nano = None if nano is None else int(nano)
</ins><span class="cx"> 
</span><span class="cx">     def __len__(self):
</span><span class="cx">         return 5
</span><span class="lines">@@ -75,21 +75,22 @@
</span><span class="cx">         raise ValueError('Expected version key to be string or integer')
</span><span class="cx"> 
</span><span class="cx">     def __setitem__(self, key, value):
</span><ins>+        value = None if value is None else int(value)
</ins><span class="cx">         if isinstance(key, int):
</span><span class="cx">             if key == 0:
</span><del>-                self.major = int(value)
</del><ins>+                self.major = value
</ins><span class="cx">                 return self.major
</span><span class="cx">             elif key == 1:
</span><del>-                self.minor = int(value)
</del><ins>+                self.minor = value
</ins><span class="cx">                 return self.minor
</span><span class="cx">             elif key == 2:
</span><del>-                self.tiny = int(value)
</del><ins>+                self.tiny = value
</ins><span class="cx">                 return self.tiny
</span><span class="cx">             elif key == 3:
</span><del>-                self.micro = int(value)
</del><ins>+                self.micro = value
</ins><span class="cx">                 return self.micro
</span><span class="cx">             elif key == 4:
</span><del>-                self.nano = int(value)
</del><ins>+                self.nano = value
</ins><span class="cx">                 return self.nano
</span><span class="cx">             raise ValueError('Version key must be between 0 and 4')
</span><span class="cx">         elif isinstance(key, str):
</span><span class="lines">@@ -136,9 +137,9 @@
</span><span class="cx">         assert isinstance(version, Version)
</span><span class="cx">         does_match = True
</span><span class="cx">         for i in range(len(version)):
</span><del>-            if self[i] != version[i]:
</del><ins>+            if (self[i] or 0) != (version[i] or 0):
</ins><span class="cx">                 does_match = False
</span><del>-            if not does_match and self[i] != 0:
</del><ins>+            if not does_match and self[i] is not None:
</ins><span class="cx">                 return False
</span><span class="cx">         return True
</span><span class="cx"> 
</span><span class="lines">@@ -156,7 +157,7 @@
</span><span class="cx">         result = 0
</span><span class="cx">         for index in range(len(self)):
</span><span class="cx">             result *= 1000
</span><del>-            result += self[index]
</del><ins>+            result += -1 if self[index] is None else self[index]
</ins><span class="cx">         return result
</span><span class="cx"> 
</span><span class="cx">     def __cmp__(self, other):
</span><span class="lines">@@ -163,7 +164,7 @@
</span><span class="cx">         if other is None:
</span><span class="cx">             return 1
</span><span class="cx">         for i in range(len(self)):
</span><del>-            diff = self[i] - other[i]
</del><ins>+            diff = (self[i] or 0) - (other[i] or 0)
</ins><span class="cx">             if diff:
</span><span class="cx">                 return diff
</span><span class="cx">         return 0
</span></span></pre>
</div>
</div>

</body>
</html>