All I need is a Codespace preconfigured for Jupyter Notebooks and Pylance disabled. But after several months of trying, I still can't get it working reliably! #108662
Replies: 2 comments 2 replies
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Hi @kostrykin, Did you ever figure this out? I am also stumped in my quest to disable linting. I don't understand why Python > Analysis: Diagnostics Mode does not have an "Off" option. Zach |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
The title pretty much says it all. For education purposes, I need to preconfigure a Codespace for students, which has the
ms-toolsai.jupyter
extension installed, and Pylance as well as all other types of linters disabled. To accomplish that, I started experimenting with different configurations of devcontainer.json. However, Codespaces created using that behaved inconsistently, for example, sometimes the Jupyter extension was loaded, sometimes not.I then found that it is now possible to use prebuilt containers, which I hoped was more reliable. And indeed, Codespaces created using my prebuilt container seem to be more consistent.
Still, there is a not-so-small chance, that when creating a Codespace using this container, some arbitrary errors will pop up inside the Codespace. Here is an example. Below are two screenshots, both show a newly created Codespace from this repo, right after creating a new test.ipynb file.
As you can see, in one case, there is an error about Pylance reported. In the other case it is not. Note that I had the Codespace deleted and created newly between taking the two screenshots. Moreover, in the first case, a Jupyter Kernel seem to have been selected automatically, whereas in the second case it is not selected automatically (cf. top right corner of the screenshots).
The ingredients for building the container are found in this repo. I build the container by using
The Dockerfile is pretty flat and only installs some requirements:
And the .devcontainer.json file used for building the container takes care of (i) loading the Jupyter extension, (ii) hiding spurious Python kernels, and (iii) disables linting for all *.ipynb files:
At least this is what it is supposed to do, as far as I understand it.
The prebuilt container can be tested simply by loading the corresponding image,
or simply created a Codespace for the repo: https://github.com/kostrykin/mobi-devcontainer-python/tree/main
Help is very much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions