Skip to content

Commit

Permalink
Merge pull request #68 from praw-dev/upgrade_setup
Browse files Browse the repository at this point in the history
Upgrade setup
  • Loading branch information
LilSpazJoekp authored Nov 27, 2023
2 parents 19d011b + 023e457 commit c7a9fd9
Show file tree
Hide file tree
Showing 80 changed files with 8,571 additions and 4,636 deletions.
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

55 changes: 28 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
exclude: .*\.txt
rev: v4.5.0
- id: mixed-line-ending
args: [ --fix=no ]
- id: name-tests-test
args: [ --pytest-test-first ]
files: ^tests/integration/.*\.py|tests/unit/.*\.py$
- id: sort-simple-yaml
files: ^(\.github/workflows/.*\.ya?ml|\.readthedocs.ya?ml)$
- id: trailing-whitespace

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
files: ^(.*\.toml)$

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.290
hooks:
- id: ruff
args: [ --exit-non-zero-on-fix, --fix ]
files: ^(asyncprawcore/.*.py)$

- repo: https://github.com/psf/black
hooks:
Expand All @@ -14,28 +38,5 @@ repos:
- repo: https://github.com/LilSpazJoekp/docstrfmt
hooks:
- id: docstrfmt
require_serial: true
rev: v1.5.1

- repo: https://github.com/pycqa/flake8
hooks:
- id: flake8
rev: 6.1.0

- repo: https://github.com/ikamensh/flynt/
hooks:
- id: flynt
args:
- '-ll'
- '1000'
rev: '1.0.1'

- repo: https://github.com/pycqa/isort
hooks:
- id: isort
rev: 5.12.0

- repo: https://github.com/pycqa/pydocstyle
hooks:
- id: pydocstyle
files: asyncprawcore/.*
rev: 6.3.0
4 changes: 2 additions & 2 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ Maintainers
===========

- Joel Payne <[email protected]> `@LilSpazJoekp <https://github.com/LilSpazJoekp>`_
- Vikramaditya Gaonkar <[email protected]> `@vikramaditya91
<https://github.com/vikramaditya91>`_

Contributors
============
Expand All @@ -13,6 +11,8 @@ Contributors
- Zeerak Waseem <[email protected]> `@ZeerakW <https://github.com/ZeerakW>`_
- jarhill0 `@jarhill0 <https://github.com/jarhill0>`_
- Watchful1 `@Watchful1 <https://github.com/Watchful1>`_
- Vikramaditya Gaonkar <[email protected]> `@vikramaditya91
<https://github.com/vikramaditya91>`_
- PythonCoderAS `@PythonCoderAS <https://github.com/PythonCoderAS>`_
- MaybeNetwork `@MaybeNetwork <https://github.com/MaybeNetwork>`_
- Add "Name <email (optional)> and github profile link" above this line.
15 changes: 7 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ asyncprawcore
:alt: Black code style
:target: https://github.com/psf/black

asyncprawcore is a low-level communication layer for PRAW 4+.
asyncprawcore is a low-level communication layer used by Async PRAW 7+.

Installation
------------
Expand All @@ -55,8 +55,8 @@ Execution Example

The following example demonstrates how to use asyncprawcore to obtain the list of
trophies for a given user using the script-app type. This example assumes you have the
environment variables ``asyncprawcore_CLIENT_ID`` and ``asyncprawcore_CLIENT_SECRET``
set to the appropriate values for your application.
environment variables ``PRAWCORE_CLIENT_ID`` and ``PRAWCORE_CLIENT_SECRET`` set to the
appropriate values for your application.

.. code-block:: python
Expand All @@ -69,8 +69,8 @@ set to the appropriate values for your application.
async def main():
authenticator = asyncprawcore.TrustedAuthenticator(
asyncprawcore.Requestor("YOUR_VALID_USER_AGENT"),
os.environ["asyncprawcore_CLIENT_ID"],
os.environ["asyncprawcore_CLIENT_SECRET"],
os.environ["PRAWCORE_CLIENT_ID"],
os.environ["PRAWCORE_CLIENT_SECRET"],
)
authorizer = asyncprawcore.ReadOnlyAuthorizer(authenticator)
await authorizer.refresh()
Expand All @@ -80,8 +80,7 @@ set to the appropriate values for your application.
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
Save the above as ``trophies.py`` and then execute via:

Expand All @@ -95,7 +94,7 @@ https://github.com/praw-dev/asyncprawcore/tree/main/examples
Depending on asyncprawcore
--------------------------

asyncprawcore follows `semantic versioning <http://semver.org/>`_ with the exception
asyncprawcore follows `semantic versioning <https://semver.org/>`_ with the exception
that deprecations will not be preceded by a minor release. In essence, expect only major
versions to introduce breaking changes to asyncprawcore's public interface. As a result,
if you depend on asyncprawcore then it is a good idea to specify not only the minimum
Expand Down
12 changes: 6 additions & 6 deletions asyncprawcore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""asyncprawcore: Low-level asynchronous communication layer for Async PRAW 7+."""
"""Low-level asynchronous communication layer for Async PRAW 7+."""

import logging

from .auth import ( # noqa
from .auth import (
Authorizer,
DeviceIDAuthorizer,
ImplicitAuthorizer,
Expand All @@ -11,9 +11,9 @@
TrustedAuthenticator,
UntrustedAuthenticator,
)
from .const import __version__ # noqa
from .exceptions import * # noqa
from .requestor import Requestor # noqa
from .sessions import Session, session # noqa
from .const import __version__
from .exceptions import * # noqa: F403
from .requestor import Requestor
from .sessions import Session, session

logging.getLogger(__package__).addHandler(logging.NullHandler())
Loading

0 comments on commit c7a9fd9

Please sign in to comment.