@@ -34,35 +34,23 @@ jobs:
3434 python -m venv venv
3535 . venv/bin/activate
3636 pip install pytest
37-
38- # --- Start of fix ---
39- # The version "v1.1.8" in setup.py is not PEP 440 compliant and causes
40- # pip's resolver to ignore the local wheel. We remove the "v" before building.
41- echo "Original version:"
42- grep "version=" setup.py
43- sed -i 's/version="v/version="/' setup.py
44- echo "Fixed version:"
45- grep "version=" setup.py
46- # --- End of fix ---
4737
48- # We don't install the wheel directly. Instead, we'll tell pip to look
49- # in the 'dist' directory when it resolves dependencies.
38+ # Step 1: Explicitly install the spanner-graph-notebook wheel from the 'dist' directory.
39+ # This is the most direct way to ensure the local version from your PR is used.
40+ pip install dist/*.whl
5041
51- # Install bigquery-magics and its extras.
52- # The --find-links flag tells pip to look in the local dist/ directory
53- # for packages before going to PyPI. This will make it pick up
54- # the locally built wheel to satisfy the 'spanner-graph-notebook' dependency.
55- pip install --find-links=dist ./python-bigquery-magics[spanner-graph-notebook]
42+ # Step 2: Install python-bigquery-magics from its local directory.
43+ # We DO NOT use the [spanner-graph-notebook] extra because the dependency has already
44+ # been satisfied in the previous step.
45+ pip install ./python-bigquery-magics
5646
57- # The comment in the original file about removing the source directory to
58- # prevent path conflicts was a good idea, but the command was incorrect.
59- # This removes the 'spanner_graphs' source package directory.
47+ # Clean up the source directory to prevent potential import path conflicts during testing.
6048 rm -rf spanner_graphs
6149
6250 pip install google-cloud-testutils
6351
64- # Change directory into the bigquery-magics checkout
52+ # Change directory into the bigquery-magics checkout to run its tests.
6553 cd python-bigquery-magics
6654
67- # Run the tests from within its own directory
68- pytest -v tests/unit/test_graph_server.py tests/unit/bigquery/test_bigquery.py
55+ # Run the tests. They should now find the correct spanner-graph-notebook package.
56+ pytest -v tests/unit/test_graph_server.py tests/unit/bigquery/test_bigquery.py
0 commit comments