microsoft / microsoft/vscode-python-debugger

Conda environment initialized differently when executing vs debugging unit tests

Ouverte
#736 3 commentaires 0 réactions 1 personne assignée Voir sur GitHub

@eleanorjboyd y travaille déjà.

Depuis le 30/6/2025.

triage-needed
Langage dominant
TypeScript
Étoiles
180
Forks
126
Merge moyen
2 j 3 h
PR mergées (30 j)
3

Description

I have to develop my code on a custom python stack that doesn't fully conform to anaconda; many packages are initialized by adding them to PYTHONPATH with a command-line tool. I automated this by creating an activation script that went under etc/conda/activate.d. I also have a .env in the workspace root that sets the same PYTHONPATH. I works but I found the following issue:

  • When a unit test is started without debugging the procedure of running it is: 1) source .env 2) execute conda run ... which will result in sourcing the custom activation scripts under etc/conda/activate.d.
  • When a unit test is started in the debugger, the procedure differs: 1) source .env 2) execute some auto-generated script that will call the debugpy module. The custom activation scripts under etc/conda/activate.d seem not be sourced.

This can be an issue for some. The behavior should be that the conda environment is activated the same way while debugging and just executing unit tests.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.