Skip to content

Commit ae1690e

Browse files
committed
Merge branch 'master' into watcher
2 parents e6e7fda + 343e6b6 commit ae1690e

18 files changed

Lines changed: 44 additions & 35 deletions

.github/scripts/requirements.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
setuptools <65.7.0
2-
pip <23.0
1+
setuptools <65.7.0 ; python_version == '2.7'
2+
setuptools <=69.1.1 ; python_version >= '3.8'
3+
pip <23.0 ; python_version == '2.7'
4+
pip ; python_version >= '3.5'
35
pylint <2.15.10
46
pytest <=7.2.1
57
pytest-pylint <=1.1.2
68
pytest-runner <6.0.0
79
termcolor <2.2.0
810
hypothesis <6.62.0
9-
python-Levenshtein <0.20.9
10-
mock <5.0.0
11+
python-Levenshtein <0.20.9 ; python_version == '2.7'
12+
levenshtein <=0.25.0 ; python_version >= '3.5'
13+
mock <5.0.0

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-20.04
88
strategy:
99
matrix:
10-
python-version: ["2.7", "3.5", "3.7", "3.8", "3.9", "3.10"]
10+
python-version: ["3.5", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1111

1212
steps:
1313
# Checkout the repo.

fire/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
from fire.core import Fire
2222

2323
__all__ = ['Fire']
24-
__version__ = '0.5.0'
24+
__version__ = '0.6.0'

fire/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def import_from_file_path(path):
8080
spec.loader.exec_module(module) # pytype: disable=attribute-error
8181

8282
else:
83-
import imp # pylint: disable=g-import-not-at-top,import-outside-toplevel,deprecated-module
83+
import imp # pylint: disable=g-import-not-at-top,import-outside-toplevel,deprecated-module,import-error
8484
module = imp.load_source(module_name, path)
8585

8686
return module, module_name

fire/completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _BashScript(name, commands, default_options=None):
104104
option_already_entered()
105105
{{
106106
local opt
107-
for opt in ${{COMP_WORDS[@]:0:COMP_CWORD}}
107+
for opt in ${{COMP_WORDS[@]:0:$COMP_CWORD}}
108108
do
109109
if [ $1 == $opt ]; then
110110
return 0

fire/console/console_attr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def __init__(self, encoding=None, suppress_output=False):
268268

269269
# ANSI "standard" attributes.
270270
if self.SupportsAnsi():
271-
# Select Graphic Rendition paramaters from
271+
# Select Graphic Rendition parameters from
272272
# http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
273273
# Italic '3' would be nice here but its not widely supported.
274274
self._csi = '\x1b['
@@ -394,7 +394,7 @@ def GetControlSequenceIndicator(self):
394394
"""Returns the control sequence indicator string.
395395
396396
Returns:
397-
The conrol sequence indicator string or None if control sequences are not
397+
The control sequence indicator string or None if control sequences are not
398398
supported.
399399
"""
400400
return self._csi
@@ -408,7 +408,7 @@ def GetControlSequenceLen(self, buf):
408408
buf: The string to check for a control sequence.
409409
410410
Returns:
411-
The conrol sequence length at the beginning of buf or 0 if buf does not
411+
The control sequence length at the beginning of buf or 0 if buf does not
412412
start with a control sequence.
413413
"""
414414
if not self._csi or not buf.startswith(self._csi):

fire/console/console_attr_os.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _GetTermSizeEnvironment():
123123

124124

125125
def _GetTermSizeTput():
126-
"""Returns the terminal x and y dimemsions from tput(1)."""
126+
"""Returns the terminal x and y dimensions from tput(1)."""
127127
import subprocess # pylint: disable=g-import-not-at-top
128128
output = encoding.Decode(subprocess.check_output(['tput', 'cols'],
129129
stderr=subprocess.STDOUT))

fire/console/console_pager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __init__(self, contents, out=None, prompt=None):
9494
Args:
9595
contents: The entire contents of the text lines to page.
9696
out: The output stream, log.out (effectively) if None.
97-
prompt: The page break prompt, a defalt prompt is used if None..
97+
prompt: The page break prompt, a default prompt is used if None..
9898
"""
9999
self._contents = contents
100100
self._out = out or sys.stdout

fire/console/encoding.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ def Decode(data, encoding=None):
8686

8787
try:
8888
# Just return the string if its pure ASCII.
89-
return string.decode('ascii')
89+
return string.decode('ascii') # pytype: disable=attribute-error
9090
except UnicodeError:
9191
# The string is not ASCII encoded.
9292
pass
9393

9494
# Try the suggested encoding if specified.
9595
if encoding:
9696
try:
97-
return string.decode(encoding)
97+
return string.decode(encoding) # pytype: disable=attribute-error
9898
except UnicodeError:
9999
# Bad suggestion.
100100
pass
@@ -103,21 +103,21 @@ def Decode(data, encoding=None):
103103
# be exceptional if a valid extended ascii encoding with extended chars
104104
# were also a valid UITF-8 encoding.
105105
try:
106-
return string.decode('utf8')
106+
return string.decode('utf8') # pytype: disable=attribute-error
107107
except UnicodeError:
108108
# Not a UTF-8 encoding.
109109
pass
110110

111111
# Try the filesystem encoding.
112112
try:
113-
return string.decode(sys.getfilesystemencoding())
113+
return string.decode(sys.getfilesystemencoding()) # pytype: disable=attribute-error
114114
except UnicodeError:
115115
# string is not encoded for filesystem paths.
116116
pass
117117

118118
# Try the system default encoding.
119119
try:
120-
return string.decode(sys.getdefaultencoding())
120+
return string.decode(sys.getdefaultencoding()) # pytype: disable=attribute-error
121121
except UnicodeError:
122122
# string is not encoded using the default encoding.
123123
pass
@@ -137,7 +137,7 @@ def Decode(data, encoding=None):
137137
# string = '\xdc'
138138
# string = string.decode('iso-8859-1')
139139
# string = string.encode('ascii', 'backslashreplace')
140-
return string.decode('iso-8859-1')
140+
return string.decode('iso-8859-1') # pytype: disable=attribute-error
141141

142142

143143
def GetEncodedValue(env, name, default=None):

fire/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ def Fire(component=None, command=None, name=None, serialize=None):
9494
a string or a list of strings; a list of strings is preferred.
9595
name: Optional. The name of the command as entered at the command line.
9696
Used in interactive mode and for generating the completion script.
97+
serialize: Optional. If supplied, all objects are serialized to text via
98+
the provided callable.
9799
Returns:
98100
The result of executing the Fire command. Execution begins with the initial
99101
target component. The component is updated by using the command arguments

0 commit comments

Comments
 (0)