Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#503)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pycqa/isort: 5.12.0 → 5.13.2](PyCQA/isort@5.12.0...5.13.2)
- [github.com/psf/black: 23.10.0 → 24.3.0](psf/black@23.10.0...24.3.0)
- [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](PyCQA/flake8@6.1.0...7.0.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Apr 2, 2024
1 parent b2117f8 commit de380dc
Show file tree
Hide file tree
Showing 30 changed files with 33 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.10.0
rev: 24.3.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
Expand All @@ -31,7 +31,7 @@ repos:
additional_dependencies: ["tomli"]
exclude: "tests"
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
ci:
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""GeoAlchemy2 package."""

from geoalchemy2 import admin
from geoalchemy2 import elements # noqa
from geoalchemy2 import exc # noqa
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/admin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines the functions used for administration tasks."""

from sqlalchemy import Column
from sqlalchemy import Index
from sqlalchemy import Table
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/admin/dialects/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines some dialect-specific functions used for administration tasks."""

from geoalchemy2.admin.dialects import common # noqa
from geoalchemy2.admin.dialects import geopackage # noqa
from geoalchemy2.admin.dialects import mysql # noqa
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/admin/dialects/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines functions used by several dialects."""

import sqlalchemy
from packaging import version
from sqlalchemy import Column
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/admin/dialects/geopackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
See GeoPackage specifications here: http://www.geopackage.org/spec/
"""

import re

from sqlalchemy import text
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/admin/dialects/mysql.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines specific functions for MySQL dialect."""

from sqlalchemy import text
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql.sqltypes import NullType
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/admin/dialects/postgresql.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines specific functions for Postgresql dialect."""

from sqlalchemy import Index
from sqlalchemy import text
from sqlalchemy.sql import func
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/admin/dialects/sqlite.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines specific functions for SQLite dialect."""

import os
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/alembic_helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Some helpers to use with Alembic migration tool."""

from alembic.autogenerate import renderers
from alembic.autogenerate import rewriter
from alembic.autogenerate.render import _add_column
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
Session.query(Cls).order_by(Cls.geom.distance_box('POINT(0 0)')).limit(10)
"""

from typing import Union

from sqlalchemy import types as sqltypes
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
---------
"""

import re
from typing import List
from typing import Type
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
As GeoAlchemy 2 itself has no dependency on `Shapely`, applications using
functions of this module have to ensure that `Shapely` is available.
"""

from contextlib import contextmanager
from typing import List
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:class:`geoalchemy2.types.Raster` classes are used when defining geometry, geography and raster
columns/properties in models.
"""

import warnings
from typing import Any
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/types/dialects/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines some dialect-specific functions used for Column types."""

from geoalchemy2.types.dialects import common # noqa
from geoalchemy2.types.dialects import geopackage # noqa
from geoalchemy2.types.dialects import mysql # noqa
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/types/dialects/geopackage.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""This module defines specific functions for GeoPackage dialect."""

from geoalchemy2.types.dialects.sqlite import bind_processor_process # noqa
1 change: 1 addition & 0 deletions geoalchemy2/types/dialects/mysql.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines specific functions for MySQL dialect."""

from geoalchemy2.elements import WKBElement
from geoalchemy2.elements import WKTElement
from geoalchemy2.elements import _SpatialElement
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/types/dialects/postgresql.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines specific functions for Postgresql dialect."""

from geoalchemy2.elements import RasterElement
from geoalchemy2.elements import WKBElement
from geoalchemy2.elements import WKTElement
Expand Down
1 change: 1 addition & 0 deletions geoalchemy2/types/dialects/sqlite.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module defines specific functions for SQLite dialect."""

from geoalchemy2.elements import RasterElement
from geoalchemy2.elements import WKBElement
from geoalchemy2.elements import WKTElement
Expand Down
1 change: 1 addition & 0 deletions tests/gallery/test_decipher_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
possible to decipher the WKB to get a 2D list of values.
This example uses SQLAlchemy ORM queries.
"""

import binascii
import struct

Expand Down
1 change: 1 addition & 0 deletions tests/gallery/test_disable_wrapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
this case it is possible to disable this wrapping.
This example uses SQLAlchemy ORM queries.
"""

from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import func
Expand Down
1 change: 1 addition & 0 deletions tests/gallery/test_insert_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
raster and re-importing it using this method will properly import the values but might not
keep the same internal types.
"""

import struct
from sys import byteorder

Expand Down
1 change: 1 addition & 0 deletions tests/gallery/test_length_at_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
time.
This example uses SQLAlchemy core queries.
"""

from sqlalchemy import Column
from sqlalchemy import Float
from sqlalchemy import Integer
Expand Down
1 change: 1 addition & 0 deletions tests/gallery/test_orm_mapped_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
``sqlalchemy.orm.DeclarativeBase`` base class.
This example shows how to use GeoAlchemy2 types in this context.
"""

import pytest
from pkg_resources import parse_version
from sqlalchemy import __version__ as SA_VERSION
Expand Down
1 change: 1 addition & 0 deletions tests/gallery/test_raster_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
This example uses both SQLAlchemy core and ORM queries.
"""

from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import MetaData
Expand Down
1 change: 1 addition & 0 deletions tests/gallery/test_specific_compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
This example uses SQLAlchemy core queries.
"""

from sqlalchemy import MetaData
from sqlalchemy import func
from sqlalchemy.ext.compiler import compiles
Expand Down
1 change: 1 addition & 0 deletions tests/gallery/test_summarystatsagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Some functions return composite types. This example shows how to deal with this
kind of functions.
"""

import pytest
from pkg_resources import parse_version
from sqlalchemy import Column
Expand Down
1 change: 1 addition & 0 deletions tests/gallery/test_type_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
``ST_Transform()``, it is possible to define a `TypeDecorator
<https://docs.sqlalchemy.org/en/13/core/custom_types.html#sqlalchemy.types.TypeDecorator>`_
"""

import re
from typing import Any

Expand Down
3 changes: 2 additions & 1 deletion tests/schema_fixtures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Declare tables used in tests."""

import pytest
from sqlalchemy import Column
from sqlalchemy import Integer
Expand Down Expand Up @@ -119,7 +120,7 @@ def column_expression(self, col):
SRID of the resulting WKBElement is correct"""
return getattr(func, self.impl.as_binary)(
func.ST_Transform(col, self.app_srid),
type_=self.__class__.impl(srid=self.app_srid)
type_=self.__class__.impl(srid=self.app_srid),
# srid could also be -1 so that the SRID is deduced from the
# WKB data
)
Expand Down
1 change: 1 addition & 0 deletions tests/test_alembic_migrations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test alembic migrations of spatial columns."""

import pytest
import sqlalchemy as sa # noqa (This import is only used in the migration scripts)
from alembic import command
Expand Down

0 comments on commit de380dc

Please sign in to comment.