Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Development and build files
.venv/
.env
.envrc
*.pyc
__pycache__/
.pytest_cache/
.coverage
htmlcov/
.mypy_cache/
.ruff_cache/

# Git
.git/
.gitignore

# IDEs
.vscode/
.idea/
*.swp
*.swo

# Documentation builds
docs/_build/
site/

# Temporary files
*.tmp
*.log
.DS_Store
Thumbs.db

# Local development
examples/data/
*.local
.cursorignore
.cursorindexingignore
20 changes: 20 additions & 0 deletions .gdpval-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Configuration file for development environment setup
[venv]
path = ".venv"
python_version = "3.11"

[project]
name = "gdpval-base"
description = "Docker Images and analysis to partially replicate OpenAI's GDPval"

[scripts]
setup = "./scripts/setup.sh"
test = "./scripts/dev.sh test"
lint = "./scripts/dev.sh lint"
format = "./scripts/dev.sh format"
run = "./scripts/dev.sh run"

[docker]
image_name = "gdpval-base"
dev_service = "gdpval-base"
prod_service = "gdpval-base-prod"
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Use Python 3.11 official image
FROM python:3.11-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1

# Set work directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*

# Create virtual environment
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

# Copy requirements first for better caching
COPY requirements.txt requirements-dev.txt ./

# Install Python dependencies
RUN pip install --upgrade pip && \
pip install -r requirements.txt

# Copy project files
COPY . .

# Install the package in development mode
RUN pip install -e .

# Create a non-root user
RUN useradd --create-home --shell /bin/bash app && \
chown -R app:app /app /opt/venv
USER app

# Expose port (if needed for future web services)
EXPOSE 8000

# Default command
CMD ["python", "-c", "from gdpval_base import GDPvalAnalyzer; print('GDPval Base package is ready!')"]
59 changes: 59 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.PHONY: help setup test lint format run clean docker-build docker-run docker-dev

help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)

setup: ## Set up development environment
@echo "Setting up development environment..."
./scripts/setup.sh

test: ## Run tests with coverage
@echo "Running tests..."
./scripts/dev.sh test

lint: ## Run linting checks
@echo "Running linting checks..."
./scripts/dev.sh lint

format: ## Format code
@echo "Formatting code..."
./scripts/dev.sh format

run: ## Run the package
@echo "Running package..."
./scripts/dev.sh run

clean: ## Clean up generated files
@echo "Cleaning up..."
rm -rf .venv/
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf .pytest_cache/
rm -rf htmlcov/
rm -rf .coverage
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete

docker-build: ## Build Docker image
@echo "Building Docker image..."
docker build -t gdpval-base .

docker-run: docker-build ## Run Docker container
@echo "Running Docker container..."
docker run -it gdpval-base

docker-dev: ## Start development environment with Docker Compose
@echo "Starting development environment..."
docker-compose up gdpval-base

install: ## Install package in current environment
@echo "Installing package..."
pip install -e .

install-dev: ## Install package with development dependencies
@echo "Installing package with development dependencies..."
pip install -e .[dev]
Loading