diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c69c115e..34e83163 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: ) - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.10.0 hooks: - id: black files: >- @@ -41,12 +41,12 @@ repos: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.292 + rev: v0.1.1 hooks: - id: ruff - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.0 + rev: v1.6.1 hooks: - id: mypy files: nc_py_api/ diff --git a/examples/as_app/skeleton/src/main.py b/examples/as_app/skeleton/src/main.py index 6c304126..06e8bc58 100644 --- a/examples/as_app/skeleton/src/main.py +++ b/examples/as_app/skeleton/src/main.py @@ -1,4 +1,5 @@ """Simplest example.""" + from contextlib import asynccontextmanager from fastapi import FastAPI diff --git a/examples/as_app/talk_bot/src/main.py b/examples/as_app/talk_bot/src/main.py index 7ae23596..bbafa72c 100644 --- a/examples/as_app/talk_bot/src/main.py +++ b/examples/as_app/talk_bot/src/main.py @@ -1,4 +1,5 @@ """Example of an application(currency convertor) that uses Talk Bot APIs.""" + import re from contextlib import asynccontextmanager from typing import Annotated diff --git a/examples/as_app/talk_bot_ai/src/main.py b/examples/as_app/talk_bot_ai/src/main.py index e912753c..f9cb412d 100644 --- a/examples/as_app/talk_bot_ai/src/main.py +++ b/examples/as_app/talk_bot_ai/src/main.py @@ -1,4 +1,5 @@ """Example of an application that uses Python Transformers library with Talk Bot APIs.""" + import re from contextlib import asynccontextmanager from typing import Annotated diff --git a/examples/as_app/to_gif/src/main.py b/examples/as_app/to_gif/src/main.py index 5ae14493..0d02d664 100644 --- a/examples/as_app/to_gif/src/main.py +++ b/examples/as_app/to_gif/src/main.py @@ -1,4 +1,5 @@ """Simplest example of files_dropdown_menu + notification.""" + import tempfile from contextlib import asynccontextmanager from os import path diff --git a/nc_py_api/_deffered_error.py b/nc_py_api/_deffered_error.py index aef532e9..2176126c 100644 --- a/nc_py_api/_deffered_error.py +++ b/nc_py_api/_deffered_error.py @@ -1,6 +1,5 @@ """DeferredError class taken from PIL._util.py file.""" - class DeferredError: # pylint: disable=too-few-public-methods """Allow failing import when using it in the client mode, without `app` dependencies.""" diff --git a/nc_py_api/_exceptions.py b/nc_py_api/_exceptions.py index dc07e324..c0c4551c 100644 --- a/nc_py_api/_exceptions.py +++ b/nc_py_api/_exceptions.py @@ -1,4 +1,5 @@ """Exceptions for the Nextcloud API.""" + from httpx import codes diff --git a/nc_py_api/_misc.py b/nc_py_api/_misc.py index 66dfc6f1..2ca5ab73 100644 --- a/nc_py_api/_misc.py +++ b/nc_py_api/_misc.py @@ -2,6 +2,7 @@ For internal use, prototypes can change between versions. """ + import secrets from base64 import b64decode from datetime import datetime, timezone diff --git a/nc_py_api/_preferences_ex.py b/nc_py_api/_preferences_ex.py index fc1a4908..93d0f3d1 100644 --- a/nc_py_api/_preferences_ex.py +++ b/nc_py_api/_preferences_ex.py @@ -1,4 +1,5 @@ """Nextcloud API for working with apps V2's storage w/wo user context(table oc_appconfig_ex/oc_preferences_ex).""" + import dataclasses import typing diff --git a/nc_py_api/_session.py b/nc_py_api/_session.py index 8072c58f..b182bc81 100644 --- a/nc_py_api/_session.py +++ b/nc_py_api/_session.py @@ -1,4 +1,5 @@ """Session represents one connection to Nextcloud. All related stuff for these live here.""" + import typing from abc import ABC, abstractmethod from base64 import b64encode diff --git a/nc_py_api/ex_app/__init__.py b/nc_py_api/ex_app/__init__.py index cb698766..ec19daa7 100644 --- a/nc_py_api/ex_app/__init__.py +++ b/nc_py_api/ex_app/__init__.py @@ -1,4 +1,5 @@ """All possible ExApp stuff for NextcloudApp that can be used.""" + from .defs import ApiScope, LogLvl from .integration_fastapi import nc_app, set_handlers, talk_bot_app from .misc import persistent_storage, verify_version diff --git a/nc_py_api/ex_app/ui/files.py b/nc_py_api/ex_app/ui/files.py index 1406dfb9..571dd0aa 100644 --- a/nc_py_api/ex_app/ui/files.py +++ b/nc_py_api/ex_app/ui/files.py @@ -1,4 +1,5 @@ """Nextcloud API for working with drop-down file's menu.""" + import os import typing from datetime import datetime, timezone diff --git a/nc_py_api/ex_app/uvicorn_fastapi.py b/nc_py_api/ex_app/uvicorn_fastapi.py index c3be8942..40e64c2c 100644 --- a/nc_py_api/ex_app/uvicorn_fastapi.py +++ b/nc_py_api/ex_app/uvicorn_fastapi.py @@ -1,4 +1,5 @@ """Uvicorn wrappers to run the external application.""" + import typing from os import environ diff --git a/nc_py_api/nextcloud.py b/nc_py_api/nextcloud.py index 0efa2a1a..07a1afdd 100644 --- a/nc_py_api/nextcloud.py +++ b/nc_py_api/nextcloud.py @@ -1,4 +1,5 @@ """Nextcloud class providing access to all API endpoints.""" + from abc import ABC from typing import Optional, Union diff --git a/nc_py_api/options.py b/nc_py_api/options.py index 09ac8cc1..7f19f7e2 100644 --- a/nc_py_api/options.py +++ b/nc_py_api/options.py @@ -3,6 +3,7 @@ Each setting only affects newly created instances of **Nextcloud**/**NextcloudApp** class, unless otherwise specified. Specifying options in **kwargs** has higher priority than this. """ + import typing from os import environ diff --git a/nc_py_api/talk_bot.py b/nc_py_api/talk_bot.py index da537dad..16b99a1a 100644 --- a/nc_py_api/talk_bot.py +++ b/nc_py_api/talk_bot.py @@ -1,4 +1,5 @@ """Nextcloud Talk API for bots.""" + import dataclasses import hashlib import hmac