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

Add Windows support #68

Merged
merged 5 commits into from Nov 6, 2023
Merged

Add Windows support #68

merged 5 commits into from Nov 6, 2023

Conversation

zyxir
Copy link
Contributor

@zyxir zyxir commented Apr 2, 2023

On Windows there is no "sh -c" available, so run "cmd /c" instead.

@wbolster
Copy link
Owner

wbolster commented Nov 2, 2023

sorry, this escaped my attention. according to this:

https://emacs.stackexchange.com/questions/41891/differences-between-cmdproxy-exe-and-cmd-exe

  • cmd takes /c
  • cmdproxy is emacs specific, and takes -c

so perhaps a single (if (eq system-type 'windows-nt) "/" "-") instead of "-" would work?

@wbolster wbolster added enhancement New feature or request help wanted Extra attention is needed labels Nov 2, 2023
@zyxir
Copy link
Contributor Author

zyxir commented Nov 4, 2023

First, cmdproxy takes both /c and -c. The point is that cmdproxy does some compatibility-related work, so that most functionalities also work on Windows without extra tuning, and is usually recommended over bare cmd.

Second, the main problem is not about "/" or "-". It is the inexistence of a "sh" command on Windows. If it is required to modify as few code as possible, I think we can do (if (eq system-type 'windows-nt) "cmdproxy" "sh").

python-pytest.el Outdated Show resolved Hide resolved
@wbolster
Copy link
Owner

wbolster commented Nov 6, 2023

I think we can do (if (eq system-type 'windows-nt) "cmdproxy" "sh")

yep, good idea!

@wbolster wbolster merged commit 7e8acc0 into wbolster:main Nov 6, 2023
@wbolster wbolster removed the help wanted Extra attention is needed label Nov 6, 2023
@wbolster
Copy link
Owner

wbolster commented Nov 6, 2023

thanks! 🚀

@lld2001
Copy link

lld2001 commented May 12, 2024

@zyxir I'm using msys in windows. So this repo works OK just before this commit. After update this commit, I cant specify to test a single file. Have you met this problem.

python -m pytest  'tests/test_util.py'
# Got ERROR:
# ERROR: file or directory not found: 'tests/test_util.py'

It's OK by using "sh" command.

@lld2001
Copy link

lld2001 commented May 12, 2024

I finally found the problem. It's because the test file name should not be wraped with '' in Windows.

This command works:

python -m pytest  tests/test_util.py

@zyxir
Copy link
Contributor Author

zyxir commented May 13, 2024

@lld2001 Good point. My Emacs was also installed in MSYS2, but I usually launched Emacs on Windows, so it had no access to sh that way. Maybe something should be done to distinguish native Windows and MSYS2?

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

Successfully merging this pull request may close these issues.

None yet

3 participants