Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve or ignore Ruff and Pylint warnings #1825

Merged
merged 34 commits into from
Jul 26, 2024
Merged

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Jul 25, 2024

Ignoring warnings related to TODO and FIXME comments:

python -m pylint python/ --disable W0511

This is a lot, but I think it would help us to ratchet up code quality ahead of merging async.

@mattt mattt requested a review from a team July 25, 2024 13:11
python/cog/predictor.py Outdated Show resolved Hide resolved
python/cog/predictor.py Outdated Show resolved Hide resolved
@@ -518,17 +521,18 @@ def train(
if name == "TrainingOutput":
return TrainingOutputType

if name == "Output":
if name == "Output": # pylint: disable=no-else-return
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth calling out that the else is used here to avoid a warning about redefinition of TrainingOutput.

Comment on lines -27 to +30
f"Failed to create cog runtime state directory ({self._root}). "
"Failed to create cog runtime state directory (%s). "
"Does it already exist and is a file? Does the user running cog "
"have permissions?"
"have permissions?",
self._root,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagging this as a nontrivial change.

from requests.packages.urllib3.util.retry import Retry # type: ignore
from urllib3.util.retry import Retry
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python/cog/types.py Outdated Show resolved Hide resolved
python/cog/types.py Outdated Show resolved Hide resolved
mattt added 22 commits July 25, 2024 10:51
…se your program to hang indefinitely (missing-timeout)
…se your program to hang indefinitely (missing-timeout)
…ot overridden in child class 'ConcatenateIterator' (abstract-method)
…n expression, or none of them should. (inconsistent-return-statements)
…sed_url.scheme in ('http', 'https')'. Use a set instead if elements are hashable. (consider-using-in)
@mattt mattt force-pushed the mattt/fix-pylint-warnings branch from 49b241b to 9078eb2 Compare July 25, 2024 17:53
@mattt mattt changed the title Resolve or ignore pylint warnings Resolve or ignore Pylint warnings Jul 25, 2024
@technillogue
Copy link
Contributor

are we using both pylint and ruff now?

mattt added 2 commits July 26, 2024 06:12
…ations (consider-using-with)"

Ignore warning instead

This reverts commit 46ed734.
…but is not overridden in child class 'ConcatenateIterator' (abstract-method)"

Ignore warning instead

This reverts commit f1ae4b6.
@mattt
Copy link
Contributor Author

mattt commented Jul 26, 2024

are we using both pylint and ruff now?

@technillogue Yes. And Pyright, too. Taking a belt and suspenders and chainmail approach, I suppose.

@mattt mattt changed the title Resolve or ignore Pylint warnings Resolve or ignore Ruff and Pylint warnings Jul 26, 2024
@mattt mattt merged commit d8a81ef into main Jul 26, 2024
12 checks passed
@mattt mattt deleted the mattt/fix-pylint-warnings branch July 26, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants