Skip to content
Snippets Groups Projects
Verified Commit 6e6654ea authored by Yoann Schneider's avatar Yoann Schneider :tennis:
Browse files

Bump base-worker

parent 8923c6a6
No related branches found
No related tags found
No related merge requests found
Pipeline #203129 passed
......@@ -6,7 +6,7 @@ workers:
name: Thumbnails Generator
type: generator
docker:
build: Dockerfile
command: worker-thumbnails-generator
configuration:
width: 900
height: 400
......
......@@ -14,7 +14,7 @@ variables:
DEBIAN_FRONTEND: non-interactive
test:
image: python:slim
image: python:3.12-slim
stage: test
cache:
......@@ -41,7 +41,7 @@ test:
- tox -- --junitxml=test-report.xml --durations=50
lint:
image: python:slim
image: python:3.12-slim
cache:
paths:
......
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.1
rev: v0.8.2
hooks:
# Run the linter.
- id: ruff
......@@ -9,7 +9,7 @@ repos:
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-docstring-first
......@@ -27,10 +27,16 @@ repos:
- id: check-toml
- id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: ['--write-changes']
- repo: meta
hooks:
- id: check-useless-excludes
- repo: https://gitlab.teklia.com/tools/pre-commit-hooks
rev: 0.1.0
hooks:
- id: long-test-files
args: ['1000']
files: '^tests\/(.*\/)?test_[^\/]*\.py$'
\ No newline at end of file
......@@ -11,8 +11,4 @@ COPY worker_thumbnails_generator worker_thumbnails_generator
COPY requirements.txt setup.py pyproject.toml ./
RUN pip install . --no-cache-dir
# Add archi local CA
RUN curl https://assets.teklia.com/teklia_dev_ca.pem > /usr/local/share/ca-certificates/arkindex-dev.crt && update-ca-certificates
ENV REQUESTS_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
CMD ["worker-thumbnails-generator"]
......@@ -45,7 +45,7 @@ def _setup_environment(responses, monkeypatch) -> None:
monkeypatch.setattr(BaseWorker, "setup_api_client", mock_setup_api_client)
@pytest.fixture()
@pytest.fixture
def mock_worker() -> ThumbnailsGenerator:
worker = ThumbnailsGenerator()
worker.args = Namespace(dev=False)
......@@ -63,7 +63,7 @@ def mock_worker() -> ThumbnailsGenerator:
return worker
@pytest.fixture()
@pytest.fixture
def page_1_payload() -> dict:
return {
"id": "page_1",
......@@ -89,7 +89,7 @@ def page_1_payload() -> dict:
}
@pytest.fixture()
@pytest.fixture
def page_2_payload() -> dict:
return {
"id": "page_2",
......@@ -115,7 +115,7 @@ def page_2_payload() -> dict:
}
@pytest.fixture()
@pytest.fixture
def page_3_payload() -> dict:
return {
"id": "page_3",
......@@ -141,7 +141,7 @@ def page_3_payload() -> dict:
}
@pytest.fixture()
@pytest.fixture
def pages_payload(
page_1_payload: dict, page_2_payload: dict, page_3_payload: dict
) -> list[dict]:
......
......@@ -14,18 +14,11 @@ class ThumbnailsGenerator(ElementsWorker):
def configure(self) -> None:
super().configure()
if self.user_configuration:
logger.info("Loading user_configuration")
self.config.update(self.user_configuration)
self.thumbnail_width: int = self.config["width"]
self.thumbnail_height: int = self.config["height"]
self.first_n: int = self.config.get("first_n")
corpus = self.request("RetrieveCorpus", id=self.corpus_id)
self.corpus_types = {
element_type["slug"]: element_type for element_type in corpus["types"]
}
self.list_corpus_types()
def _list_folder_elements(self, folder):
"""
......
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