@autorest/python 6.13.9 → 6.13.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,7 +37,15 @@ class BlackScriptPlugin(Plugin): # pylint: disable=abstract-method
37
37
  [
38
38
  Path(f)
39
39
  for f in self.list_file()
40
- if all(item not in f for item in ("__pycache__", "node_modules"))
40
+ if all(
41
+ item not in f
42
+ for item in (
43
+ "__pycache__",
44
+ "node_modules",
45
+ ".tox",
46
+ ".mypy_cache",
47
+ )
48
+ )
41
49
  and Path(f).suffix == ".py"
42
50
  ],
43
51
  )
@@ -45,8 +53,8 @@ class BlackScriptPlugin(Plugin): # pylint: disable=abstract-method
45
53
  return True
46
54
 
47
55
  def format_file(self, file: Path) -> None:
48
- file_content = self.read_file(file)
49
56
  try:
57
+ file_content = self.read_file(file)
50
58
  file_content = black.format_file_contents(
51
59
  file_content, fast=True, mode=_BLACK_MODE
52
60
  )
@@ -55,7 +63,8 @@ class BlackScriptPlugin(Plugin): # pylint: disable=abstract-method
55
63
  except: # pylint: disable=bare-except
56
64
  _LOGGER.error("Error: failed to format %s", file)
57
65
  raise
58
- self.write_file(file, file_content)
66
+ else:
67
+ self.write_file(file, file_content)
59
68
 
60
69
 
61
70
  class BlackScriptPluginAutorest(BlackScriptPlugin, PluginAutorest):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/python",
3
- "version": "6.13.9",
3
+ "version": "6.13.11",
4
4
  "description": "The Python extension for generators in AutoRest.",
5
5
  "main": "index.js",
6
6
  "repository": {
package/requirements.txt CHANGED
@@ -10,4 +10,4 @@ pathspec==0.11.1
10
10
  platformdirs==3.2.0
11
11
  PyYAML==6.0.1
12
12
  tomli==2.0.1
13
- setuptools==65.5.1
13
+ setuptools==69.2.0