From 189c6d42264cd735bb29a12499ea2f619fabac82 Mon Sep 17 00:00:00 2001 From: mtayfur Date: Mon, 27 Oct 2025 00:18:26 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20(dev-check.sh,=20pyproject.toml,?= =?UTF-8?q?=20requirements.txt):=20add=20development=20tooling=20and=20con?= =?UTF-8?q?figuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce a dev-check.sh script to automate code formatting and import sorting using Black and isort. Add a pyproject.toml file to configure Black and isort settings for consistent code style. Update requirements.txt to include Black and isort as development dependencies and remove version pinning for easier dependency management. These changes streamline the development workflow, enforce code style consistency, and make it easier for contributors to run formatting and import checks locally. --- dev-check.sh | 25 +++++++++++++++++++++++++ pyproject.toml | 24 ++++++++++++++++++++++++ requirements.txt | 10 ++++++---- 3 files changed, 55 insertions(+), 4 deletions(-) create mode 100755 dev-check.sh create mode 100644 pyproject.toml diff --git a/dev-check.sh b/dev-check.sh new file mode 100755 index 0000000..7241249 --- /dev/null +++ b/dev-check.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Development tools script for openwebui-memory-system + +set -e + +if [ -f "./.venv/bin/python" ]; then + PYTHON="./.venv/bin/python" +elif command -v python3 &> /dev/null; then + PYTHON="python3" +elif command -v python &> /dev/null; then + PYTHON="python" +else + echo "Python 3 is not installed. Please install Python 3 to proceed." + exit 1 +fi + +echo "🔧 Running development tools..." + +echo "🎨 Formatting with Black..." +$PYTHON -m black . +echo "📦 Sorting imports with isort..." +$PYTHON -m isort . + +echo "✅ All checks passed!" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9217c6d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,24 @@ +[tool.black] +line-length = 160 +target-version = ['py38'] +include = '\.pyi?$' +extend-exclude = ''' +/( + \.eggs + | \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | build + | dist +)/ +''' + +[tool.isort] +line_length = 160 +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true +ensure_newline_before_comments = true \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e8f6881..910811c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,7 @@ -aiohttp>=3.12.15 -pydantic>=2.11.7 -numpy>=2.0.0 open-webui>=0.6.32 -tiktoken>=0.11.0 +aiohttp +pydantic +numpy +tiktoken +black +isort \ No newline at end of file