|
34 | 34 | sudo rm -rf "$GITHUB_WORKSPACE/.git/shallow.lock" 2>/dev/null || true |
35 | 35 | sudo chown -R $USER:$USER "$GITHUB_WORKSPACE" 2>/dev/null || true |
36 | 36 | # Clean workspace contents but keep the directory itself |
37 | | - find "$GITHUB_WORKSPACE" -mindepth 1 -maxdepth 1 -exec sudo rm -rf {} + 2>/dev/null || true |
| 37 | + sudo rm -rf "$GITHUB_WORKSPACE"/* "$GITHUB_WORKSPACE"/.[!.]* 2>/dev/null || true |
38 | 38 | fi |
39 | 39 | |
40 | 40 | - name: Configure git |
|
50 | 50 | run: | |
51 | 51 | # Use system python3 on self-hosted runner |
52 | 52 | python3 --version |
53 | | - # Python 3.12+ requires --break-system-packages for system-wide installation |
| 53 | + # Python 3.12+ requires --break-system-packages to override PEP 668 externally-managed-environment protection |
54 | 54 | python3 -m pip install --break-system-packages --upgrade pip || python3 -m pip install --user --upgrade pip |
55 | 55 | |
56 | 56 | - name: Start test services with Docker |
|
94 | 94 | ipfs-datasets-graphrag-tests:py${{ matrix.python-version }} |
95 | 95 | else |
96 | 96 | echo "Running tests with system Python" |
97 | | - python3 -m pip install --break-system-packages -e ".[test]" || python3 -m pip install --user -e ".[test]" || true |
| 97 | + # Try to install test dependencies with PEP 668 override, fallback to user install |
| 98 | + if ! python3 -m pip install --break-system-packages -e ".[test]" 2>/dev/null; then |
| 99 | + if ! python3 -m pip install --user -e ".[test]" 2>/dev/null; then |
| 100 | + echo "Warning: Failed to install test dependencies, proceeding anyway" |
| 101 | + fi |
| 102 | + fi |
98 | 103 | python3 -m pytest tests/ -v --tb=short -k "not slow" || echo "Tests completed with errors" |
99 | 104 | fi |
100 | 105 | |
@@ -146,7 +151,7 @@ jobs: |
146 | 151 | - name: Set up Python |
147 | 152 | run: | |
148 | 153 | python3 --version |
149 | | - # Python 3.12+ requires --break-system-packages for system-wide installation |
| 154 | + # Python 3.12+ requires --break-system-packages to override PEP 668 externally-managed-environment protection |
150 | 155 | python3 -m pip install --break-system-packages --upgrade pip || python3 -m pip install --user --upgrade pip |
151 | 156 | |
152 | 157 | - name: Run bandit security scan |
|
0 commit comments