Skip to content

Fix downstream test: install ipykernel from source for jupyter_kernel_test - #1560

Open
glaziermag wants to merge 1 commit into
ipython:mainfrom
glaziermag:jkt-test-checkout
Open

Fix downstream test: install ipykernel from source for jupyter_kernel_test#1560
glaziermag wants to merge 1 commit into
ipython:mainfrom
glaziermag:jkt-test-checkout

Conversation

@glaziermag

Copy link
Copy Markdown

The jupyter_kernel_test job in downstream.yml never installs this checkout. pip install -e ".[test]" inside the clone pulls ipykernel from PyPI, so on every pull request and every push to main the kernel conformance suite runs against the released wheel (currently 7.3.0) instead of the code under review. The step used to rely on a global pip install . --force-reinstall, which 2d0f2dd (Dec 2021) removed when the other downstream jobs moved to downstream-test; that action installs the checkout for them, but this job doesn't use it.

In main's latest run of the job, the only local install is the jupyter_kernel_test clone itself, ipykernel comes from Using cached ipykernel-7.3.0-py3-none-any.whl (120 kB), and there is no Processing /home/runner/work/ipykernel/ipykernel line. main's _version.py also says 7.3.0, so the version number alone can't tell the two apart.

This change installs the checkout first, so the ipykernel that jupyter_kernel_test's [test] extra asks for is already satisfied by it. It also adds an assertion that fails when ipykernel was installed from an index, as it is on main today: pip writes a direct_url.json only for path and URL installs. That way the job can't quietly go back to testing PyPI.

On a fork, the python3 kernel the suite starts imports a kernelbase.py identical to the checkout's with this change (job) and the PyPI one without it (job).

🤖🤖 An AI agent found this in the job log above, made the change, and ran both versions on a fork.

🤖 Generated with Claude Code

…ob 🤖🤖

`pip install -e ".[test]"` in the jupyter_kernel_test clone resolved
ipykernel from PyPI, so the job tested the released wheel instead of
this checkout. Install the checkout first, and fail if the installed
ipykernel has no direct_url.json (i.e. came from an index).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant