From 4f0b3cfbd020a4b80a0cc70d3ea2f7d3d18fd1c0 Mon Sep 17 00:00:00 2001 From: Jocelin Hounon Date: Sat, 7 Oct 2023 17:18:09 -0500 Subject: [PATCH 1/2] Update dependencies --- .pre-commit-config.yaml | 8 ++++---- pyproject.toml | 10 +++++----- sqlalchemy_file/types.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 797f90b..bae2077 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.4.0 + rev: v4.5.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.9.0 + rev: v3.15.0 hooks: - id: pyupgrade args: - --py38-plus - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.278 + rev: v0.0.292 hooks: - id: ruff args: - --fix - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: - id: black diff --git a/pyproject.toml b/pyproject.toml index 95e3ef9..d22d722 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,18 +44,18 @@ Changelog = "https://jowilf.github.io/sqlalchemy-file/changelog/" [project.optional-dependencies] test = [ "pytest >=7.2.0, <7.5.0", - "mypy ==1.4.1", - "ruff ==0.0.278", - "black ==23.7.0", + "mypy ==1.5.1", + "ruff ==0.0.292", + "black ==23.9.1", "coverage >=7.0.0, <7.4.0", - "fasteners ==0.18", + "fasteners ==0.19", "PyMySQL[rsa] >=1.0.2, <1.2.0", "psycopg2-binary >=2.9.5, <3.0.0", "Pillow >=9.4.0, <10.1.0", "python-multipart ==0.0.6", "fastapi >=0.92, <0.104", "Flask >=2.2, <2.3", - "Flask-SQLAlchemy >=3.0,<3.1" + "Flask-SQLAlchemy >=3.0,<3.2" ] doc = [ "mkdocs-material >=9.0.0, <10.0.0", diff --git a/sqlalchemy_file/types.py b/sqlalchemy_file/types.py index 69fbb7e..eb6e44a 100644 --- a/sqlalchemy_file/types.py +++ b/sqlalchemy_file/types.py @@ -95,7 +95,7 @@ def process_result_value( ) -> Union[None, MutableList[File], File]: if value is None: return None - if type(value) is dict: + if isinstance(value, dict): return ( MutableList([self.upload_type.decode(value)]) if self.multiple From 19863b1d784478efeacdd44273e4a733a657b864 Mon Sep 17 00:00:00 2001 From: Jocelin Hounon Date: Sat, 7 Oct 2023 17:20:18 -0500 Subject: [PATCH 2/2] Use from-as import to prevent mypy --no-implicit-reexport error --- sqlalchemy_file/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sqlalchemy_file/__init__.py b/sqlalchemy_file/__init__.py index 49cdd7c..a9e655b 100644 --- a/sqlalchemy_file/__init__.py +++ b/sqlalchemy_file/__init__.py @@ -1,4 +1,5 @@ __version__ = "0.5.0" -from .file import File -from .types import FileField, ImageField +from .file import File as File # noqa +from .types import FileField as FileField # noqa +from .types import ImageField as ImageField # noqa