-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add VS Code config for SAGE_ROOT/venv #30677
Comments
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:5
Hoping we can make progress on this ticket this week - https://wiki.sagemath.org/days111 |
Changed keywords from none to sd111 |
Author: Tobias Diez |
comment:7
rebase is needed |
comment:8
This ticket could also be retargeted to #31377, using |
comment:9
Replying to @mkoeppe:
The nice thing about pipenv is that one can specify python packages for development, and so install e.g. pytest and linters in the virtual environment. VS code picks these up, and complains if they are not installed otherwise. Does sage's build setup has a similar flag to install dev packages? |
comment:10
In the current model, the linters are installed by tox into the tox environment. |
comment:11
needs a rebase |
comment:12
Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date. |
comment:13
Setting a new milestone for this ticket based on a cursory review. |
comment:14
This should be redone without dep on #30371 |
This comment has been minimized.
This comment has been minimized.
comment:28
What is the work issue "config test discovery"? |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:30
Replying to @mkoeppe:
Adding config for VS code testing feature: https://code.visualstudio.com/docs/python/testing. |
Changed work issues from config test discovery to none |
comment:32
It would be nice if this could be reviewed (and merged) relatively soon. |
comment:33
Does it mean to work together with a particular VSCode plugin? |
comment:35
Replying to @dimpase:
With the "standard" python extension https://marketplace.visualstudio.com/items?itemName=ms-python.python, which I've now also added as "recommendation" (vscode will ask once when a workspace is opened for the first time to install these recommended extensions). |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:37
I got it installed, and what should I try? I don't use vscode for developent, so it's pretty unclear. Incidentally, I saw that vscode has support for jupyter notebooks now, but the kernels it knows are the Python only ones. Should it know - be able to discover somehow - Sage's jupyter kernel, too? |
comment:38
It should "just work". This ticket is not doing much, only adding basic configs so that vs code is automatically discovering the right things. In particular:
Coding you still have to do yourself though ;) (or install https://copilot.github.com/) But you are right, adding documentation for how to use vs code might be a good follow-up. The same for the jupyter support - I had a quick look and it seems to work in principle but still have to figure out the details. |
comment:39
Replying to @tobiasdiez:
I know it's hard to explain in text - but I have trouble understanding how to do the By
I sometimes use vscode as an IDE to write markdown or LaTeX (or Lean :-)), but never for other things, so far. |
comment:40
For the virtual env, you should have something like With this ticket, this is now the default and can be changed as described in https://code.visualstudio.com/docs/python/environments#_select-and-activate-an-environment. For testing, vscode should now look for pytests instead of the "Configure Python tests" window that you get normally after activating the test icon (with the red border) For jupyter, it may work if you have jupter installed in the sage venv and then select it as the kernel as described here https://code.visualstudio.com/docs/datascience/jupyter-notebooks#_create-or-open-a-jupyter-notebook. |
comment:41
OK, I'm getting somewhere with Jupyter. This time I started with opening the SAGE_ROOT "folder", clicked on "trust the author", and only after that, opened a Sage Jupyter notebook. Now, the Sage kernel shows up in the kernel list, and if I choose it, then after a while (~10 sec or more, I thought it just hangs, at first) it loads and everything works. Anyhow, these details (about opening folger and blessing it) should be added to wiki, or docs, something like this. Otherwise, good! |
Reviewer: Dima Pasechnik |
Changed dependencies from #32442 to none |
comment:43
It should be adverticed in the release wiki, we probably will then get a lot of feedback. |
comment:44
Thanks for the review. I agree that it would be helpful to have a how to get started with vscode, especially for beginners. But I couldn't any similar docs for other Ides either. What are the conventions, and is it okay to "advertise" vscode by adding it to the docs? |
comment:45
This would be a very valuable contribution. We have a meta-ticket #30500 for these kinds of things, but so far nobody has done the work. |
comment:46
Replying to @tobiasdiez:
as vscode is getting dominant, hiding from the public that we have these binding in Sage is kind of silly. we do have binding for jupyter(lab), and something for emacs too, so it's not setting up a precedent. |
Changed branch from public/build/vscode to |
Its recommended to check in some VS Code config files (which makes it easier for new users to start developing).
We configure it to use the Sage venv via the
configure
-generated symlinkSAGE_ROOT/venv
(from #32442)The
.gitignore
configuration follows https://www.toptal.com/developers/gitignore/api/python,visualstudiocodeCC: @mkoeppe
Component: build
Keywords: sd111
Author: Tobias Diez
Branch/Commit:
0eadcd1
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/30677
The text was updated successfully, but these errors were encountered: