Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • workers/base-worker
1 result
Show changes
Commits on Source (15)
[flake8]
max-line-length = 88
exclude = .git,__pycache__
ignore = E203,E501,W503
[settings]
# Compatible with black
profile = black
default_section=FIRSTPARTY
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
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.278
hooks:
- id: isort
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
exclude: "^worker-{{cookiecutter.slug}}/"
- repo: https://github.com/ambv/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- 'flake8-coding==1.3.2'
- 'flake8-debugger==4.1.2'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
......
black==23.3.0
black==23.7.0
doc8==1.1.1
mkdocs==1.4.3
mkdocs-material==9.1.14
mkdocstrings==0.21.2
mkdocstrings-python==1.0.0
mkdocs==1.5.2
mkdocs-material==9.1.21
mkdocstrings==0.22.0
mkdocstrings-python==1.3.0
recommonmark==0.7.1
[tool.ruff]
exclude = [".git", "__pycache__"]
ignore = ["E501"]
select = ["E", "F", "T1", "W", "I"]
[tool.ruff.isort]
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",
]
arkindex-client==1.0.12
peewee==3.16.2
Pillow==9.5.0
arkindex-client==1.0.13
peewee==3.16.3
Pillow==10.0.0
pymdown-extensions==10.0.1
python-gitlab==3.14.0
python-gitlab==3.15.0
python-gnupg==0.5.0
sh==2.0.4
sh==2.0.6
shapely==2.0.1
tenacity==8.2.2
tenacity==8.2.3
zstandard==0.21.0
pytest==7.3.1
pytest==7.4.0
pytest-mock==3.10.0
pytest-responses==0.5.1
......@@ -1978,7 +1978,9 @@ def test_list_transcriptions_with_cache(
# Query database through cache
transcriptions = mock_elements_worker_with_cache.list_transcriptions(**filters)
assert transcriptions.count() == len(expected_ids)
for transcription, expected_id in zip(transcriptions.order_by("id"), expected_ids):
for transcription, expected_id in zip(
transcriptions.order_by(CachedTranscription.id), expected_ids
):
assert transcription.id == UUID(expected_id)
# Check the worker never hits the API for elements
......
[flake8]
max-line-length = 150
exclude = .git,__pycache__
ignore = E203,E501,W503
[settings]
# Compatible with black
profile = black
default_section=FIRSTPARTY
known_first_party = arkindex,arkindex_worker
known_third_party = pytest,setuptools
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.278
hooks:
- id: isort
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/ambv/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- 'flake8-coding==1.3.2'
- 'flake8-debugger==4.1.2'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
......
[tool.ruff]
exclude = [".git", "__pycache__"]
ignore = ["E501"]
select = ["E", "F", "T1", "W", "I"]
[tool.ruff.isort]
known-first-party = ["arkindex", "arkindex_worker"]
known-third-party = ["pytest", "setuptools"]
......@@ -7,11 +7,6 @@ from arkindex.mock import MockApiClient
from arkindex_worker.worker.base import BaseWorker
@pytest.fixture
def mock_api_client() -> MockApiClient:
return MockApiClient()
@pytest.fixture(autouse=True)
def setup_environment(responses, monkeypatch) -> None:
"""Setup needed environment variables"""
......@@ -31,6 +26,6 @@ def setup_environment(responses, monkeypatch) -> None:
# Setup a mock api client instead of using a real one
def mock_setup_api_client(self):
self.api_client = mock_api_client
self.api_client = MockApiClient()
monkeypatch.setattr(BaseWorker, "setup_api_client", mock_setup_api_client)