Skip to content

Commit

Permalink
Merge pull request #81 from praw-dev/clean-up
Browse files Browse the repository at this point in the history
Clean up code, update workflows, fix ruff issues
  • Loading branch information
LilSpazJoekp committed Aug 12, 2024
2 parents c016f08 + eb19b70 commit a1fd9d2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 47 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/codeql.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ jobs:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: pip
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jobs:
analysis:
name: Scorecards analysis
name: Scorecard analysis
permissions:
id-token: write
security-events: write
Expand All @@ -23,14 +23,14 @@ jobs:
path: results.sarif
retention-days: 5
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
name: Scorecards supply-chain security
name: Scorecard supply-chain security
on:
branch_protection_rule:
push:
branches: [ main ]
schedule:
- cron: 30 1 * * 6
permissions: read-all
- cron: 0 15 * * 1
permissions: read-all
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
files: ^(.*\.toml)$

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.5.7
hooks:
- id: ruff
args: [ --exit-non-zero-on-fix, --fix ]
Expand All @@ -33,10 +33,10 @@ repos:
- repo: https://github.com/psf/black
hooks:
- id: black
rev: 24.4.2
rev: 24.8.0

- repo: https://github.com/LilSpazJoekp/docstrfmt
hooks:
- id: docstrfmt
require_serial: true
rev: v1.6.1
rev: v1.8.0
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Unreleased

- Drop support for Python 3.6, which is end-of-life on 2021-12-23.
- :class:`DeviceIDAuthorizer` can be now used with :class:`TrustedAuthenticator`.
- Updated rate limit algorithm to better handle reddit's new rate limits.
- Updated rate limit algorithm to better handle Reddit's new rate limits.
- Drop support for Python 3.7, which is end-of-life on 2023-06-27.

2.3.0 (2021/07/27)
Expand Down
2 changes: 1 addition & 1 deletion asyncprawcore/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async def revoke_token(self, token: str, token_type: str | None = None):
await self._post(url, **data)


class BaseAuthorizer(ABC):
class BaseAuthorizer:
"""Superclass for OAuth2 authorization tokens and scopes."""

AUTHENTICATOR_CLASS: tuple | type = BaseAuthenticator
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ target-version = "py38"
include = [
"asyncprawcore/*.py"
]

[tool.ruff.lint]
ignore = [
"A002", # shadowing built-in
"ANN101", # missing type annotation for self in method
Expand Down Expand Up @@ -128,13 +130,12 @@ 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"]

0 comments on commit a1fd9d2

Please sign in to comment.