This document analyzes the Python environment setup, testing infrastructure, and development workflows across the three repositories: infra, airflow-hub, and IndexAgent.
- Method: Requirements files (no Poetry/pip-tools)
- Files:
requirements-dev.txt- Development dependencies only- No production requirements.txt found
- Key Dependencies:
pytest>=7.4.0 pytest-cov>=4.1.0 pytest-airflow>=0.2.0 coverage>=7.3.0 black>=23.7.0 ruff>=0.1.0 mypy>=1.5.0 invoke>=2.2.0 pytest-asyncio>=0.21.0 pytest-mock>=3.11.0
- Version: Python 3.11 (from
Dockerfile) - Type Checking: Configured for Python 3.10 in
pyproject.toml - Black Target: Python 3.10 and 3.11 (
pyproject.toml)
- Formatter: Black (line-length: 100)
- Linter: Ruff with extensive rule selection
- Type Checker: MyPy with strict settings:
warn_return_any = truewarn_unused_configs = truedisallow_untyped_defs = true
- Method: pip with requirements files and pip-tools
- Files:
requirements.txt- Production dependenciesrequirements/requirements-dev.txt- Generated with pip-compilerequirements/requirements-dev.in- Source for dev requirements
- Key Dependencies:
apache-airflow==3.0.0 apache-airflow-providers-snowflake==6.3.1 apache-airflow-providers-docker==4.3.1 pandas==2.1.4 numpy==1.26.4 scikit-learn==1.4.2 pytest==7.3.1 (in main requirements) flake8==7.2.0 (in dev requirements)
- Version: Python 3.11 (from
Dockerfile.test) - Constraints: Uses Airflow 3.0.0 constraints for Python 3.11
- Linter: flake8 (from dev requirements)
- No formatter or type checker configured
- No Python dependency files found
- Purpose: Infrastructure orchestration only
- Scripts: Shell scripts only (
scripts/check-ports.sh)
tests/
├── test_claude_cli.py
├── test_devcontainer_integration.py
├── test_example.py
├── test_worktree_manager.py
└── integration/
├── __init__.py
├── test_high_load_20.py
└── test_parallel_dag.py
- Framework: pytest with plugins
- Configuration:
pytest.ini[pytest] addopts = --maxfail=1 --disable-warnings -q -p no:pytest_asyncio -p no:asyncio
- Coverage: Configured in
pyproject.toml- Branch coverage enabled
- Source:
indexagentmodule - Exclusions for pragma, repr, assertions
- Coverage Script:
scripts/run_cov.py- Python wrapper for pytest - Task Runner: Invoke with
tasks/quality.py- Unit tests:
invoke pytest-unit - Integration tests:
invoke pytest-integration - All tests with 90% coverage requirement:
invoke pytest-all
- Unit tests:
tests/
├── __init__.py
├── test_dag_validation.py
├── test_market_analysis_dag.py
├── dags/
├── plugins/
│ ├── __init__.py
│ ├── project_analytics/
│ │ ├── __init__.py
│ │ └── test_data_quality_operator.py
│ └── project_trading/
│ ├── __init__.py
│ └── test_ibkr_data_operator.py
└── scripts/
└── test_extract_ibkr_data_cli.py
- Framework: pytest
- Configuration:
pytest.ini- Logging enabled
- Deprecation warnings filtered
- Environment variables removed (handled by Dockerfile)
- Test Types:
- DAG validation tests
- Plugin/operator tests
- Script tests
- Docker-based:
Dockerfile.test - Default command:
pytest -v -s tests/
- No Python tests found
- Purpose: Infrastructure validation only
scripts/
├── README.md
├── agent_fix_todos.sh
├── ai_test_loop.sh
├── check_system.py
├── run_cov.py
├── smoke_run.sh
├── test_sanity_checks.sh
├── documentation/
│ ├── agent_write_docs.sh
│ ├── find_undocumented.py
│ └── update_docs_coverage.sh
├── maintenance/
│ ├── agent_fix_todos.sh
│ └── baseline_audit.sh
└── testing/
├── ai_test_loop.sh
└── run_cov.py
- Shell scripts:
snake_case.sh - Python scripts:
snake_case.py - AI-assisted scripts:
agent_*.shorai_*.sh
- Testing: Coverage, test loops, sanity checks
- Documentation: Finding undocumented code, coverage updates
- Maintenance: TODO fixes, baseline audits
- System: Environment checks
scripts/
├── bootstrap_airflow.py
└── inventory_rename.py
- bootstrap_airflow.py: Airflow initialization
- inventory_rename.py: Data management utility
scripts/
└── check-ports.sh
- check-ports.sh: Port availability validation
-
Task Runner: Invoke
- Configuration:
invoke.yaml - Tasks:
tasks/quality.py - Commands:
invoke black- Format codeinvoke ruff- Fix linting issuesinvoke mypy- Type checkinvoke all- Run all quality checks
- Configuration:
-
Makefile: Docker and service management
make up- Start servicesmake down- Stop servicesmake find-undocumented- Documentation check
-
Coverage Requirements:
- Enforced 90% minimum coverage
- HTML reports:
invoke coverage-report
- Code formatting with Black
- Linting with Ruff
- Type checking with MyPy
- Unit and integration testing
- Coverage verification
-
No task runner configured
-
Docker-based testing:
- Build:
docker build -f Dockerfile.test -t airflow-test . - Run:
docker run airflow-test
- Build:
-
pip-tools for dependency management:
- Compile:
pip-compile requirements/requirements-dev.in
- Compile:
- DAG validation testing
- Plugin/operator testing
- Docker-based test execution
-
Makefile: Service orchestration
make check-ports- Validate portsmake up- Start all services
-
Multi-repo coordination:
- Orchestrates docker-compose files from multiple repos
- Environment variable management via
.env
- No CI/CD configurations found in any repository
- No
.github/workflows/,.gitlab-ci.yml, or other CI files - No pre-commit hooks configured
name: Python CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.10, 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements-dev.txt
- name: Run quality checks
run: |
invoke allagent-evolution/
├── __init__.py
├── core/
│ ├── __init__.py
│ ├── agent.py
│ ├── evolution.py
│ └── fitness.py
├── operators/
│ ├── __init__.py
│ ├── mutation.py
│ ├── crossover.py
│ └── selection.py
├── utils/
│ ├── __init__.py
│ ├── metrics.py
│ └── visualization.py
└── tests/
├── __init__.py
├── test_agent.py
├── test_evolution.py
└── integration/
└── test_full_evolution.py
- In IndexAgent: Add as a new module under
indexagent/ - In airflow-hub: Create as an Airflow plugin for DAG-based evolution
- Testing: Follow existing pytest patterns with coverage requirements
# Create virtual environment
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
# Install development dependencies
pip install -r requirements-dev.txt
# Install agent-evolution in development mode
pip install -e .
# Run tests with coverage
invoke pytest-all- IndexAgent: Well-structured with comprehensive tooling
- Type safety: MyPy configuration in IndexAgent
- Test organization: Clear separation of unit/integration tests
- Task automation: Invoke tasks for common operations
- Standardize Python versions: All repos should use 3.11
- Add pre-commit hooks: Automate quality checks
- Implement CI/CD: GitHub Actions for all repos
- Unify dependency management: Consider Poetry or pip-tools across all repos
- Add production requirements: IndexAgent lacks production dependencies
- Enhance airflow-hub tooling: Add formatter, type checker, task runner
- Create
.pre-commit-config.yamlfor automated checks - Add GitHub Actions workflows
- Standardize development dependencies across repos
- Document Python version requirements
- Create unified development setup guide