From 2a1f31597949812f6386c90a4a8980331be052d1 Mon Sep 17 00:00:00 2001 From: Swen Kooij Date: Thu, 4 Nov 2021 14:46:21 +0200 Subject: [PATCH] Upgrade analysis dependencies to the latest version --- psqlextra/partitioning/range_strategy.py | 8 ++++++-- psqlextra/partitioning/strategy.py | 8 ++++++-- pyproject.toml | 10 ++++++++++ setup.cfg | 4 ++-- setup.py | 22 +++++++++++----------- tests/test_hstore_autodetect.py | 9 ++++++--- 6 files changed, 41 insertions(+), 20 deletions(-) diff --git a/psqlextra/partitioning/range_strategy.py b/psqlextra/partitioning/range_strategy.py index 7fdd20f8..937f2319 100644 --- a/psqlextra/partitioning/range_strategy.py +++ b/psqlextra/partitioning/range_strategy.py @@ -9,11 +9,15 @@ class PostgresRangePartitioningStrategy: partitioned table.""" @abstractmethod - def to_create(self,) -> Generator[PostgresRangePartition, None, None]: + def to_create( + self, + ) -> Generator[PostgresRangePartition, None, None]: """Generates a list of partitions to be created.""" @abstractmethod - def to_delete(self,) -> Generator[PostgresRangePartition, None, None]: + def to_delete( + self, + ) -> Generator[PostgresRangePartition, None, None]: """Generates a list of partitions to be deleted.""" diff --git a/psqlextra/partitioning/strategy.py b/psqlextra/partitioning/strategy.py index d42d9b80..724a0654 100644 --- a/psqlextra/partitioning/strategy.py +++ b/psqlextra/partitioning/strategy.py @@ -9,11 +9,15 @@ class PostgresPartitioningStrategy: table.""" @abstractmethod - def to_create(self,) -> Generator[PostgresPartition, None, None]: + def to_create( + self, + ) -> Generator[PostgresPartition, None, None]: """Generates a list of partitions to be created.""" @abstractmethod - def to_delete(self,) -> Generator[PostgresPartition, None, None]: + def to_delete( + self, + ) -> Generator[PostgresPartition, None, None]: """Generates a list of partitions to be deleted.""" diff --git a/pyproject.toml b/pyproject.toml index 83c116eb..126ae9a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,12 @@ [tool.black] line-length = 80 +exclude = ''' +( + /( + | .env + | env + | venv + | tests/snapshots + )/ +) +''' diff --git a/setup.cfg b/setup.cfg index b7e62804..65713eaa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,6 +7,6 @@ line_length=80 multi_line_output=3 lines_between_types=1 include_trailing_comma=True -not_skip=__init__.py -known_standard_library=dataclasses known_third_party=pytest,freezegun +float_to_top=true +skip_glob=tests/snapshots/*.py diff --git a/setup.py b/setup.py index 1dc8dbda..6b6caad6 100644 --- a/setup.py +++ b/setup.py @@ -83,12 +83,12 @@ def run(self): "snapshottest==0.6.0", ], "analysis": [ - "black==19.3b0", - "flake8==3.7.7", - "autoflake==1.3", - "autopep8==1.4.4", - "isort==4.3.20", - "sl-docformatter==1.4", + "black==21.10b0", + "flake8==4.0.1", + "autoflake==1.4", + "autopep8==1.6.0", + "isort==5.10.0", + "docformatter==1.4", ], }, cmdclass={ @@ -100,7 +100,7 @@ def run(self): [ [ "autoflake", - "--remove-all-unused-imports", + "--remove-all", "-i", "-r", "setup.py", @@ -128,16 +128,16 @@ def run(self): "Automatically sorts imports", [ ["isort", "setup.py"], - ["isort", "-rc", "psqlextra"], - ["isort", "-rc", "tests"], + ["isort", "psqlextra"], + ["isort", "tests"], ], ), "sort_imports_verify": create_command( "Verifies all imports are properly sorted.", [ ["isort", "-c", "setup.py"], - ["isort", "-c", "-rc", "psqlextra"], - ["isort", "-c", "-rc", "tests"], + ["isort", "-c", "psqlextra"], + ["isort", "-c", "tests"], ], ), "fix": create_command( diff --git a/tests/test_hstore_autodetect.py b/tests/test_hstore_autodetect.py index 39b1796e..6a460c2b 100644 --- a/tests/test_hstore_autodetect.py +++ b/tests/test_hstore_autodetect.py @@ -34,9 +34,12 @@ def _assert_autodetector(changes, expected): for i, expected_operation in enumerate(expected): real_operation = operations[i] _, _, real_args, real_kwargs = real_operation.field.deconstruct() - _, _, expected_args, expected_kwargs = ( - expected_operation.field.deconstruct() - ) + ( + _, + _, + expected_args, + expected_kwargs, + ) = expected_operation.field.deconstruct() assert real_args == expected_args assert real_kwargs == expected_kwargs