python-trio / trio

Trio – a friendly Python library for async concurrency and I/O
https://trio.readthedocs.io
Other
5.98k stars 325 forks source link

Enable ruff's Perflint rule. #2969

Closed CoolCat467 closed 1 month ago

CoolCat467 commented 3 months ago

This pull request enables ruff's perflint rule and handles the associated fixes or ignores.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.63%. Comparing base (7dbbac9) to head (41ee2a8).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2969 +/- ## ========================================== - Coverage 99.63% 99.63% -0.01% ========================================== Files 117 117 Lines 17593 17578 -15 Branches 3173 3172 -1 ========================================== - Hits 17528 17513 -15 Misses 46 46 Partials 19 19 ``` | [Files](https://app.codecov.io/gh/python-trio/trio/pull/2969?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio) | Coverage Δ | | |---|---|---| | [src/trio/\_core/\_tests/test\_run.py](https://app.codecov.io/gh/python-trio/trio/pull/2969?src=pr&el=tree&filepath=src%2Ftrio%2F_core%2F_tests%2Ftest_run.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX2NvcmUvX3Rlc3RzL3Rlc3RfcnVuLnB5) | `100.00% <100.00%> (ø)` | | | [src/trio/\_subprocess.py](https://app.codecov.io/gh/python-trio/trio/pull/2969?src=pr&el=tree&filepath=src%2Ftrio%2F_subprocess.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3N1YnByb2Nlc3MucHk=) | `100.00% <100.00%> (ø)` | | | [src/trio/\_tests/test\_channel.py](https://app.codecov.io/gh/python-trio/trio/pull/2969?src=pr&el=tree&filepath=src%2Ftrio%2F_tests%2Ftest_channel.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3Rlc3RzL3Rlc3RfY2hhbm5lbC5weQ==) | `100.00% <100.00%> (ø)` | | | [src/trio/\_tests/test\_exports.py](https://app.codecov.io/gh/python-trio/trio/pull/2969?src=pr&el=tree&filepath=src%2Ftrio%2F_tests%2Ftest_exports.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3Rlc3RzL3Rlc3RfZXhwb3J0cy5weQ==) | `99.61% <100.00%> (ø)` | | | [src/trio/\_tests/test\_file\_io.py](https://app.codecov.io/gh/python-trio/trio/pull/2969?src=pr&el=tree&filepath=src%2Ftrio%2F_tests%2Ftest_file_io.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3Rlc3RzL3Rlc3RfZmlsZV9pby5weQ==) | `100.00% <100.00%> (ø)` | | | [src/trio/\_tests/test\_scheduler\_determinism.py](https://app.codecov.io/gh/python-trio/trio/pull/2969?src=pr&el=tree&filepath=src%2Ftrio%2F_tests%2Ftest_scheduler_determinism.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3Rlc3RzL3Rlc3Rfc2NoZWR1bGVyX2RldGVybWluaXNtLnB5) | `100.00% <100.00%> (ø)` | | | [src/trio/\_tests/test\_socket.py](https://app.codecov.io/gh/python-trio/trio/pull/2969?src=pr&el=tree&filepath=src%2Ftrio%2F_tests%2Ftest_socket.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3Rlc3RzL3Rlc3Rfc29ja2V0LnB5) | `100.00% <100.00%> (ø)` | | | [src/trio/\_tools/gen\_exports.py](https://app.codecov.io/gh/python-trio/trio/pull/2969?src=pr&el=tree&filepath=src%2Ftrio%2F_tools%2Fgen_exports.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3Rvb2xzL2dlbl9leHBvcnRzLnB5) | `99.15% <100.00%> (-0.02%)` | :arrow_down: | | [src/trio/\_unix\_pipes.py](https://app.codecov.io/gh/python-trio/trio/pull/2969?src=pr&el=tree&filepath=src%2Ftrio%2F_unix_pipes.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX3VuaXhfcGlwZXMucHk=) | `100.00% <100.00%> (ø)` | |
CoolCat467 commented 1 month ago

Updating branch to see if any changes with new ruff versions

CoolCat467 commented 1 month ago

pre-commit.ci autofix

CoolCat467 commented 1 month ago

Given that https://github.com/astral-sh/ruff/issues/11316 is still open, I am thinking of merging this soon unless anyone has any other comments.