Skip to content

MAINT add jupyter extension and pre-commit in devcontainer - #32342

Merged
lesteve merged 4 commits into
scikit-learn:mainfrom
glemaitre:improve_devcontainer
Oct 21, 2025
Merged

lesteve merged 4 commits into
scikit-learn:mainfrom
glemaitre:improve_devcontainer

Conversation

@glemaitre

Copy link
Copy Markdown
Member

Improve the devcontainer by adding jupyter extension and pre-commit.

  • Jupyter extension together with ipykernel that is handy to execute example within VS Code
  • pre-commit is useful to avoid failures on the CI for the linter job.

@github-actions

github-actions Bot commented Oct 2, 2025 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: aff7420. Link to the linter CI: here

Comment thread .devcontainer/setup.sh Outdated
# install ipykernel because it is handy to execute the Jupyter notebook VS Code
micromamba install ipykernel -n sklearn-dev --yes
# install pre-commit since it will avoid potential failures with the CI
micromamba install pre-commit -n sklearn-dev --yes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be faster to install the two packages in the same command?

@ogrisel

ogrisel commented Oct 7, 2025

Copy link
Copy Markdown
Member

Also, maybe for a follow-up PR: it might make sense to install mamba by default to make it possible to easily create / update conda envs interactively when working from the the dev container.

@DeaMariaLeon

Copy link
Copy Markdown
Member

Regarding the devcontainers file:

  1. Was this comment forgotten? _ "So maybe we should at least document the purpose of this file, namely, to be used to open the scikit-learn project via the GitHub Codespaces editor." I didn't see it in the documentation.
  2. I was getting this message from vscode a lot, until I changed the containers.showRemoteWorkspaceWarning setting to false.
Screenshot 2025-10-13 at 10 25 47

Maybe it's a good thing to add a small note about the purpose of file, and also how to avoid the message?
Unless it's obvious for everybody..

@lesteve

lesteve commented Oct 13, 2025 •

Copy link
Copy Markdown
Member

Interesting it's slightly different than what I was seeing where I had a "Don't show again" #31096 (comment).

If there is a way to remove the VSCode popup by default, I am all for it but I don't think this is possible.

To be honest, yes it's an annoying popup, but if you ignore it or close it, nothing bad will happen ...

There are two related things:

There is a plan to add a bit more documentation i.e. it was not forgotten e.g. #32474. If you find there is a nice place in the doc, to add the "how do I remove this popup", feel free to open a PR about it 🙏!

I would separate two things:

  • for a newcomer during a sprint: how to use codespaces in your browser
  • someone that uses VSCode locally: how do I remove this annoying popup

@DeaMariaLeon

DeaMariaLeon commented Oct 13, 2025 •

Copy link
Copy Markdown
Member

There is a plan to add a bit more documentation i.e. it was not forgotten e.g. #32474.

I thought there should be a note for developers (but in the devcontainer file itself). Plus PR32474 above doesn't mention the devcontainer file or .devcontainer folder. It only uses it, I guess.

Edit:

"yes it's an annoying popup, but if you ignore it or close it, nothing bad will happen"

I wonder if a beginner will know that nothing bad will happen.

If you find there is a nice place in the doc, to add the "how do I remove this popup", feel free to open a PR about it

Sure, once I figure out how to actually remove it. I thought I had done it, but it's there again. I edited the workspace's settings for containers.showRemoteWorkspaceWarning like I mentioned earlier. Later I checked out a pr from github to test it locally (with gh) and there it is. The setting it's still "correct". - I can figure it out, I'm commenting just for feedback.

@lesteve

lesteve commented Oct 17, 2025

Copy link
Copy Markdown
Member

FYI: the VSCode popup situation and how to remove it was summarized in #32516 (comment).

@lesteve lesteve left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

I tweaked a few things, and made sure I managed to get the Jupyter VSCode extension working in Codespace.

I enabled auto-merge, further improvements can be done in separate PRs.

@lesteve
lesteve enabled auto-merge (squash) October 21, 2025 15:27
@lesteve
lesteve merged commit 597646a into scikit-learn:main Oct 21, 2025
rouk1 pushed a commit to rouk1/scikit-learn that referenced this pull request Nov 3, 2025
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.

4 participants