From: CaselIT Date: Wed, 12 May 2021 20:16:22 +0000 (+0200) Subject: Update black, zimports and flake8 X-Git-Tag: rel_1_6_3~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=361076e847c7c60dd00438f1a612aba799e90b1d;p=thirdparty%2Fsqlalchemy%2Falembic.git Update black, zimports and flake8 Change-Id: Ia7d0ea7cc4389bc6adc4226efd5b18ecb68ffb2b --- diff --git a/.gitignore b/.gitignore index 4a9a8155..867283f9 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ coverage.xml .pytest_cache/ /docs/build/_build/ /pysqlite_test_schema.db +*.sqlite3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6577d38f..84abf5bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,17 +2,19 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/python/black - rev: 20.8b1 + rev: 21.5b1 hooks: - id: black - repo: https://github.com/sqlalchemyorg/zimports - rev: 0.2.2 + rev: v0.4.0 hooks: - id: zimports + args: + - --keep-unused-type-checking - repo: https://github.com/pycqa/flake8 - rev: 3.8.4 + rev: 3.9.2 hooks: - id: flake8 additional_dependencies: diff --git a/tests/test_version_traversal.py b/tests/test_version_traversal.py index 0b5306d3..3895607f 100644 --- a/tests/test_version_traversal.py +++ b/tests/test_version_traversal.py @@ -329,7 +329,7 @@ class BranchedPathTest(MigrationTest): ) def test_relative_downgrade_baseplus2(self): - """ base+2 points to b, no branch label, drop everything above b. """ + """base+2 points to b, no branch label, drop everything above b.""" self._assert_downgrade( "base+2", [self.d2.revision, self.d1.revision], @@ -356,7 +356,7 @@ class BranchedPathTest(MigrationTest): ) def test_relative_downgrade_branchplus3(self): - """ c2branch@base+3 equivalent to c2. """ + """c2branch@base+3 equivalent to c2.""" self._assert_downgrade( self.c2.revision, [self.d2.revision, self.d1.revision], @@ -437,7 +437,7 @@ class BranchedPathTest(MigrationTest): ) def test_downgrade_single_branch_c1branch(self): - """ Use branch label to specify the branch to downgrade. """ + """Use branch label to specify the branch to downgrade.""" self._assert_downgrade( "c1branch@{}".format(self.b.revision), (self.c1.revision, self.d2.revision), @@ -473,7 +473,7 @@ class BranchedPathTest(MigrationTest): ) def test_downgrade_single_branch_d1(self): - """ Use the head revision to specify the branch. """ + """Use the head revision to specify the branch.""" self._assert_downgrade( "{}@{}".format(self.d1.revision, self.b.revision), (self.d1.revision, self.d2.revision), @@ -547,7 +547,7 @@ class BranchedPathTest(MigrationTest): ) def test_downgrade_no_effect_branched(self): - """Added for good measure when there are multiple branches. """ + """Added for good measure when there are multiple branches.""" self._assert_downgrade( self.c2.revision, [self.d1.revision, self.c2.revision], diff --git a/tox.ini b/tox.ini index 92e742be..ec69f94e 100644 --- a/tox.ini +++ b/tox.ini @@ -69,7 +69,7 @@ deps= pydocstyle<4.0.0 # used by flake8-rst-docstrings pygments - black==20.8b1 + black==21.5b1 commands = flake8 ./alembic/ ./tests/ setup.py docs/build/conf.py {posargs} black --check setup.py tests alembic