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

[pre-commit.ci] pre-commit autoupdate #2997

Closed pre-commit-ci[bot] closed 1 month ago

pre-commit-ci[bot] commented 1 month ago

updates:

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 99.63%. Comparing base (1bb98ae) to head (25995e1).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2997 +/- ## ======================================= Coverage 99.63% 99.63% ======================================= Files 117 117 Lines 17593 17593 Branches 3173 3173 ======================================= Hits 17528 17528 Misses 46 46 Partials 19 19 ``` | [Files](https://app.codecov.io/gh/python-trio/trio/pull/2997?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/\_abc.py](https://app.codecov.io/gh/python-trio/trio/pull/2997?src=pr&el=tree&filepath=src%2Ftrio%2F_abc.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX2FiYy5weQ==) | `100.00% <100.00%> (ø)` | |
CoolCat467 commented 1 month ago

Interesting new error:

src/trio/_abc.py:71:7: B024 `Instrument` is an abstract base class, but it has no abstract methods
A5rocks commented 1 month ago

I think we should silence the lint. It's conceptually an abstract base class and therefore is documented as if it is one.

(Maybe just at that one line. I can imagine scenarios where the lint being tripped is a sign of a bad change.)

jakkdl commented 1 month ago

Interesting new error:

src/trio/_abc.py:71:7: B024 `Instrument` is an abstract base class, but it has no abstract methods

Ooh, I'm the author of that one in flake8-bugbear! But yeah it has a bunch of known false positives, this being one of them: a class never meant to be instantiated, but subclasses don't have to override any of its methods.

It looks like ruff's description is much more assertive:

Why is this bad?

Abstract base classes are used to define interfaces. If they have no abstract methods, they are not useful.

If the class is not meant to be used as an interface, it should not be an abstract base class. Remove the ABC base class from the class definition, or add an abstract method to the class.

than the original description in flake8-bugbear:

B024: Abstract base class has methods, but none of them are abstract. This is not necessarily an error, but you might have forgotten to add the @abstractmethod decorator, potentially in conjunction with @classmethod, @property and/or @staticmethod.

I'll go open an issue