notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Add CI check to install with homebrew on `macos`

Open jtpio opened this issue 2 years ago • 11 comments
trafficstars

Troubleshoot https://github.com/jupyter/notebook/issues/6974

jtpio avatar Aug 09 '23 12:08 jtpio

Binder :point_left: Launch a Binder on branch jtpio/notebook/brew-issue

github-actions[bot] avatar Aug 09 '23 12:08 github-actions[bot]

cc @defjaf

Here are the logs for the homebrew installation, which passes on CI: https://github.com/jupyter/notebook/actions/runs/5809598910/job/15748922126?pr=7005

image

If you would like to double check to see if you have something similar locally.

jtpio avatar Aug 09 '23 13:08 jtpio

@jtpio

I get ~exactly the same~ a similar response from pip:

$ python3 -m pip install -vv notebook
Using pip 23.2.1 from /opt/homebrew/lib/python3.11/site-packages/pip (python 3.11)
Non-user install because site-packages writeable

Edit: But mine is actually using homebrew python, whereas yours is, I think, using the system python.

defjaf avatar Aug 09 '23 14:08 defjaf

And the rest of the logs? https://github.com/jupyter/notebook/actions/runs/5809598910/job/15748922126?pr=7005

jtpio avatar Aug 09 '23 14:08 jtpio

I admit it's pretty hard to parse what I've got...

So I attach a file with the console output from pip. Note that this is starting from having jupyterlab 3.6.3 and notebook 6.5.5 installed, so they are upgraded to 4.0.4 and 7.0.3 (but it didn't automatically upgrade other stuff). It does seem to have put a bunch of files below /opt/homebrew/share/jupyter/ but nothing new in /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/share/jupyter/. And I still get the schema console errors and the UI problems.

pip-install-notebook==7 output.txt

Comparing to the CI logs for this PR, I note that "/opt" only appears in "/opt/hostedtoolcache" and that "brew" appears in some environment variables, in "brew install python" and the name of the issue itself.

defjaf avatar Aug 09 '23 14:08 defjaf

@jtpio Looking more carefully, even from the beginning of the logs, the CI is using /Library/Frameworks/Python.framework/... whereas my homebrew install is using /opt/homebrew/... — it looks like the CI build isn't using the homebrew python?

defjaf avatar Aug 09 '23 14:08 defjaf

Maybe we could check whether it's possible to install under /opt/homebrew on CI.

And also add a Playwright test to check if the same schema errors appear in the browser console on CI.

jtpio avatar Aug 09 '23 15:08 jtpio

Maybe we could check whether it's possible to install under /opt/homebrew on CI.

Well, I think the point is that the CI process isn't using the homebrew python and so not automatically picking up the homebrew paths like sys.prefix. Somehow the path and other variables need to be set; the usual way to do this is eval "$(/opt/homebrew/bin/brew shellenv)" before running any further commands (e.g., in .bashrc). Or can you write the script with a hard-coded python executable /opt/homebrew/bin/python3?

defjaf avatar Aug 09 '23 16:08 defjaf

Or can you write the script with a hard-coded python executable /opt/homebrew/bin/python3?

Or /usr/local/bin/python3 if the CI machines are intel.

defjaf avatar Aug 11 '23 09:08 defjaf

Seems like the CI machines are running on Intel, and that the same issues do not arise in that case, according to https://github.com/jupyter/notebook/pull/7006.

defjaf avatar Aug 15 '23 10:08 defjaf

see https://github.com/jupyter/notebook/pull/7006#issuecomment-1682181317 for information about running in a venv.

defjaf avatar Aug 17 '23 12:08 defjaf