feat: Add Python dependency management and fix test environment

- Add install-pip.sh script for automated Python package installation
- Add pyproject.toml with proper package configuration and setuptools discovery
- Fix virtual environment setup to enable all tests to run successfully
- Tests now pass: 20/20 

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-23 02:41:32 +02:00
parent 5ec93c1092
commit be3902c412
2 changed files with 89 additions and 0 deletions

74
install-pip.sh Normal file
View File

@@ -0,0 +1,74 @@
#!/bin/bash
#
# install-pip.sh - Install Python package dependencies for MarkiTect project
#
# USAGE
#
# run "./install-pip.sh" after activating the virtual environment
# or run "source .venv/bin/activate && ./install-pip.sh"
#
set -e # Exit on any error
echo "🐍 MarkiTect Python Dependencies Installer"
echo "=========================================="
echo ""
# Check if virtual environment is active
if [ -z "$VIRTUAL_ENV" ]; then
echo "⚠️ Virtual environment not detected"
echo " Checking for .venv directory..."
if [ -d ".venv" ]; then
echo "📁 Found .venv directory"
echo " Activating virtual environment..."
source .venv/bin/activate
echo "✅ Virtual environment activated: $VIRTUAL_ENV"
else
echo "❌ No .venv directory found"
echo " Please create a virtual environment first:"
echo " python3 -m venv .venv"
echo " source .venv/bin/activate"
exit 1
fi
else
echo "✅ Virtual environment active: $VIRTUAL_ENV"
fi
echo ""
echo "📦 Installing project in development mode..."
pip install -e .
echo ""
echo "🧪 Installing testing dependencies..."
pip install pytest pytest-cov
echo ""
echo "🛠️ Installing development dependencies..."
pip install black flake8 mypy
echo ""
echo "🏗️ Installing build dependencies..."
pip install build
echo ""
echo "📋 Verifying installations..."
echo " Python: $(python --version)"
echo " pip: $(pip --version | cut -d' ' -f1-2)"
echo " pytest: $(pytest --version | head -n1)"
echo " black: $(black --version)"
echo " flake8: $(flake8 --version | cut -d' ' -f1-2)"
echo " mypy: $(mypy --version)"
echo ""
echo "📚 Installed packages:"
pip list --format=columns
echo ""
echo "✅ Python dependencies installation complete!"
echo ""
echo "🎯 Next steps:"
echo " - Run tests: make test"
echo " - Run linting: make lint"
echo " - Format code: make format"
echo " - Build package: make build"

15
pyproject.toml Normal file
View File

@@ -0,0 +1,15 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "markitect"
version = "0.1.0"
description = "Advanced Markdown engine for structured content"
readme = "README.md"
requires-python = ">=3.8"
dependencies = ["markdown-it-py"]
[tool.setuptools.packages.find]
include = ["markitect*"]
exclude = ["tests*", "wiki*", "tddai*"]