Skip to content
Snippets Groups Projects
Commit 19d84704 authored by Eva Bardou's avatar Eva Bardou :frog: Committed by Yoann Schneider
Browse files

Update `pyproject.toml` and stuff in the cookiecutter worker template

parent 51ba37cc
No related branches found
No related tags found
1 merge request!463Update `pyproject.toml` and stuff in the cookiecutter worker template
Pipeline #146805 passed
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.6
rev: v0.1.7
hooks:
# Run the linter.
- id: ruff
......@@ -11,7 +11,7 @@ repos:
- id: ruff-format
exclude: "^worker-{{cookiecutter.slug}}/"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-ast
- id: check-executables-have-shebangs
......@@ -30,7 +30,7 @@ repos:
exclude: "^worker-{{cookiecutter.slug}}/pyproject.toml$"
- id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.6
hooks:
- id: codespell
args: ['--write-changes']
......
......@@ -387,7 +387,7 @@ class DatasetWorker(BaseWorker, DatasetMixin, TaskMixin):
"""
def format_split(
split: tuple[str, Iterator[tuple[str, Element]]]
split: tuple[str, Iterator[tuple[str, Element]]],
) -> tuple[str, list[Element]]:
return (split[0], list(map(itemgetter(1), list(split[1]))))
......
......@@ -3,6 +3,6 @@
"name": "Demo",
"description": "Demo ML worker for Arkindex",
"worker_type": "demo",
"author": "",
"email": ""
"author": "John Doe",
"email": "john.doe@company.com"
}
......@@ -4,5 +4,5 @@
"description": "{{ cookiecutter.description }}",
"worker_type": "{{ cookiecutter.worker_type }}",
"author": "{{ cookiecutter.author }}",
"email": "{{ cookiecutter.email}}"
"email": "{{ cookiecutter.email }}"
}
......@@ -109,6 +109,7 @@ bump-python-deps:
publish-worker:
stage: release
allow_failure: true
image: registry.gitlab.teklia.com/arkindex/cli:latest
script:
......
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.6
rev: v0.1.7
hooks:
# Run the linter.
- id: ruff
......@@ -24,6 +24,7 @@ repos:
- id: name-tests-test
args: ['--django']
- id: check-json
- id: check-toml
- id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
......
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "worker_{{ cookiecutter.slug }}"
version = "0.1.0"
description = "{{ cookiecutter.description }}"
dynamic = ["dependencies"]
authors = [
{ name = "{{ cookiecutter.author }}", email = "{{ cookiecutter.email }}" },
]
maintainers = [
{ name = "{{ cookiecutter.author }}", email = "{{ cookiecutter.email }}" },
]
requires-python = ">=3.10"
readme = { file = "README.md", content-type = "text/markdown" }
keywords = ["python"]
classifiers = [
# Specify the Python versions you support here.
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
[project.scripts]
worker-{{ cookiecutter.slug }} = "worker_{{ cookiecutter.slug }}.worker:main"
......
#!/usr/bin/env python
import re
from setuptools import find_packages, setup
SUBMODULE_PATTERN = re.compile("-e ((?:(?!#egg=).)*)(?:#egg=)?(.*)")
setup(
author="{{ cookiecutter.author }}",
author_email="{{ cookiecutter.email }}",
packages=find_packages(),
)
setup(packages=find_packages())
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