Skip to content
Snippets Groups Projects
Commit dced80e0 authored by Eva Bardou's avatar Eva Bardou :frog:
Browse files

Apply a few more changes

parent ca22800e
No related branches found
No related tags found
1 merge request!3Bump Python requirement arkindex-base-worker to 0.4.0
Pipeline #203206 passed
...@@ -105,7 +105,7 @@ bump-python-deps: ...@@ -105,7 +105,7 @@ bump-python-deps:
- schedules - schedules
script: script:
- devops python-deps requirements.txt - devops python-deps pyproject.toml
publish-worker: publish-worker:
stage: release stage: release
......
...@@ -25,7 +25,6 @@ repos: ...@@ -25,7 +25,6 @@ repos:
args: ['--django'] args: ['--django']
- id: check-json - id: check-json
- id: check-toml - id: check-toml
- id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.3.0 rev: v2.3.0
hooks: hooks:
...@@ -34,9 +33,13 @@ repos: ...@@ -34,9 +33,13 @@ repos:
- repo: meta - repo: meta
hooks: hooks:
- id: check-useless-excludes - id: check-useless-excludes
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://gitlab.teklia.com/tools/pre-commit-hooks - repo: https://gitlab.teklia.com/tools/pre-commit-hooks
rev: 0.1.0 rev: 0.1.0
hooks: hooks:
- id: long-test-files - id: long-test-files
args: ['1000'] args: ['1000']
files: '^tests\/(.*\/)?test_[^\/]*\.py$' files: '^tests\/(.*\/)?test_[^\/]*\.py$'
\ No newline at end of file
FROM python:3.11-slim FROM python:3.12-slim
WORKDIR /src WORKDIR /src
# Install curl
ENV DEBIAN_FRONTEND=non-interactive
RUN apt-get update -q -y && apt-get install -q -y --no-install-recommends curl
# Install worker as a package # Install worker as a package
COPY worker_thumbnails_generator worker_thumbnails_generator COPY worker_thumbnails_generator worker_thumbnails_generator
COPY requirements.txt setup.py pyproject.toml ./ COPY pyproject.toml ./
RUN pip install . --no-cache-dir RUN pip install . --no-cache-dir
CMD ["worker-thumbnails-generator"]
include requirements.txt
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
# Will automatically login to a registry if CI_REGISTRY, CI_REGISTRY_USER and CI_REGISTRY_PASSWORD are set. # Will automatically login to a registry if CI_REGISTRY, CI_REGISTRY_USER and CI_REGISTRY_PASSWORD are set.
# Will only push an image if $CI_REGISTRY is set. # Will only push an image if $CI_REGISTRY is set.
if [ -z "$VERSION" -o -z "$CI_PROJECT_DIR" -o -z "$CI_REGISTRY_IMAGE" ]; then if [ -z "$VERSION" ] || [ -z "$CI_PROJECT_DIR" ] || [ -z "$CI_REGISTRY_IMAGE" ]; then
echo Missing environment variables echo Missing environment variables
exit 1 exit 1
fi fi
IMAGE_TAG="$CI_REGISTRY_IMAGE:$VERSION" IMAGE_TAG="$CI_REGISTRY_IMAGE:$VERSION"
cd $CI_PROJECT_DIR cd "$CI_PROJECT_DIR"
docker build -f Dockerfile . -t "$IMAGE_TAG" docker build -f Dockerfile . -t "$IMAGE_TAG"
if [ -n "$CI_REGISTRY" -a -n "$CI_REGISTRY_USER" -a -n "$CI_REGISTRY_PASSWORD" ]; then if [ -n "$CI_REGISTRY" ] && [ -n "$CI_REGISTRY_USER" ] && [ -n "$CI_REGISTRY_PASSWORD" ]; then
echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
docker push $IMAGE_TAG docker push "$IMAGE_TAG"
else else
echo "Missing environment variables to log in to the container registry…" echo "Missing environment variables to log in to the container registry…"
fi fi
...@@ -7,7 +7,9 @@ name = "worker_thumbnails_generator" ...@@ -7,7 +7,9 @@ name = "worker_thumbnails_generator"
license = { file = "LICENSE" } license = { file = "LICENSE" }
version = "0.1.0" version = "0.1.0"
description = "Worker to generate thumbnails for Arkindex elements" description = "Worker to generate thumbnails for Arkindex elements"
dynamic = ["dependencies"] dependencies = [
"arkindex-base-worker==0.4.0",
]
authors = [ authors = [
{ name = "Teklia", email = "contact@teklia.com" }, { name = "Teklia", email = "contact@teklia.com" },
] ]
...@@ -22,16 +24,18 @@ classifiers = [ ...@@ -22,16 +24,18 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
] ]
[project.scripts] [project.scripts]
worker-thumbnails-generator = "worker_thumbnails_generator.worker:main" "worker-thumbnails-generator" = "worker_thumbnails_generator.worker:main"
[tool.setuptools.dynamic] [tool.setuptools.packages]
dependencies = { file = ["requirements.txt"] } find = {}
[tool.ruff] [tool.ruff]
exclude = [".git", "__pycache__"] exclude = [".git", "__pycache__"]
target-version = "py312"
[tool.ruff.lint] [tool.ruff.lint]
ignore = ["E501"] ignore = ["E501"]
......
#!/usr/bin/env python
from setuptools import find_packages, setup
setup(packages=find_packages())
...@@ -9,4 +9,3 @@ commands = ...@@ -9,4 +9,3 @@ commands =
deps = deps =
pytest pytest
pytest-responses pytest-responses
-rrequirements.txt
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