From be3902c4120d45a285cea313696c4bc9576898f2 Mon Sep 17 00:00:00 2001 From: tegwick Date: Tue, 23 Sep 2025 02:41:32 +0200 Subject: [PATCH] feat: Add Python dependency management and fix test environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- install-pip.sh | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 15 ++++++++++ 2 files changed, 89 insertions(+) create mode 100644 install-pip.sh create mode 100644 pyproject.toml diff --git a/install-pip.sh b/install-pip.sh new file mode 100644 index 00000000..f4f6a722 --- /dev/null +++ b/install-pip.sh @@ -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" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..838e04f1 --- /dev/null +++ b/pyproject.toml @@ -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*"]