Skip to content
Snippets Groups Projects
Commit 89b151da authored by Yoann Schneider's avatar Yoann Schneider :tennis:
Browse files

Bump pre-commit hooks

parent 16a157a9
No related branches found
No related tags found
1 merge request!272Bump pre-commit hooks
Pipeline #80140 passed
[codespell]
skip=*.md
[flake8] [flake8]
max-line-length = 150 max-line-length = 88
exclude = .git,__pycache__ exclude = .git,__pycache__
ignore = E203,E501,W503 ignore = E203,E501,W503
...@@ -4,7 +4,7 @@ stages: ...@@ -4,7 +4,7 @@ stages:
- release - release
lint: lint:
image: python:3 image: python:3.10
cache: cache:
paths: paths:
......
[settings] [settings]
# Compatible with black # Compatible with black
multi_line_output = 3 profile = black
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
line_length = 88
default_section=FIRSTPARTY default_section=FIRSTPARTY
known_first_party = arkindex,arkindex_common known_first_party = arkindex,arkindex_common,arkindex_worker
known_third_party =PIL,apistar,gitlab,gnupg,peewee,playhouse,pytest,requests,responses,setuptools,sh,shapely,tenacity,yaml,zstandard known_third_party =PIL,apistar,gitlab,gnupg,peewee,playhouse,pytest,requests,responses,setuptools,sh,shapely,tenacity,yaml,zstandard
repos: repos:
- repo: https://github.com/asottile/seed-isort-config - repo: https://github.com/PyCQA/isort
rev: v2.2.0 rev: 5.12.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks: hooks:
- id: isort - id: isort
- repo: https://github.com/ambv/black - repo: https://github.com/ambv/black
rev: 22.3.0 rev: 23.1.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/pycqa/flake8 - repo: https://github.com/pycqa/flake8
rev: 3.8.3 rev: 6.0.0
hooks: hooks:
- id: flake8 - id: flake8
additional_dependencies: additional_dependencies:
- 'flake8-coding==1.3.1' - 'flake8-coding==1.3.2'
- 'flake8-copyright==0.2.2' - 'flake8-debugger==4.1.2'
- 'flake8-debugger==3.1.0'
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0 rev: v4.4.0
hooks: hooks:
- id: check-ast - id: check-ast
- id: check-executables-have-shebangs - id: check-executables-have-shebangs
...@@ -37,12 +32,12 @@ repos: ...@@ -37,12 +32,12 @@ repos:
- id: check-json - id: check-json
- id: requirements-txt-fixer - id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v1.17.1 rev: v2.2.2
hooks: hooks:
- id: codespell - id: codespell
args: ['--write-changes'] args: ['--write-changes']
- repo: https://github.com/PyCQA/doc8 - repo: https://github.com/PyCQA/doc8
rev: 0.11.1 rev: v1.1.1
hooks: hooks:
- id: doc8 - id: doc8
- repo: meta - repo: meta
......
...@@ -137,7 +137,7 @@ class MetaDataMixin(object): ...@@ -137,7 +137,7 @@ class MetaDataMixin(object):
metadatas, list metadatas, list
), "type shouldn't be null and should be of type list of Dict" ), "type shouldn't be null and should be of type list of Dict"
# Make a copy to avoid modifiying the metadata_list argument # Make a copy to avoid modifying the metadata_list argument
metas = [] metas = []
for index, metadata in enumerate(metadatas): for index, metadata in enumerate(metadatas):
assert isinstance( assert isinstance(
......
...@@ -140,7 +140,7 @@ class TranscriptionMixin(object): ...@@ -140,7 +140,7 @@ class TranscriptionMixin(object):
# Create shallow copies of every transcription to avoid mutating the original payload # Create shallow copies of every transcription to avoid mutating the original payload
transcriptions_payload = list(map(dict, transcriptions)) transcriptions_payload = list(map(dict, transcriptions))
for (index, transcription) in enumerate(transcriptions_payload): for index, transcription in enumerate(transcriptions_payload):
element_id = transcription.get("element_id") element_id = transcription.get("element_id")
assert element_id and isinstance( assert element_id and isinstance(
element_id, str element_id, str
...@@ -243,7 +243,7 @@ class TranscriptionMixin(object): ...@@ -243,7 +243,7 @@ class TranscriptionMixin(object):
# Create shallow copies of every transcription to avoid mutating the original payload # Create shallow copies of every transcription to avoid mutating the original payload
transcriptions_payload = list(map(dict, transcriptions)) transcriptions_payload = list(map(dict, transcriptions))
for (index, transcription) in enumerate(transcriptions_payload): for index, transcription in enumerate(transcriptions_payload):
text = transcription.get("text") text = transcription.get("text")
assert text and isinstance( assert text and isinstance(
text, str text, str
......
...@@ -71,7 +71,6 @@ def cache_yaml(monkeypatch): ...@@ -71,7 +71,6 @@ def cache_yaml(monkeypatch):
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def setup_api(responses, monkeypatch, cache_yaml): def setup_api(responses, monkeypatch, cache_yaml):
# Always use the environment variable first # Always use the environment variable first
schema_url = os.environ.get("ARKINDEX_API_SCHEMA_URL") schema_url = os.environ.get("ARKINDEX_API_SCHEMA_URL")
if schema_url is None: if schema_url is None:
......
...@@ -1561,7 +1561,6 @@ def test_list_element_children_with_cache( ...@@ -1561,7 +1561,6 @@ def test_list_element_children_with_cache(
filters, filters,
expected_ids, expected_ids,
): ):
# Check we have 2 elements already present in database # Check we have 2 elements already present in database
assert CachedElement.select().count() == 3 assert CachedElement.select().count() == 3
......
...@@ -183,7 +183,7 @@ def test_create_transcription_wrong_orientation(mock_elements_worker): ...@@ -183,7 +183,7 @@ def test_create_transcription_wrong_orientation(mock_elements_worker):
element=elt, element=elt,
text="Animula vagula blandula", text="Animula vagula blandula",
confidence=0.26, confidence=0.26,
orientation="eliptical", orientation="elliptical",
) )
assert ( assert (
str(e.value) str(e.value)
......
[settings] [settings]
# Compatible with black # Compatible with black
multi_line_output = 3 profile = black
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
line_length = 88
default_section=FIRSTPARTY default_section=FIRSTPARTY
known_first_party = known_first_party = arkindex,arkindex_worker
known_third_party = arkindex_worker,pytest,setuptools known_third_party = pytest,setuptools
repos: repos:
- repo: https://github.com/pre-commit/mirrors-isort - repo: https://github.com/PyCQA/isort
rev: v5.10.1 rev: 5.12.0
hooks: hooks:
- id: isort - id: isort
- repo: https://github.com/ambv/black - repo: https://github.com/ambv/black
rev: 22.6.0 rev: 23.1.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/pycqa/flake8 - repo: https://github.com/pycqa/flake8
rev: 5.0.4 rev: 6.0.0
hooks: hooks:
- id: flake8 - id: flake8
additional_dependencies: additional_dependencies:
- flake8-coding==1.3.1 - 'flake8-coding==1.3.2'
- flake8-copyright==0.2.3 - 'flake8-debugger==4.1.2'
- flake8-debugger==3.1.0
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0 rev: v4.4.0
hooks: hooks:
- id: check-ast - id: check-ast
- id: check-docstring-first - id: check-docstring-first
...@@ -33,7 +32,7 @@ repos: ...@@ -33,7 +32,7 @@ repos:
- id: check-json - id: check-json
- id: requirements-txt-fixer - id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.2.1 rev: v2.2.2
hooks: hooks:
- id: codespell - id: codespell
args: ['--write-changes'] args: ['--write-changes']
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
import os import os
import pytest import pytest
from arkindex_worker.worker.base import BaseWorker
from arkindex.mock import MockApiClient from arkindex.mock import MockApiClient
from arkindex_worker.worker.base import BaseWorker
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment