fix: add fallback imports for direct module execution #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Test basic imports | |
| run: | | |
| python -c "import pandas, numpy, matplotlib, yfinance, scipy, sklearn; print('✅ All basic imports successful!')" | |
| - name: Test module imports | |
| run: | | |
| cd src | |
| python -c "import markowitz; print('✅ Markowitz module import successful!')" | |
| python -c "import risk_parity; print('✅ Risk parity module import successful!')" | |
| python -c "import monte_carlo; print('✅ Monte Carlo module import successful!')" | |
| python -c "import black_litterman; print('✅ Black-Litterman module import successful!')" | |
| python -c "import ml_predictor; print('✅ ML predictor module import successful!')" | |
| python -c "import hybrid_model; print('✅ Hybrid model module import successful!')" | |
| python -c "import custom_metrics_opt; print('✅ Custom metrics module import successful!')" | |
| python -c "import walkforward_backtest; print('✅ Walkforward backtest module import successful!')" | |
| python -c "import data_utils; print('✅ Data utils module import successful!')" | |
| python -c "import metrics_utils; print('✅ Metrics utils module import successful!')" |