Skip to content

Commit 343e6b6

Browse files
authored
Add Python 3.11 and Python 3.12 to build workflow (#485)
This change brings github actions back into the green.
1 parent 8a41c91 commit 343e6b6

File tree

10 files changed

+26
-19
lines changed

10 files changed

+26
-19
lines changed

.github/scripts/requirements.txt

+7-4
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

+1-1
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: ["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

+1-1
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

+1-1
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/console/encoding.py

+6-6
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/formatting_windows.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ def initialize_or_disable():
3535
"""Enables ANSI processing on Windows or disables it as needed."""
3636
if HAS_COLORAMA:
3737
wrap = True
38-
if hasattr(sys.stdout, "isatty") and sys.stdout.isatty() and platform.release() == '10':
38+
if (hasattr(sys.stdout, "isatty")
39+
and sys.stdout.isatty()
40+
and platform.release() == '10'):
3941
# Enables native ANSI sequences in console.
4042
# Windows 10, 2016, and 2019 only.
4143

fire/inspectutils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ class with an __init__ method.
9898
def Py2GetArgSpec(fn):
9999
"""A wrapper around getargspec that tries both fn and fn.__call__."""
100100
try:
101-
return inspect.getargspec(fn) # pylint: disable=deprecated-method
101+
return inspect.getargspec(fn) # pylint: disable=deprecated-method,no-member
102102
except TypeError:
103103
if hasattr(fn, '__call__'):
104-
return inspect.getargspec(fn.__call__) # pylint: disable=deprecated-method
104+
return inspect.getargspec(fn.__call__) # pylint: disable=deprecated-method,no-member
105105
raise
106106

107107

fire/testutils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def assertOutputMatches(self, stdout='.*', stderr='.*', capture=True):
7474

7575
def assertRaisesRegex(self, *args, **kwargs): # pylint: disable=arguments-differ
7676
if sys.version_info.major == 2:
77-
return super(BaseTestCase, self).assertRaisesRegexp(*args, **kwargs) # pylint: disable=deprecated-method
77+
return super(BaseTestCase, self).assertRaisesRegexp(*args, **kwargs) # pylint: disable=deprecated-method,no-member
7878
else:
7979
return super(BaseTestCase, self).assertRaisesRegex(*args, **kwargs) # pylint: disable=no-member
8080

pylintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ enable=indexing-exception,old-raise-syntax
3232
# Disable the message, report, category or checker with the given id(s). You
3333
# can either give multiple identifier separated by comma (,) or put this option
3434
# multiple time.
35-
disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,file-ignored,wrong-import-order,useless-object-inheritance,no-else-return,super-with-arguments,raise-missing-from,consider-using-f-string,unspecified-encoding,unnecessary-lambda-assignment
35+
disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,file-ignored,wrong-import-order,useless-object-inheritance,no-else-return,super-with-arguments,raise-missing-from,consider-using-f-string,unspecified-encoding,unnecessary-lambda-assignment,wrong-import-position,ungrouped-imports,deprecated-module
3636

3737

3838
[REPORTS]

setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
'python-Levenshtein',
4141
]
4242

43-
VERSION = '0.5.0'
43+
VERSION = '0.6.0'
4444
URL = 'https://github.com/google/python-fire'
4545

4646
setup(
@@ -72,6 +72,8 @@
7272
'Programming Language :: Python :: 3.8',
7373
'Programming Language :: Python :: 3.9',
7474
'Programming Language :: Python :: 3.10',
75+
'Programming Language :: Python :: 3.11',
76+
'Programming Language :: Python :: 3.12',
7577

7678
'Operating System :: OS Independent',
7779
'Operating System :: POSIX',

0 commit comments

Comments
 (0)