diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9234591..b3973ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-added-large-files - id: check-toml @@ -12,18 +12,18 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.20.0 hooks: - id: pyupgrade args: - --py38-plus - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.292 + rev: v0.12.7 hooks: - id: ruff args: - --fix - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 25.1.0 hooks: - id: black diff --git a/examples/flask/app.py b/examples/flask/app.py index 3e3d4d8..a25ebc7 100644 --- a/examples/flask/app.py +++ b/examples/flask/app.py @@ -18,9 +18,9 @@ db = SQLAlchemy(engine_options={"echo": True}) app = Flask(__name__) -app.config[ - "SQLALCHEMY_DATABASE_URI" -] = "sqlite:////tmp/example.db?check_same_thread=False" +app.config["SQLALCHEMY_DATABASE_URI"] = ( + "sqlite:////tmp/example.db?check_same_thread=False" +) db.init_app(app) diff --git a/sqlalchemy_file/__init__.py b/sqlalchemy_file/__init__.py index 929a321..17bf48c 100644 --- a/sqlalchemy_file/__init__.py +++ b/sqlalchemy_file/__init__.py @@ -1,5 +1,5 @@ __version__ = "0.6.0" -from .file import File as File # noqa -from .types import FileField as FileField # noqa -from .types import ImageField as ImageField # noqa +from .file import File as File +from .types import FileField as FileField +from .types import ImageField as ImageField diff --git a/sqlalchemy_file/storage.py b/sqlalchemy_file/storage.py index 95e66ce..8151dc9 100644 --- a/sqlalchemy_file/storage.py +++ b/sqlalchemy_file/storage.py @@ -93,7 +93,7 @@ def save_file( if ( container.driver.name == LOCAL_STORAGE_DRIVER_NAME and extra is not None - and extra.get("meta_data", None) is not None + and extra.get("meta_data") is not None ): """ Libcloud local storage driver doesn't support metadata, so the metadata diff --git a/tests/test_multiple_field.py b/tests/test_multiple_field.py index fe75916..998ddd2 100644 --- a/tests/test_multiple_field.py +++ b/tests/test_multiple_field.py @@ -36,11 +36,7 @@ class Attachment(Base): multiple_content = Column(FileField(multiple=True)) def __repr__(self): - return "".format( - self.id, - self.name, - self.multiple_content, - ) # pragma: no cover + return f"" # pragma: no cover class TestMultipleField: diff --git a/tests/test_result_value.py b/tests/test_result_value.py index aa36c35..623803c 100644 --- a/tests/test_result_value.py +++ b/tests/test_result_value.py @@ -33,12 +33,7 @@ class Attachment(Base): ) def __repr__(self): - return "".format( - self.id, - self.name, - self.content, - self.multiple_content, - ) # pragma: no cover + return f"" # pragma: no cover class TestResultValue: diff --git a/tests/test_single_field.py b/tests/test_single_field.py index 5f3ca37..ac258f0 100644 --- a/tests/test_single_field.py +++ b/tests/test_single_field.py @@ -37,12 +37,7 @@ class Attachment(Base): article_id = Column(Integer, ForeignKey("article.id")) def __repr__(self): - return "".format( - self.id, - self.name, - self.content, - self.article_id, - ) # pragma: no cover + return f"" # pragma: no cover class Article(Base):