Skip to content

Commit

Permalink
Final patch for 1.5.1 release (#813)
Browse files Browse the repository at this point in the history
* fixed issue with pebble imports (#810)

* fix linting

* skip isinstance check so we don't get type errors

Co-authored-by: PietroPasotti <starfire.daemon@gmail.com>
  • Loading branch information
rwcarlsen and PietroPasotti authored Aug 18, 2022
1 parent 7abc303 commit ac4dff6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ops/jujuversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import os
import re
from functools import total_ordering
from typing import Union


@total_ordering
Expand Down Expand Up @@ -55,12 +56,12 @@ def __repr__(self):
s += '.{}'.format(self.build)
return s

def __eq__(self, other: 'JujuVersion') -> bool:
def __eq__(self, other: Union[str, 'JujuVersion']) -> bool:
if self is other:
return True
if isinstance(other, str):
other = type(self)(other)
elif not isinstance(other, JujuVersion):
elif not isinstance(other, JujuVersion): # pyright: reportUnnecessaryIsInstance=false
raise RuntimeError('cannot compare Juju version "{}" with "{}"'.format(self, other))
return (
self.major == other.major
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ description = Check code against coding style standards
deps =
autopep8
isort
flake8
flake8==4.0.1
flake8-docstrings
flake8-builtins
pyproject-flake8
Expand Down

0 comments on commit ac4dff6

Please # to comment.