Add initial implementations for forms and organization apps with serializers, factories, and admin configurations
Some checks failed
CI/CD Pipeline / Run Tests (push) Failing after 45s
CI/CD Pipeline / Code Quality Checks (push) Failing after 48s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped

This commit is contained in:
2026-03-28 18:23:06 +01:00
parent 8ed3e1175c
commit 345b1d0cc8
201 changed files with 15097 additions and 6691 deletions

View File

@@ -4,13 +4,7 @@
cd "$(dirname "$0")/../src" || exit 1
export PYTHONPATH=.
export DJANGO_SETTINGS_MODULE=config.settings.development
export DJANGO_SETTINGS_MODULE=settings.test
if uv run python manage.py makemigrations --check --dry-run; then
echo "✓ Django migrations are up to date"
exit 0
else
echo "⚠ Warning: Django migrations check failed (may be due to configuration issues)"
echo " This doesn't prevent commits, but you should check migrations manually"
exit 0 # Exit with success to not block commits
fi
uv run python manage.py makemigrations --check --dry-run
echo "✓ Django migrations are up to date"

34
scripts/ensure-ci-python.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -euo pipefail
TARGET_VERSION="${1:-3.11}"
IFS="." read -r PYTHON_MAJOR PYTHON_MINOR _ <<< "${TARGET_VERSION}"
if [[ -n "${PYTHON_MINOR:-}" ]]; then
PYTHON_BIN="python${PYTHON_MAJOR}.${PYTHON_MINOR}"
else
PYTHON_BIN="python${PYTHON_MAJOR}"
fi
if command -v "${PYTHON_BIN}" >/dev/null 2>&1; then
command -v "${PYTHON_BIN}"
exit 0
fi
APT_RUNNER=()
if [[ "$(id -u)" -ne 0 ]]; then
APT_RUNNER=(sudo)
fi
export DEBIAN_FRONTEND=noninteractive
"${APT_RUNNER[@]}" apt-get update >&2
if ! "${APT_RUNNER[@]}" apt-get install -y "${PYTHON_BIN}" "${PYTHON_BIN}-venv" >&2; then
"${APT_RUNNER[@]}" apt-get install -y software-properties-common >&2
"${APT_RUNNER[@]}" add-apt-repository -y ppa:deadsnakes/ppa >&2
"${APT_RUNNER[@]}" apt-get update >&2
"${APT_RUNNER[@]}" apt-get install -y "${PYTHON_BIN}" "${PYTHON_BIN}-venv" >&2
fi
command -v "${PYTHON_BIN}"

17
scripts/run-tests-prod.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Production-like Django test runner (PostgreSQL + migrations)
set -euo pipefail
cd "$(dirname "$0")/../src" || exit 1
export PYTHONPATH=.
export DJANGO_SETTINGS_MODULE=settings.test_postgres
COMMON_ADDOPTS="--verbose --tb=short --reuse-db --strict-markers --strict-config --color=yes"
if [ "$#" -eq 0 ]; then
uv run pytest ../tests --migrations -o "addopts=${COMMON_ADDOPTS}"
else
uv run pytest "$@" --migrations -o "addopts=${COMMON_ADDOPTS}"
fi

15
scripts/run-tests.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Django test runner script for pre-push
set -euo pipefail
cd "$(dirname "$0")/../src" || exit 1
export PYTHONPATH=.
export DJANGO_SETTINGS_MODULE=settings.test
if [ "$#" -eq 0 ]; then
uv run pytest ../tests
else
uv run pytest "$@"
fi

43
scripts/setup-precommit.sh Normal file → Executable file
View File

@@ -1,41 +1,8 @@
#!/bin/bash
# Скрипт установки и настройки pre-commit хуков
# Script to install git hooks managed by pre-commit
echo "🔧 Настройка pre-commit хуков..."
set -euo pipefail
# Проверка наличия Git
if ! command -v git &> /dev/null; then
echo "❌ Git не найден. Установите Git и повторите попытку."
exit 1
fi
# Создание директории для хуков если её нет
HOOKS_DIR=".git/hooks"
if [ ! -d "$HOOKS_DIR" ]; then
mkdir -p "$HOOKS_DIR"
echo "📁 Создана директория для git hooks"
fi
# Копирование pre-commit хука
if [ -f ".git/hooks/pre-commit" ]; then
echo "🔄 Обновление существующего pre-commit хука"
else
echo "📥 Установка нового pre-commit хука"
fi
# Делаем хук исполняемым
chmod +x .git/hooks/pre-commit
echo "✅ Pre-commit хук установлен и готов к использованию"
echo ""
echo "📋 Что проверяет pre-commit хук:"
echo " • Синтаксис Python файлов"
echo " • Стиль кода (flake8)"
echo " • Форматирование (black)"
echo " • Сортировка импортов (isort)"
echo " • Формат YAML файлов"
echo " • Пробелы в конце строк"
echo " • Закрывающие переводы строк"
echo ""
echo "💡 Хук автоматически запускается при каждом коммите"
echo "💡 Для пропуска проверок используйте: git commit --no-verify"
echo "Installing pre-commit hooks..."
uv run pre-commit install --hook-type pre-commit --hook-type pre-push
echo "Hooks installed: pre-commit, pre-push"