mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
chore(deps): bump pre-commit tools/libs
Prep for python 3.12 Reformat files with latest pre-commit tools Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
parent
3220cf886e
commit
c6a530f24f
28 changed files with 33 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.4.0
|
rev: v4.5.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
|
@ -12,7 +12,7 @@ repos:
|
||||||
- id: debug-statements
|
- id: debug-statements
|
||||||
|
|
||||||
- repo: https://github.com/myint/autoflake
|
- repo: https://github.com/myint/autoflake
|
||||||
rev: v2.0.1
|
rev: v2.3.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: autoflake
|
- id: autoflake
|
||||||
args:
|
args:
|
||||||
|
@ -21,16 +21,16 @@ repos:
|
||||||
- --ignore-init-module-imports
|
- --ignore-init-module-imports
|
||||||
|
|
||||||
- repo: https://github.com/pycqa/isort
|
- repo: https://github.com/pycqa/isort
|
||||||
rev: 5.12.0
|
rev: 5.13.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 23.1.0
|
rev: 24.4.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/flake8
|
- repo: https://github.com/PyCQA/flake8
|
||||||
rev: 6.0.0
|
rev: 7.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
""" This module consists of aurweb's CAPTCHA utility functions and filters. """
|
""" This module consists of aurweb's CAPTCHA utility functions and filters. """
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
from jinja2 import pass_context
|
from jinja2 import pass_context
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
""" Collection of all aurweb SQLAlchemy declarative models. """
|
""" Collection of all aurweb SQLAlchemy declarative models. """
|
||||||
|
|
||||||
from .accepted_term import AcceptedTerm # noqa: F401
|
from .accepted_term import AcceptedTerm # noqa: F401
|
||||||
from .account_type import AccountType # noqa: F401
|
from .account_type import AccountType # noqa: F401
|
||||||
from .api_rate_limit import ApiRateLimit # noqa: F401
|
from .api_rate_limit import ApiRateLimit # noqa: F401
|
||||||
|
|
|
@ -3,6 +3,7 @@ API routers for FastAPI.
|
||||||
|
|
||||||
See https://fastapi.tiangolo.com/tutorial/bigger-applications/
|
See https://fastapi.tiangolo.com/tutorial/bigger-applications/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from . import (
|
from . import (
|
||||||
accounts,
|
accounts,
|
||||||
auth,
|
auth,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
""" AURWeb's primary routing module. Define all routes via @app.app.{get,post}
|
""" AURWeb's primary routing module. Define all routes via @app.app.{get,post}
|
||||||
decorators in some way; more complex routes should be defined in their
|
decorators in some way; more complex routes should be defined in their
|
||||||
own modules and imported here. """
|
own modules and imported here. """
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ OpenAPI Routes:
|
||||||
OpenAPI example (version 5): /rpc/v5/info/my-package
|
OpenAPI example (version 5): /rpc/v5/info/my-package
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import re
|
import re
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
|
@ -5,7 +5,6 @@ Changes here should always be accompanied by an Alembic migration, which can be
|
||||||
usually be automatically generated. See `migrations/README` for details.
|
usually be automatically generated. See `migrations/README` for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from sqlalchemy import (
|
from sqlalchemy import (
|
||||||
CHAR,
|
CHAR,
|
||||||
TIMESTAMP,
|
TIMESTAMP,
|
||||||
|
|
|
@ -6,6 +6,7 @@ See `aurweb-adduser --help` for documentation.
|
||||||
Copyright (C) 2022 aurweb Development Team
|
Copyright (C) 2022 aurweb Development Team
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
|
|
@ -3,6 +3,7 @@ Perform an action on the aurweb config.
|
||||||
|
|
||||||
When AUR_CONFIG_IMMUTABLE is set, the `set` action is noop.
|
When AUR_CONFIG_IMMUTABLE is set, the `set` action is noop.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -7,7 +7,6 @@ This module uses a global state, since you can’t open two servers with the sam
|
||||||
configuration anyway.
|
configuration anyway.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import atexit
|
import atexit
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -6,6 +6,7 @@ out of form data from /account/register or /account/{username}/edit.
|
||||||
All functions in this module raise aurweb.exceptions.ValidationError
|
All functions in this module raise aurweb.exceptions.ValidationError
|
||||||
when encountering invalid criteria and return silently otherwise.
|
when encountering invalid criteria and return silently otherwise.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from fastapi import Request
|
from fastapi import Request
|
||||||
from sqlalchemy import and_
|
from sqlalchemy import and_
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ Revises: ef39fcd6e1cd
|
||||||
Create Date: 2021-05-17 14:23:00.008479
|
Create Date: 2021-05-17 14:23:00.008479
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
|
|
||||||
import aurweb.config
|
import aurweb.config
|
||||||
|
|
|
@ -5,6 +5,7 @@ Revises: d64e5571bc8d
|
||||||
Create Date: 2022-09-22 18:08:03.280664
|
Create Date: 2022-09-22 18:08:03.280664
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
from sqlalchemy.exc import OperationalError
|
from sqlalchemy.exc import OperationalError
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ Revises: c5a6a9b661a0
|
||||||
Create Date: 2023-09-01 13:48:15.315244
|
Create Date: 2023-09-01 13:48:15.315244
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from aurweb import db
|
from aurweb import db
|
||||||
from aurweb.models import AccountType
|
from aurweb.models import AccountType
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ Revises: 6a64dd126029
|
||||||
Create Date: 2023-09-10 10:21:33.092342
|
Create Date: 2023-09-10 10:21:33.092342
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
from sqlalchemy.dialects.mysql import INTEGER
|
from sqlalchemy.dialects.mysql import INTEGER
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ Revises: 6441d3b65270
|
||||||
Create Date: 2022-10-17 11:11:46.203322
|
Create Date: 2022-10-17 11:11:46.203322
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
|
|
|
@ -15,6 +15,7 @@ Revision ID: be7adae47ac3
|
||||||
Revises: 56e2ce8e2ffa
|
Revises: 56e2ce8e2ffa
|
||||||
Create Date: 2022-01-06 14:37:07.899778
|
Create Date: 2022-01-06 14:37:07.899778
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
from sqlalchemy.dialects.mysql import INTEGER, TINYINT
|
from sqlalchemy.dialects.mysql import INTEGER, TINYINT
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ Revises: e4e49ffce091
|
||||||
Create Date: 2023-07-02 13:46:52.522146
|
Create Date: 2023-07-02 13:46:52.522146
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
|
|
|
@ -5,6 +5,7 @@ Revises: be7adae47ac3
|
||||||
Create Date: 2022-02-18 12:47:05.322766
|
Create Date: 2022-02-18 12:47:05.322766
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
|
@ -5,6 +5,7 @@ Revises: 9e3158957fd7
|
||||||
Create Date: 2023-04-19 23:24:25.854874
|
Create Date: 2023-04-19 23:24:25.854874
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
from sqlalchemy.exc import OperationalError
|
from sqlalchemy.exc import OperationalError
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ Revises: f47cad5d6d03
|
||||||
Create Date: 2020-06-08 10:04:13.898617
|
Create Date: 2020-06-08 10:04:13.898617
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from alembic import op
|
from alembic import op
|
||||||
from sqlalchemy.engine.reflection import Inspector
|
from sqlalchemy.engine.reflection import Inspector
|
||||||
|
|
|
@ -4,6 +4,7 @@ Revision ID: f47cad5d6d03
|
||||||
Create Date: 2020-02-23 13:23:32.331396
|
Create Date: 2020-02-23 13:23:32.331396
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = "f47cad5d6d03"
|
revision = "f47cad5d6d03"
|
||||||
down_revision = None
|
down_revision = None
|
||||||
|
|
|
@ -37,6 +37,7 @@ then clears the database for each test function run in that module.
|
||||||
It is done this way because migration has a large cost; migrating
|
It is done this way because migration has a large cost; migrating
|
||||||
ahead of each function takes too long when compared to this method.
|
ahead of each function takes too long when compared to this method.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
from multiprocessing import Lock
|
from multiprocessing import Lock
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
""" A test suite used to test HTML renders in different cases. """
|
""" A test suite used to test HTML renders in different cases. """
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
""" Test our l10n module. """
|
""" Test our l10n module. """
|
||||||
|
|
||||||
from aurweb import config, filters, l10n
|
from aurweb import config, filters, l10n
|
||||||
from aurweb.testing.requests import Request
|
from aurweb.testing.requests import Request
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@ from aurweb.models.package import Package
|
||||||
from aurweb.models.package_base import PackageBase
|
from aurweb.models.package_base import PackageBase
|
||||||
from aurweb.models.user import User
|
from aurweb.models.user import User
|
||||||
|
|
||||||
user = pkgbase = package = None
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def setup(db_test):
|
def setup(db_test):
|
||||||
|
|
|
@ -144,9 +144,11 @@ def requests(
|
||||||
pkgreq = db.create(
|
pkgreq = db.create(
|
||||||
PackageRequest,
|
PackageRequest,
|
||||||
ReqTypeID=DELETION_ID,
|
ReqTypeID=DELETION_ID,
|
||||||
User=maintainer2
|
User=(
|
||||||
|
maintainer2
|
||||||
if packages[i].PackageBase.Maintainer.Username == "test_maintainer2"
|
if packages[i].PackageBase.Maintainer.Username == "test_maintainer2"
|
||||||
else user,
|
else user
|
||||||
|
),
|
||||||
PackageBase=packages[i].PackageBase,
|
PackageBase=packages[i].PackageBase,
|
||||||
PackageBaseName=packages[i].Name,
|
PackageBaseName=packages[i].Name,
|
||||||
Comments=f"Deletion request for pkg_{i}",
|
Comments=f"Deletion request for pkg_{i}",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
""" Test our Session model. """
|
""" Test our Session model. """
|
||||||
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
Loading…
Add table
Reference in a new issue