** Description changed:

  [IMPACT]
  
  * Allow broader Ops/Eng team to consume Ansible from our packages
  instead of the upstream PyPi repositories in order to fix this warning.
  
  * Sanitize package installation:
  
  Setting up python3-jmespath (0.9.4-2) ...
  /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" 
with a literal. Did you mean "=="?
  
  [TEST CASE]
  
  ** Scenario #1 **
  
  $ pull-lp-source python-jmespath
  
  $ cd python-jmespath*
  
- $ python3-coverage run jmespath/visitor.py 
+ $ python3-coverage run jmespath/visitor.py
  jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
-   if x is 0 or x is 1:
+   if x is 0 or x is 1:
  jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
-   if x is 0 or x is 1:
+   if x is 0 or x is 1:
  jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
-   elif y is 0 or y is 1:
+   elif y is 0 or y is 1:
  jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
-   elif y is 0 or y is 1:
+   elif y is 0 or y is 1:
  jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean 
"=="?
-   if original_result is 0:
+   if original_result is 0:
  
  $ quilt push -a
  Applying patch 0001-satisfy-python38-syntaxwarning.patch
  patching file jmespath/visitor.py
  
  $ python3-coverage run jmespath/visitor.py
  
  ** Scenario #2 **
  This could be reproduced outside python-jmespath as follows (a little script 
I have written to compare result between py2 and py3 :
  
  # reproducer_test.py
  ----
  def reproducer(x,y):
      if x is 0 or x is 1:
          return y is True or y is False
      elif y is 0 or y is 1:
          return x is True or x is False
  
  print(reproducer(1,0))
  print(reproducer(0,1))
  ---
  
  $ python2 reproducer_test.py
  False
  False
  
  $ python3 -W ignore reproducer_test.py
  False
  False
  
  $ python3 reproducer_test.py
  test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="?
    if x is 0 or x is 1:
  test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="?
    if x is 0 or x is 1:
  test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="?
    elif y is 0 or y is 1:
  test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="?
    elif y is 0 or y is 1:
  False
  False
  
  With the fix in a small scale (Again, using my reproducer_test.py):
  
  # reproducer_test.py
  ----
  def reproducer(x,y):
  #    if x is 0 or x is 1:
       if type(x) is int and (x == 0 or x == 1):
          return y is True or y is False
  #    elif y is 0 or y is 1:
       elif type(y) is int and (y == 0 or y == 1):
          return x is True or x is False
  
  print(reproducer(1,0))
  print(reproducer(0,1))
  ---
  
  # python2 reproducer_test.py
  False
  False
  
  $ python3 reproducer_test.py
  False
  False
  
  The above proves that it maintains compatibility in py2 while fixing the
  "SyntaxWarning "in py3.
  
  [WHERE PROBLEM COULD OCCURS]
  
  Risk: Low
  
- * Only thing I could see is backward compatibility between py2 and py3
- where both python releases are available in main (e.g. bionic).
+ * The fix maintain backward compatibility tested with python-coverage,
+ and other verifications.
  
- But the backward compatibility has been tested already and it didn't
- exhibit any potential issue so far.
+ This package lack of test suite and coverage for things that could have
+ been easily avoided with proper test in place. There may or may not be
+ other places in other code path generating syntax warning as this is not
+ well tested I'm afraid.
+ 
+ In general, looking upstream:
  
  * No observed regression caused by this fix in upstream issues nor in
  the Ubuntu release where the fix has landed (Focal/Hirsute).
  
  * No other py3.8 commits (either fix and/or regression fix) found in the
  project git log.
  
  [OTHER INFORMATIONS]
  
  Upstream issue:
  https://github.com/jmespath/jmespath.py/issues/187
  
  Upstream commit:
  
https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f
  
  [ORIGINAL DESCRIPTIONS]
  As reported upstream
  
  https://github.com/jmespath/jmespath.py/issues/201
  Problems installing jmespath in Ubuntu 20.04 LTS
  
  Setting up python3-jmespath (0.9.4-2) ...
  /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" 
with a literal. Did you mean "=="?
  
  Fixed upstream in
  
https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f
  
  Impact: this causes applications like Ansible that have dependencies on
  python-jmespath to send out warnings. Caused by language changes in
  Python 3.8.
  
  System is Ubuntu 20.04 LTS on a Pi 4.
  
  emv@pinnatus:~$ apt-cache policy python3-jmespath
  python3-jmespath:
    Installed: 0.9.4-2
    Candidate: 0.9.4-2
    Version table:
   *** 0.9.4-2 500
          500 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 Packages
          100 /var/lib/dpkg/status

** Description changed:

  [IMPACT]
  
  * Allow broader Ops/Eng team to consume Ansible from our packages
  instead of the upstream PyPi repositories in order to fix this warning.
  
  * Sanitize package installation:
  
  Setting up python3-jmespath (0.9.4-2) ...
  /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" 
with a literal. Did you mean "=="?
  
  [TEST CASE]
  
  ** Scenario #1 **
  
  $ pull-lp-source python-jmespath
  
  $ cd python-jmespath*
  
  $ python3-coverage run jmespath/visitor.py
  jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
    if x is 0 or x is 1:
  jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
    if x is 0 or x is 1:
  jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
    elif y is 0 or y is 1:
  jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
    elif y is 0 or y is 1:
  jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean 
"=="?
    if original_result is 0:
  
  $ quilt push -a
  Applying patch 0001-satisfy-python38-syntaxwarning.patch
  patching file jmespath/visitor.py
  
  $ python3-coverage run jmespath/visitor.py
  
  ** Scenario #2 **
+ 
+ 
+ $ pull-lp-source python-jmespath
+ 
+ $ cd python-jmespath*
+ 
+ $ nosetests3
+ /tmp/jmes/f/python-jmespath-0.9.4/jmespath/visitor.py:32: SyntaxWarning: "is" 
with a literal. Did you mean "=="?
+   if x is 0 or x is 1:
+ /tmp/jmes/f/python-jmespath-0.9.4/jmespath/visitor.py:32: SyntaxWarning: "is" 
with a literal. Did you mean "=="?
+   if x is 0 or x is 1:
+ /tmp/jmes/f/python-jmespath-0.9.4/jmespath/visitor.py:34: SyntaxWarning: "is" 
with a literal. Did you mean "=="?
+   elif y is 0 or y is 1:
+ /tmp/jmes/f/python-jmespath-0.9.4/jmespath/visitor.py:34: SyntaxWarning: "is" 
with a literal. Did you mean "=="?
+   elif y is 0 or y is 1:
+ /tmp/jmes/f/python-jmespath-0.9.4/jmespath/visitor.py:260: SyntaxWarning: 
"is" with a literal. Did you mean "=="?
+   if original_result is 0:
+ .........................................
+ ----------------------------------------------------------------------
+ Ran 41 tests in 0.039s
+ 
+ OK
+ 
+ $ quilt push -a
+ Applying patch 0001-satisfy-python38-syntaxwarning.patch
+ patching file jmespath/visitor.py
+ 
+ Now at patch 0001-satisfy-python38-syntaxwarning.patch
+ 
+ $ nosetests3
+ .........................................
+ ----------------------------------------------------------------------
+ Ran 41 tests in 0.021s
+ 
+ OK
+ 
+ $ nosetests
+ .........................................
+ ----------------------------------------------------------------------
+ Ran 41 tests in 0.016s
+ 
+ OK
+ 
+ 
+ ** Scenario #3 **
  This could be reproduced outside python-jmespath as follows (a little script 
I have written to compare result between py2 and py3 :
  
  # reproducer_test.py
  ----
  def reproducer(x,y):
      if x is 0 or x is 1:
          return y is True or y is False
      elif y is 0 or y is 1:
          return x is True or x is False
  
  print(reproducer(1,0))
  print(reproducer(0,1))
  ---
  
  $ python2 reproducer_test.py
  False
  False
  
  $ python3 -W ignore reproducer_test.py
  False
  False
  
  $ python3 reproducer_test.py
  test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="?
    if x is 0 or x is 1:
  test.py:2: SyntaxWarning: "is" with a literal. Did you mean "=="?
    if x is 0 or x is 1:
  test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="?
    elif y is 0 or y is 1:
  test.py:4: SyntaxWarning: "is" with a literal. Did you mean "=="?
    elif y is 0 or y is 1:
  False
  False
  
  With the fix in a small scale (Again, using my reproducer_test.py):
  
  # reproducer_test.py
  ----
  def reproducer(x,y):
  #    if x is 0 or x is 1:
       if type(x) is int and (x == 0 or x == 1):
          return y is True or y is False
  #    elif y is 0 or y is 1:
       elif type(y) is int and (y == 0 or y == 1):
          return x is True or x is False
  
  print(reproducer(1,0))
  print(reproducer(0,1))
  ---
  
  # python2 reproducer_test.py
  False
  False
  
  $ python3 reproducer_test.py
  False
  False
  
  The above proves that it maintains compatibility in py2 while fixing the
  "SyntaxWarning "in py3.
  
  [WHERE PROBLEM COULD OCCURS]
  
  Risk: Low
  
- * The fix maintain backward compatibility tested with python-coverage,
- and other verifications.
+ * The fix maintain backward compatibility tested with
+ python3-coverage/python-coverage, and python3-nose/python-nose manually
+ and didn't report any problem.
  
  This package lack of test suite and coverage for things that could have
  been easily avoided with proper test in place. There may or may not be
- other places in other code path generating syntax warning as this is not
- well tested I'm afraid.
+ other places in other code path generating syntax warning, as this is
+ not well tested I'm afraid.
  
  In general, looking upstream:
  
  * No observed regression caused by this fix in upstream issues nor in
  the Ubuntu release where the fix has landed (Focal/Hirsute).
  
  * No other py3.8 commits (either fix and/or regression fix) found in the
  project git log.
  
  [OTHER INFORMATIONS]
  
  Upstream issue:
  https://github.com/jmespath/jmespath.py/issues/187
  
  Upstream commit:
  
https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f
  
  [ORIGINAL DESCRIPTIONS]
  As reported upstream
  
  https://github.com/jmespath/jmespath.py/issues/201
  Problems installing jmespath in Ubuntu 20.04 LTS
  
  Setting up python3-jmespath (0.9.4-2) ...
  /usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" 
with a literal. Did you mean "=="?
  
  Fixed upstream in
  
https://github.com/jmespath/jmespath.py/commit/56263b84cdb0feb7c8d54e426ec472f4dd0de44f
  
  Impact: this causes applications like Ansible that have dependencies on
  python-jmespath to send out warnings. Caused by language changes in
  Python 3.8.
  
  System is Ubuntu 20.04 LTS on a Pi 4.
  
  emv@pinnatus:~$ apt-cache policy python3-jmespath
  python3-jmespath:
    Installed: 0.9.4-2
    Candidate: 0.9.4-2
    Version table:
   *** 0.9.4-2 500
          500 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 Packages
          100 /var/lib/dpkg/status

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1877792

Title:
  jmespath SyntaxWarning: "is" with a literal.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ansible/+bug/1877792/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to