|
23 | 23 | python-version: ['3.8', '3.9', '3.10', '3.11'] |
24 | 24 |
|
25 | 25 | steps: |
26 | | - - uses: actions/checkout@v3 |
| 26 | + - name: Checkout code |
| 27 | + uses: actions/checkout@v3 |
| 28 | + with: |
| 29 | + fetch-depth: 0 # Fetch all history for version tagging |
27 | 30 |
|
28 | 31 | - name: Set up Python ${{ matrix.python-version }} |
29 | 32 | uses: actions/setup-python@v4 |
@@ -73,17 +76,24 @@ jobs: |
73 | 76 | echo "Directory contents:" |
74 | 77 | ls -la |
75 | 78 | |
76 | | - # Check if poetry.lock exists, generate it if not |
| 79 | + # First install only the project dependencies (without lock file) |
| 80 | + echo "\n=== Installing project dependencies (initial pass) ===" |
| 81 | + python -m poetry install --no-interaction --no-ansi -v --only main || \ |
| 82 | + { echo "Initial dependency installation failed"; exit 1; } |
| 83 | + |
| 84 | + # Now generate the lock file if it doesn't exist |
77 | 85 | if [ ! -f poetry.lock ]; then |
78 | | - echo "\n=== No poetry.lock found, generating lock file ===" |
| 86 | + echo "\n=== Generating poetry.lock ===" |
79 | 87 | python -m poetry lock --no-update || \ |
80 | 88 | { echo "Failed to generate poetry.lock"; exit 1; } |
81 | 89 | fi |
82 | 90 | |
83 | | - echo "\n=== Running poetry install ===" |
| 91 | + # Install all dependencies with the lock file |
| 92 | + echo "\n=== Installing all dependencies ===" |
84 | 93 | python -m poetry install --with dev,test --no-interaction --no-ansi -v || \ |
85 | | - { echo "poetry install failed"; exit 1; } |
| 94 | + { echo "poetry install with dev/test failed"; exit 1; } |
86 | 95 | |
| 96 | + # Verify the environment |
87 | 97 | echo "\n=== Environment information ===" |
88 | 98 | python -m poetry env info |
89 | 99 | |
|
0 commit comments