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:
- schedules
script:
- devops python-deps requirements.txt
- devops python-deps pyproject.toml
publish-worker:
stage: release
......
......@@ -25,7 +25,6 @@ repos:
args: ['--django']
- id: check-json
- id: check-toml
- id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
......@@ -34,9 +33,13 @@ repos:
- repo: meta
hooks:
- 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
rev: 0.1.0
hooks:
- id: long-test-files
args: ['1000']
files: '^tests\/(.*\/)?test_[^\/]*\.py$'
\ No newline at end of file
files: '^tests\/(.*\/)?test_[^\/]*\.py$'
FROM python:3.11-slim
FROM python:3.12-slim
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
COPY worker_thumbnails_generator worker_thumbnails_generator
COPY requirements.txt setup.py pyproject.toml ./
COPY pyproject.toml ./
RUN pip install . --no-cache-dir
CMD ["worker-thumbnails-generator"]
include requirements.txt
......@@ -4,19 +4,19 @@
# 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.
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
exit 1
fi
IMAGE_TAG="$CI_REGISTRY_IMAGE:$VERSION"
cd $CI_PROJECT_DIR
cd "$CI_PROJECT_DIR"
docker build -f Dockerfile . -t "$IMAGE_TAG"
if [ -n "$CI_REGISTRY" -a -n "$CI_REGISTRY_USER" -a -n "$CI_REGISTRY_PASSWORD" ]; then
echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
docker push $IMAGE_TAG
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"
docker push "$IMAGE_TAG"
else
echo "Missing environment variables to log in to the container registry…"
fi
......@@ -7,7 +7,9 @@ name = "worker_thumbnails_generator"
license = { file = "LICENSE" }
version = "0.1.0"
description = "Worker to generate thumbnails for Arkindex elements"
dynamic = ["dependencies"]
dependencies = [
"arkindex-base-worker==0.4.0",
]
authors = [
{ name = "Teklia", email = "contact@teklia.com" },
]
......@@ -22,16 +24,18 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
[project.scripts]
worker-thumbnails-generator = "worker_thumbnails_generator.worker:main"
"worker-thumbnails-generator" = "worker_thumbnails_generator.worker:main"
[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
[tool.setuptools.packages]
find = {}
[tool.ruff]
exclude = [".git", "__pycache__"]
target-version = "py312"
[tool.ruff.lint]
ignore = ["E501"]
......
#!/usr/bin/env python
from setuptools import find_packages, setup
setup(packages=find_packages())
......@@ -9,4 +9,3 @@ commands =
deps =
pytest
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