Skip to content
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

NBQA ruff fails on Windows when the notebook file name has spaces unless --nbqa-shell is used #812

Open
felix-cw opened this issue Apr 17, 2023 · 2 comments

Comments

@felix-cw
Copy link

I ran the following in a powershell core prompt and git bash in Windows:

nbqa ruff 'nbqa test.ipynb'

The output was as follows:

nbqa:1:1: E902 The system cannot find the file specified. (os error 2)
test62najpm6.py:1:1: E902 The system cannot find the file specified. (os error 2)
Found 2 errors.
error: Failed to lint test62najpm6.py: The system cannot find the file specified. (os error 2)
error: Failed to lint nbqa: The system cannot find the file specified. (os error 2)

I confimed that when the space was removed, the command ran as expected. It also works with black, flake8, isort instead of ruff.
I also tried wrapping the file name in double quotes and it still doesn't work.

I can get it to work by adding the --nbqa-shell option. I also confirmed that it works in WSL.

Happy to use --nbqa-shell for now.

@MarcoGorelli
Copy link
Collaborator

hi

I'm confused by nbqa ruff 'nbqa test.ipynb' - isn't the way to run it nbqa ruff test.ipynb?

@MarcoGorelli
Copy link
Collaborator

ah, the file name is nbqa test.ipynb - OK, thanks for the report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants