Skip to content

Pytest and pylint discovery fails for Azure Dev Ops project name with spaces (%20) #9476

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

Closed
chrislill opened this issue Jan 9, 2020 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@chrislill
Copy link

  1. Create Azure Dev Ops project containing spaces
  2. Clone git repository
  3. Configure python environment with pytest and pylint
  4. Create a python file and unit test
  5. Open project in VS Code

Actual results:

  1. Pylint fatal error: "No module named c:\Users\clill\Source\Repos\Debswana0Predictive0Analytics0Platform\DBSAISolution\DBSAIModels\code\dbsai_downtime_coarse_dms\train_model.py"
  2. Test discovery error: "ERROR: Directory 'c:\Users\clill\Source\Repos\Debswana0Predictive0Analytics0Platform\DBSAISolution\DBSAIModels' not found. Check your '--rootdir' option."

Expected results:

  1. Pylint runs successfully
  2. Unit test is discovered by pytest

Note:
The root directory contains '0' where it should contain '%20'

Extension version: 2020.1.57204
VS Code version: Code 1.41.1 (26076a4de974ead31f97692a0d32f90d735645c0, 2019-12-18T14:58:56.166Z)
OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (4 x 2808)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.93GB (6.55GB free)
Process Argv
Screen Reader no
VM 0%
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Jan 9, 2020
@chrislill
Copy link
Author

chrislill commented Jan 9, 2020

Looks like the rootdir contains '0' instead of '%20'

Git repository is https://[email protected]/DebswanaAzureProject/Debswana%20Predictive%20Analytics%20Platform/_git/Debswana%20Predictive%20Analytics%20Platform

pytest error
pylint error

where it should contain '%20'. Two screenshots attached.

@ghost
Copy link

ghost commented Jan 9, 2020

Linting in the latest vscode-python extension is not working for me either so I've to downgrade it.

@chrislill
Copy link
Author

chrislill commented Jan 9, 2020

I'm also having issues with debugging, presumably from the same issue with rootdir.
Agree with sys-temd. There's an easy workaround to install the previous version of the python extension.

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 9, 2020
@karthiknadig karthiknadig added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug and removed triage-needed Needs assignment to the proper sub-team labels Jan 9, 2020
@kimadeline
Copy link

Hi @chrislill 👋 Thank you for reaching out.

Issue #9490 should address that since it removes conda run usage, for now. In the meantime, as both of you pointed out, downgrading the extension to the previous release (2019.11) is a workaround.

@kimadeline
Copy link

Hi @chrislill and @sys-temd ,

The conda run fix is now merged in master, so if you're interested in trying it out before the Monday release you are welcome to download our Insiders build (Settings -> "python.insidersChannel": "daily").

Thank you for your patience!

@kimadeline
Copy link

Closing since the conda run work has been reverted in the latest release (2020.1.58038).

Note: seems to be a Windows-only problem, since the following commands worked on macOS + zsh:

  • ~/opt/anaconda3/bin/conda run -n myenv python -m pytest --rootdir "/Users/kimiguel/Documents/Sandbox/conda spaces"
  • ~/opt/anaconda3/bin/conda run -n myenv python -m pylint "~/Documents/Sandbox/conda spaces/hello.py"

@ghost ghost removed the triage label Jan 14, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants