From 0d7bfb427f9e4f84d6815f63c4764d4558c288bf Mon Sep 17 00:00:00 2001 From: NiceAesth Date: Sat, 10 Feb 2024 03:11:03 +0200 Subject: [PATCH 1/2] chore: remove `reorder-python-imports` --- .pre-commit-config.yaml | 44 ++++++++++++++++++++--------------------- pyproject.toml | 9 +++++---- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1cca608..63e2444 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,37 +1,37 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: -- repo: https://github.com/pre-commit/pre-commit-hooks + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - - id: check-ast - - id: check-builtin-literals - - id: debug-statements - - id: end-of-file-fixer - - id: requirements-txt-fixer - - id: trailing-whitespace -- repo: https://github.com/psf/black - rev: 23.10.1 + - id: check-ast + - id: check-builtin-literals + - id: debug-statements + - id: end-of-file-fixer + - id: requirements-txt-fixer + - id: trailing-whitespace + - repo: https://github.com/psf/black + rev: 24.1.1 hooks: - - id: black - language_version: python3.11 -- repo: https://github.com/asottile/pyupgrade + - id: black + language_version: python3.11 + - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 hooks: - - id: pyupgrade + - id: pyupgrade args: [--py37-plus, --keep-runtime-typing] -- repo: https://github.com/asottile/reorder-python-imports - rev: v3.12.0 + - repo: https://github.com/pycqa/isort + rev: 5.13.2 hooks: - - id: reorder-python-imports -- repo: https://github.com/asottile/add-trailing-comma + - id: isort + - repo: https://github.com/asottile/add-trailing-comma rev: v3.1.0 hooks: - - id: add-trailing-comma -- repo: https://github.com/hadialqattan/pycln - rev: v2.3.0 + - id: add-trailing-comma + - repo: https://github.com/hadialqattan/pycln + rev: v2.4.0 hooks: - - id: pycln + - id: pycln default_language_version: - python: python3.11 + python: python3.11 diff --git a/pyproject.toml b/pyproject.toml index 0c85898..4a20fde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,5 @@ [build-system] -requires = [ - "setuptools>=42", - "wheel" -] +requires = ["setuptools>=42", "wheel"] build-backend = "setuptools.build_meta" [tool.black] @@ -17,3 +14,7 @@ no_implicit_optional = true check_untyped_defs = true warn_unused_ignores = true show_error_codes = true + +[tool.isort] +force_single_line = true +profile = "black" From 430cb6036c6a7b1d0d6d03eaddf0415399f17a25 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 10 Feb 2024 01:12:19 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pomice/__init__.py | 3 ++- pomice/applemusic/__init__.py | 1 + pomice/applemusic/objects.py | 1 + pomice/events.py | 2 +- pomice/player.py | 7 ++++--- pomice/pool.py | 4 ++-- pomice/spotify/__init__.py | 1 + 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pomice/__init__.py b/pomice/__init__.py index 84b4718..eea8b25 100644 --- a/pomice/__init__.py +++ b/pomice/__init__.py @@ -7,6 +7,7 @@ Copyright (c) 2023, cloudwithax Licensed under GPL-3.0 """ + import discord if not discord.version_info.major >= 2: @@ -31,7 +32,7 @@ from .events import * from .exceptions import * from .filters import * from .objects import * -from .queue import * from .player import * from .pool import * +from .queue import * from .routeplanner import * diff --git a/pomice/applemusic/__init__.py b/pomice/applemusic/__init__.py index d1ceb72..a2349fa 100644 --- a/pomice/applemusic/__init__.py +++ b/pomice/applemusic/__init__.py @@ -1,4 +1,5 @@ """Apple Music module for Pomice, made possible by cloudwithax 2023""" + from .client import * from .exceptions import * from .objects import * diff --git a/pomice/applemusic/objects.py b/pomice/applemusic/objects.py index 75d173d..548da38 100644 --- a/pomice/applemusic/objects.py +++ b/pomice/applemusic/objects.py @@ -1,4 +1,5 @@ """Module for managing Apple Music objects""" + from typing import List __all__ = ( diff --git a/pomice/events.py b/pomice/events.py index 0dbe0b4..f27bea4 100644 --- a/pomice/events.py +++ b/pomice/events.py @@ -1,10 +1,10 @@ from __future__ import annotations from abc import ABC +from typing import TYPE_CHECKING from typing import Any from typing import Optional from typing import Tuple -from typing import TYPE_CHECKING from discord import Client from discord import Guild diff --git a/pomice/player.py b/pomice/player.py index e062456..91376ee 100644 --- a/pomice/player.py +++ b/pomice/player.py @@ -1,11 +1,11 @@ from __future__ import annotations import time +from typing import TYPE_CHECKING from typing import Any from typing import Dict from typing import List from typing import Optional -from typing import TYPE_CHECKING from typing import Union from discord import Client @@ -14,6 +14,8 @@ from discord import VoiceChannel from discord import VoiceProtocol from discord.ext import commands +from pomice.utils import LavalinkVersion + from . import events from .enums import SearchType from .events import PomiceEvent @@ -30,11 +32,10 @@ from .objects import Playlist from .objects import Track from .pool import Node from .pool import NodePool -from pomice.utils import LavalinkVersion if TYPE_CHECKING: - from discord.types.voice import VoiceServerUpdate from discord.types.voice import GuildVoiceState + from discord.types.voice import VoiceServerUpdate __all__ = ("Filters", "Player") diff --git a/pomice/pool.py b/pomice/pool.py index 64564af..cab9c50 100644 --- a/pomice/pool.py +++ b/pomice/pool.py @@ -7,12 +7,12 @@ import re import time from os import path from pathlib import Path +from typing import TYPE_CHECKING from typing import Any from typing import Dict from typing import List from typing import Optional from typing import Type -from typing import TYPE_CHECKING from typing import Union from urllib.parse import quote @@ -28,8 +28,8 @@ from websockets import typing as wstype from . import __version__ from . import applemusic from . import spotify -from .enums import * from .enums import LogLevel +from .enums import * from .exceptions import InvalidSpotifyClientAuthorization from .exceptions import LavalinkVersionIncompatible from .exceptions import NodeConnectionFailure diff --git a/pomice/spotify/__init__.py b/pomice/spotify/__init__.py index e28be28..71ca60a 100644 --- a/pomice/spotify/__init__.py +++ b/pomice/spotify/__init__.py @@ -1,4 +1,5 @@ """Spotify module for Pomice, made possible by cloudwithax 2023""" + from .client import Client from .exceptions import * from .objects import *