diff --git a/.github/import_test.py b/.github/import_test.py index c1bebbd4e4..9c26736e18 100644 --- a/.github/import_test.py +++ b/.github/import_test.py @@ -18,7 +18,7 @@ n_samples = 10 # Note that the symbols at the end are for centering the table -markdown_output = f"## \n\n| Imported Module ({n_samples=}) | Importing Time (seconds) | Standard Deviation (seconds) |\n| :--: | :--------------: | :------------------: |\n" +markdown_output = f"## \n\n| Imported Module ({n_samples=}) | Importing Time (seconds) | Standard Deviation (seconds) | Times List (seconds) |\n| :--: | :--------------: | :------------------: | :-------------: |\n" exceptions = [] @@ -45,10 +45,16 @@ time_taken = float(result.stdout.strip()) time_taken_list.append(time_taken) + for time in time_taken_list: + if time > 2.5: + exceptions.append(f"Importing {import_statement} took too long: {time:.2f} seconds") + break + if time_taken_list: avg_time_taken = sum(time_taken_list) / len(time_taken_list) std_dev_time_taken = math.sqrt(sum((x - avg_time_taken) ** 2 for x in time_taken_list) / len(time_taken_list)) - markdown_output += f"| `{import_statement}` | {avg_time_taken:.2f} | {std_dev_time_taken:.2f} |\n" + times_list_str = ", ".join(f"{time:.2f}" for time in time_taken_list) + markdown_output += f"| `{import_statement}` | {avg_time_taken:.2f} | {std_dev_time_taken:.2f} | {times_list_str} |\n" if exceptions: raise Exception("\n".join(exceptions)) diff --git a/.github/workflows/test_imports.yml b/.github/workflows/test_imports.yml index a9a5b88b34..d39fc37242 100644 --- a/.github/workflows/test_imports.yml +++ b/.github/workflows/test_imports.yml @@ -22,13 +22,13 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - name: Install Spikeinterface with only core dependencies run: | git config --global user.email "CI@example.com" git config --global user.name "CI Almighty" python -m pip install -U pip # Official recommended way - pip install -e . # This should install core only + pip install . # This should install core only - name: Profile Imports run: | echo "## OS: ${{ matrix.os }}" >> $GITHUB_STEP_SUMMARY @@ -38,8 +38,7 @@ jobs: shell: bash # Necessary for pipeline to work on windows - name: Install in full mode run: | - python -m pip install -U pip # Official recommended way - pip install -e .[full] + pip install .[full] - name: Profile Imports with full run: | # Add a header to separate the two profiles