Skip to content

Commit

Permalink
Merge pull request #2019 from praw-dev/fixes
Browse files Browse the repository at this point in the history
Minor fixes to get builds working again
  • Loading branch information
bboe authored Apr 12, 2024
2 parents f9bc804 + 8d72edd commit e1b1b08
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
types: [ python ]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-executables-have-shebangs
Expand All @@ -42,7 +42,7 @@ repos:
files: ^(.*\.toml)$

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.3.5
hooks:
- id: ruff
args: [ --exit-non-zero-on-fix, --fix ]
Expand All @@ -51,7 +51,7 @@ repos:
- repo: https://github.com/psf/black
hooks:
- id: black
rev: 24.1.1
rev: 24.3.0

- repo: https://github.com/LilSpazJoekp/docstrfmt
hooks:
Expand Down
7 changes: 0 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,3 @@ PRAW's source (v4.0.0+) is provided under the `Simplified BSD License

Earlier versions of PRAW were released under `GPLv3
<https://github.com/praw-dev/praw/blob/0c88697fdc26e75f87b68e2feb11e101e90ce215/COPYING>`_.

Sponsors
--------

.. image:: https://github.com/praw-dev/praw/blob/36fa3060b8938815feb45d07541877c8ce994cbb/docs/package_info/NucleiLogo.png
:alt: Nuclei
:target: https://nuclei.ai
6 changes: 4 additions & 2 deletions praw/models/reddit/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import TYPE_CHECKING, Any, Generator
from typing import TYPE_CHECKING, Any

from ...const import API_PATH
from ...exceptions import ClientException
Expand All @@ -14,6 +14,8 @@
from .subreddit import Subreddit

if TYPE_CHECKING: # pragma: no cover
from collections.abc import Iterator

import praw.models


Expand Down Expand Up @@ -489,7 +491,7 @@ def __init__(
"include_links": True,
}

def __iter__(self) -> Generator[Any, None, None]:
def __iter__(self) -> Iterator:
"""Provide a way to iterate over the posts in this :class:`.Collection`.
Example usage:
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ target-version = "py38"
include = [
"praw/**/*.py"
]

[tool.ruff.lint]
ignore = [
"A002", # shadowing built-in
"ANN101", # missing type annotation for self in method
Expand All @@ -97,6 +99,7 @@ ignore = [
"PLR2004", # Magic value used in comparison,
"S101" # use of assert
]
ignore-init-module-imports = true
select = [
"A", # flake8-builtins
"ANN", # flake8-annotations
Expand Down Expand Up @@ -137,14 +140,13 @@ select = [
"W", # pycodestyle warnings
"UP" # pyupgrade
]
ignore-init-module-imports = true

[tool.ruff.flake8-annotations]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
mypy-init-return = true
suppress-dummy-args = true
suppress-none-returning = true

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"praw/models/mod_notes.py" = ["FA100"]

0 comments on commit e1b1b08

Please sign in to comment.