141 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
110
views
VS Code hangs at Pytest discovery
I'm having issues with getting VS Code to integrate Pytest discovery, where it just hangs indefinitely on discovering tests for the workspace. I've tried about every solution, and I have a minimal ...
3
votes
2
answers
317
views
Why won't VSCode Smart Send my Python code line by line to the terminal as it used to?
I generally just run my Python code line-by-line using the Python Smart Send feature on VSCode, but after I was away from work for a bit, it suddenly stopped working. Normally Shift + Enter or Right ...
0
votes
0
answers
115
views
Pausing or adding new breakpoints halfway during running in VSCode makes the Python Exception uncaught, unhandled, and lost
Pausing or adding new breakpoints halfway during debugging in VSCode seems to make the Python Exception uncaught.
The following is a minimal example to reproduce my problem.
import contextlib, signal
...
1
vote
1
answer
93
views
Multiple Python Paths
I have multiple Python Paths to choose from as seen in the images. I remember installing Python via brew and through the internet and Anaconda.
I don't have any idea which are redundant and what to ...
1
vote
1
answer
78
views
Get current function name
Executing
vscode.executeDocumentSymbolProvider
gives me all symbols in the file.
Can I somehow get name of the function that the cursor is currently in?
0
votes
1
answer
69
views
VSCode Failing to properly activate venvs in workspace with more than one folder/interpreter
Had an issue start with VSCode the last week or so, and not sure if there's just something wrong with my system, my vscode config, or if there's just a vscode bug.
To start, I'm running on OSx Sequoia ...
0
votes
0
answers
37
views
VSCode python (remote) - slow "rename symbol" when opening parent/root directories?
Given I have stored my git repos at ~/git/project1, ~/git/groupA/foo, etc.
When I open the root directory ~/git with VSCode and refactor code via "rename symbol" or "rename file",
...
-1
votes
1
answer
100
views
vscode extension uses wrong python
I am trying to use sqlfluff linter, which is a SQL formatter and linter. In settings.json I have, among others, this:
"[sql]": {
"editor.defaultFormatter": &...
1
vote
0
answers
38
views
Is there a way to have VS Code, dynamically, only process/include folders and files I have open and exclude the rest?
I have a big repo of python snippets. pyright goes crazy because I have a bunch of little folders with scripts.
I don't want to have a manually turn it on/off or open specific folders as projects. I ...
0
votes
1
answer
642
views
How do you remove a python venv from vscode?
I've added several custom virtual environments to vscode, so that when I use the command palette I can select from a variety of builtin ones, as well as my own.
I'd like to remove some of these, but I ...
2
votes
1
answer
335
views
How to set Visual Studio Code Python Interpreter to a Python Virtual Environment in a Parent Directory?
I have a python virtual environment in /Documents and a project in /Documents/Code/Python/example. I want to use this venv in my project but I can't get the vs code python interpreter to recognize ...
1
vote
0
answers
93
views
Pylint protected-access (W0212) warning on module functions not class methods
I receive PylintW0212:protected-access warnings when accessing functions of a module that are prefixed with a single underscore:
import my_module
my_module._function() # Pylint warning here
The ...
1
vote
1
answer
234
views
$PYTHONSTARTUP points to an old version of the extension
Somehow I got myself into a state where python is complaining about PYTHONSTARTUP pointing to a non-existant path. From the terminal tab:
% python
Python 3.11.8 (v3.11.8:db85d51d3e, Feb 6 2024, 18:...
2
votes
1
answer
1k
views
How to input command line arguments when using pytest in VS Code
I have setup my pytest testing to use optional command line arguments. I would like to run and debug these tests in VS Code. However, I am unable to get the command line arguments to work with VS Code....
0
votes
0
answers
118
views
Why cls() in a classmethod does not provide argument hints the way that directly calling the class constructor does?
I'm trying to make a subclass with a @classmethod that would take as arguments an instance of its superclass and kwargs for its other fields. The goal is to be able to take an object of the general ...