Skip to content

Commit e5103af

Browse files
Bump ruff from 0.9.5 to 0.11.6 (microsoft#24480)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.9.5 to 0.11.6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/astral-sh/ruff/releases">ruff's releases</a>.</em></p> <blockquote> <h2>0.11.6</h2> <h2>Release Notes</h2> <h3>Preview features</h3> <ul> <li>Avoid adding whitespace to the end of a docstring after an escaped quote (<a href="https://redirect.github.com/astral-sh/ruff/pull/17216">#17216</a>)</li> <li>[<code>airflow</code>] Extract <code>AIR311</code> from <code>AIR301</code> rules (<code>AIR301</code>, <code>AIR311</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/17310">#17310</a>, <a href="https://redirect.github.com/astral-sh/ruff/pull/17422">#17422</a>)</li> </ul> <h3>Bug fixes</h3> <ul> <li>Raise syntax error when <code>\</code> is at end of file (<a href="https://redirect.github.com/astral-sh/ruff/pull/17409">#17409</a>)</li> </ul> <h2>Contributors</h2> <ul> <li><a href="https://github.com/AlexWaygood"><code>@​AlexWaygood</code></a></li> <li><a href="https://github.com/BurntSushi"><code>@​BurntSushi</code></a></li> <li><a href="https://github.com/Lee-W"><code>@​Lee-W</code></a></li> <li><a href="https://github.com/MatthewMckee4"><code>@​MatthewMckee4</code></a></li> <li><a href="https://github.com/MichaReiser"><code>@​MichaReiser</code></a></li> <li><a href="https://github.com/cake-monotone"><code>@​cake-monotone</code></a></li> <li><a href="https://github.com/carljm"><code>@​carljm</code></a></li> <li><a href="https://github.com/charliermarsh"><code>@​charliermarsh</code></a></li> <li><a href="https://github.com/dcreager"><code>@​dcreager</code></a></li> <li><a href="https://github.com/dhruvmanila"><code>@​dhruvmanila</code></a></li> <li><a href="https://github.com/github-actions"><code>@​github-actions</code></a></li> <li><a href="https://github.com/maxmynter"><code>@​maxmynter</code></a></li> <li><a href="https://github.com/mishamsk"><code>@​mishamsk</code></a></li> <li><a href="https://github.com/mtshiba"><code>@​mtshiba</code></a></li> <li><a href="https://github.com/ntBre"><code>@​ntBre</code></a></li> <li><a href="https://github.com/renovate"><code>@​renovate</code></a></li> <li><a href="https://github.com/sharkdp"><code>@​sharkdp</code></a></li> </ul> <h2>Install ruff 0.11.6</h2> <h3>Install prebuilt binaries via shell script</h3> <pre lang="sh"><code>curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ruff/releases/download/0.11.6/ruff-installer.sh | sh </code></pre> <h3>Install prebuilt binaries via powershell script</h3> <pre lang="sh"><code>powershell -ExecutionPolicy Bypass -c &quot;irm https://github.com/astral-sh/ruff/releases/download/0.11.6/ruff-installer.ps1 | iex&quot; </code></pre> <h2>Download ruff 0.11.6</h2> <table> <thead> <tr> <th>File</th> <th>Platform</th> <th>Checksum</th> </tr> </thead> </table> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md">ruff's changelog</a>.</em></p> <blockquote> <h2>0.11.6</h2> <h3>Preview features</h3> <ul> <li>Avoid adding whitespace to the end of a docstring after an escaped quote (<a href="https://redirect.github.com/astral-sh/ruff/pull/17216">#17216</a>)</li> <li>[<code>airflow</code>] Extract <code>AIR311</code> from <code>AIR301</code> rules (<code>AIR301</code>, <code>AIR311</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/17310">#17310</a>, <a href="https://redirect.github.com/astral-sh/ruff/pull/17422">#17422</a>)</li> </ul> <h3>Bug fixes</h3> <ul> <li>Raise syntax error when <code>\</code> is at end of file (<a href="https://redirect.github.com/astral-sh/ruff/pull/17409">#17409</a>)</li> </ul> <h2>0.11.5</h2> <h3>Preview features</h3> <ul> <li>[<code>airflow</code>] Add missing <code>AIR302</code> attribute check (<a href="https://redirect.github.com/astral-sh/ruff/pull/17115">#17115</a>)</li> <li>[<code>airflow</code>] Expand module path check to individual symbols (<code>AIR302</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/17278">#17278</a>)</li> <li>[<code>airflow</code>] Extract <code>AIR312</code> from <code>AIR302</code> rules (<code>AIR302</code>, <code>AIR312</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/17152">#17152</a>)</li> <li>[<code>airflow</code>] Update oudated <code>AIR301</code>, <code>AIR302</code> rules (<a href="https://redirect.github.com/astral-sh/ruff/pull/17123">#17123</a>)</li> <li>[syntax-errors] Async comprehension in sync comprehension (<a href="https://redirect.github.com/astral-sh/ruff/pull/17177">#17177</a>)</li> <li>[syntax-errors] Check annotations in annotated assignments (<a href="https://redirect.github.com/astral-sh/ruff/pull/17283">#17283</a>)</li> <li>[syntax-errors] Extend annotation checks to <code>await</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/17282">#17282</a>)</li> </ul> <h3>Bug fixes</h3> <ul> <li>[<code>flake8-pie</code>] Avoid false positive for multiple assignment with <code>auto()</code> (<code>PIE796</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/17274">#17274</a>)</li> </ul> <h3>Rule changes</h3> <ul> <li>[<code>ruff</code>] Fix <code>RUF100</code> to detect unused file-level <code>noqa</code> directives with specific codes (<a href="https://redirect.github.com/astral-sh/ruff/issues/17042">#17042</a>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/17061">#17061</a>)</li> <li>[<code>flake8-pytest-style</code>] Avoid false positive for legacy form of <code>pytest.raises</code> (<code>PT011</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/17231">#17231</a>)</li> </ul> <h3>Documentation</h3> <ul> <li>Fix formatting of &quot;See Style Guide&quot; link (<a href="https://redirect.github.com/astral-sh/ruff/pull/17272">#17272</a>)</li> </ul> <h2>0.11.4</h2> <h3>Preview features</h3> <ul> <li>[<code>ruff</code>] Implement <code>invalid-rule-code</code> as <code>RUF102</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/17138">#17138</a>)</li> <li>[syntax-errors] Detect duplicate keys in <code>match</code> mapping patterns (<a href="https://redirect.github.com/astral-sh/ruff/pull/17129">#17129</a>)</li> <li>[syntax-errors] Detect duplicate attributes in <code>match</code> class patterns (<a href="https://redirect.github.com/astral-sh/ruff/pull/17186">#17186</a>)</li> <li>[syntax-errors] Detect invalid syntax in annotations (<a href="https://redirect.github.com/astral-sh/ruff/pull/17101">#17101</a>)</li> </ul> <h3>Bug fixes</h3> <ul> <li>[syntax-errors] Fix multiple assignment error for class fields in <code>match</code> patterns (<a href="https://redirect.github.com/astral-sh/ruff/pull/17184">#17184</a>)</li> <li>Don't skip visiting non-tuple slice in <code>typing.Annotated</code> subscripts (<a href="https://redirect.github.com/astral-sh/ruff/pull/17201">#17201</a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/astral-sh/ruff/commit/fcd50a0496d725f773c6da149035f98bd90b6a30"><code>fcd50a0</code></a> Bump 0.11.6 (<a href="https://redirect.github.com/astral-sh/ruff/issues/17449">#17449</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/3ada36b766583c92c82bccce3519a467ae068630"><code>3ada36b</code></a> Auto generate <code>visit_source_order</code> (<a href="https://redirect.github.com/astral-sh/ruff/issues/17180">#17180</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/bd8983821289e436c2d4c1463c118baa02c7ef5b"><code>bd89838</code></a> [red-knot] Initial tests for protocols (<a href="https://redirect.github.com/astral-sh/ruff/issues/17436">#17436</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/b32407b6f3c300650b8a3b0a6cb1ce3c5f812c84"><code>b32407b</code></a> [red-knot] Dataclasses: synthesize <code>__init__</code> with proper signature (<a href="https://redirect.github.com/astral-sh/ruff/issues/17428">#17428</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/b4de245a5accc5ebe35e580a73040da8d99ed566"><code>b4de245</code></a> [red-knot] Dataclasses: support <code>order=True</code> (<a href="https://redirect.github.com/astral-sh/ruff/issues/17406">#17406</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/914095d08f02ed91b1acf807aca89723f3632fb9"><code>914095d</code></a> [red-knot] Super-basic generic inference at call sites (<a href="https://redirect.github.com/astral-sh/ruff/issues/17301">#17301</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/5350288d0773f986e90653c44a6304d9411b5782"><code>5350288</code></a> [red-knot] Check assignability of bound methods to callables (<a href="https://redirect.github.com/astral-sh/ruff/issues/17430">#17430</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/649610cc98add11d8ff48c6d0fba928fb1e00262"><code>649610c</code></a> [red-knot] Support <code>super</code> (<a href="https://redirect.github.com/astral-sh/ruff/issues/17174">#17174</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/1a79722ee0fb160f8929612508d5ee88b7838d09"><code>1a79722</code></a> [<code>airflow</code>] Extend <code>AIR311</code> rules (<a href="https://redirect.github.com/astral-sh/ruff/issues/17422">#17422</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/b67590bfde9de44757a3365d43040b8f93c10f35"><code>b67590b</code></a> [red-knot] simplify union size limit handling (<a href="https://redirect.github.com/astral-sh/ruff/issues/17429">#17429</a>)</li> <li>Additional commits viewable in <a href="https://github.com/astral-sh/ruff/compare/0.9.5...0.11.6">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ruff&package-manager=pip&previous-version=0.9.5&new-version=0.11.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Changming Sun <[email protected]>
1 parent 6b9e68d commit e5103af

28 files changed

+42
-56
lines changed

.lintrunner.toml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,6 @@ init_command = [
9191
]
9292
is_formatter = true
9393

94-
[[linter]]
95-
code = 'RUSTFMT'
96-
include_patterns = ['**/*.rs']
97-
command = [
98-
'python',
99-
'-m',
100-
'lintrunner_adapters',
101-
'run',
102-
'rustfmt_linter',
103-
'--binary=rustfmt',
104-
'--config-path=rust/rustfmt.toml',
105-
'--',
106-
'@{{PATHSFILE}}'
107-
]
108-
is_formatter = true
109-
11094
[[linter]]
11195
code = 'CLANGFORMAT'
11296
include_patterns = [

onnxruntime/python/tools/kernel_explorer/kernels/batched_gemm_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import pytest
1313
from utils import get_gemm_basic_sizes, get_gemm_bert_sizes, get_gemm_bound, matmul, transab_to_suffix
1414

15-
max_batch_size = int(os.environ.get("KERNEL_EXPLORER_BATCHED_GEMM_MAX_BATCH_SIZE", 64))
15+
max_batch_size = int(os.environ.get("KERNEL_EXPLORER_BATCHED_GEMM_MAX_BATCH_SIZE", "64"))
1616

1717

1818
def dtype_to_suffix(dtype):

onnxruntime/python/tools/kernel_explorer/kernels/gemm_softmax_gemm_permute_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import pytest
1414
from utils import dtype_to_suffix, matmul, softmax
1515

16-
max_batch_size = int(os.environ.get("KERNEL_EXPLORER_BATCHED_GEMM_MAX_BATCH_SIZE", 64))
16+
max_batch_size = int(os.environ.get("KERNEL_EXPLORER_BATCHED_GEMM_MAX_BATCH_SIZE", "64"))
1717

1818

1919
def multinormal_distribution(num_distribution, num_element_per_dist):

onnxruntime/python/tools/kernel_explorer/kernels/strided_batched_gemm_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import pytest
1313
from utils import get_gemm_basic_sizes, get_gemm_bert_sizes, get_gemm_bound, matmul, transab_to_suffix
1414

15-
max_batch_size = int(os.environ.get("KERNEL_EXPLORER_BATCHED_GEMM_MAX_BATCH_SIZE", 64))
15+
max_batch_size = int(os.environ.get("KERNEL_EXPLORER_BATCHED_GEMM_MAX_BATCH_SIZE", "64"))
1616

1717

1818
def dtype_to_suffix(dtype):

onnxruntime/python/tools/quantization/calibrate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ def compute_percentile(self):
992992
thresholds_dict[tensor] = (thresholds_dict[tensor][0], max_value)
993993
thresholds_dict[tensor] = (*thresholds_dict[tensor], *hist[:2])
994994
# Plot histogram for debug only
995-
if os.environ.get("QUANTIZATION_DEBUG", 0) in (1, "1"):
995+
if os.environ.get("QUANTIZATION_DEBUG", "0") in (1, "1"):
996996
apply_plot(hist, hist_edges)
997997

998998
return thresholds_dict
@@ -1013,7 +1013,7 @@ def compute_entropy(self):
10131013
thresholds_dict[tensor] = (*optimal_threshold, *histogram[:2])
10141014

10151015
# Plot histogram for debug only
1016-
if os.environ.get("QUANTIZATION_DEBUG", 0) in (1, "1"):
1016+
if os.environ.get("QUANTIZATION_DEBUG", "0") in (1, "1"):
10171017
apply_plot(histogram[0], histogram[1])
10181018

10191019
return thresholds_dict
@@ -1075,7 +1075,7 @@ def compute_distribution(self):
10751075
)
10761076

10771077
# Plot histogram for debug only
1078-
if os.environ.get("QUANTIZATION_DEBUG", 0) in (1, "1"):
1078+
if os.environ.get("QUANTIZATION_DEBUG", "0") in (1, "1"):
10791079
apply_plot(hist, hist_edges)
10801080

10811081
return thresholds_dict

onnxruntime/python/tools/quantization/matmul_bnb4_quantizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def _process_subgraph(self, graph_stack: list[GraphProto]):
138138
for attr in node.attribute
139139
if attr.type == onnx.AttributeProto.GRAPH or attr.type == onnx.AttributeProto.GRAPHS
140140
]
141-
if len(graph_attrs):
141+
if graph_attrs:
142142
kwargs = {}
143143
for attr in node.attribute:
144144
if attr.type == onnx.AttributeProto.GRAPH:

onnxruntime/python/tools/quantization/matmul_nbits_quantizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ def _process_subgraph(self, graph_stack: list[GraphProto]):
11811181
for attr in node.attribute
11821182
if attr.type == onnx.AttributeProto.GRAPH or attr.type == onnx.AttributeProto.GRAPHS
11831183
]
1184-
if len(graph_attrs):
1184+
if graph_attrs:
11851185
kwargs = {}
11861186
for attr in node.attribute:
11871187
if attr.type == onnx.AttributeProto.GRAPH:

onnxruntime/python/tools/quantization/onnx_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def __replace_gemm_with_matmul(graph_path):
342342
graph = graph_path[-1]
343343
for node in graph.node:
344344
graph_attrs = [attr for attr in node.attribute if attr.type == 5 or attr.type == 10]
345-
if len(graph_attrs):
345+
if graph_attrs:
346346
kwargs = {}
347347
for attr in node.attribute:
348348
if attr.type == 5:

onnxruntime/python/tools/quantization/onnx_quantizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __init__(
8585
self.tensor_names.update({ot.name: 1 for ot in model.graph.output})
8686
self.tensor_names.update({it.name: 1 for it in model.graph.input})
8787
for node in self.model.model.graph.node:
88-
self.tensor_names.update({output_name: 1 for output_name in node.output})
88+
self.tensor_names.update(dict.fromkeys(node.output, 1))
8989

9090
if self.mode not in QuantizationMode:
9191
raise ValueError(f"unsupported quantization mode {self.mode}")

onnxruntime/python/tools/quantization/operators/gemm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@
1919

2020
def is_B_transposed(gemm_node): # noqa: N802
2121
transB_attribute = [attr for attr in gemm_node.attribute if attr.name == "transB"] # noqa: N806
22-
if len(transB_attribute):
22+
if transB_attribute:
2323
return onnx.helper.get_attribute_value(transB_attribute[0]) > 0
2424

2525
return False
2626

2727

2828
def get_beta(gemm_node):
2929
beta_attribute = [attr for attr in gemm_node.attribute if attr.name == "beta"]
30-
if len(beta_attribute):
30+
if beta_attribute:
3131
return onnx.helper.get_attribute_value(beta_attribute[0])
3232

3333
return 1.0
3434

3535

3636
def set_default_beta(gemm_node):
3737
beta_attribute = [attr for attr in gemm_node.attribute if attr.name == "beta"]
38-
if len(beta_attribute):
38+
if beta_attribute:
3939
beta_attribute[0].f = 1.0
4040

4141
return 1.0

0 commit comments

Comments
 (0)