mutmut icon indicating copy to clipboard operation
mutmut copied to clipboard

Can't run mutmut Windows 10

Open LLKoder opened this issue 6 years ago • 9 comments

My project structure.

project
|-my_project\
|-tests\
|-venv.tests\
|-setup.cfg

My setup.cfg:

[mutmut]
runner="python -m unittest discover"
paths-to-mutate="my_project\"
tests-dir="tests\"

When I run python -m mutmut run from project I get an error:

Traceback (most recent call last):
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 784, in <module>
    climain()
  File "X:\Projects\project\venv.tests\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "X:\Projects\project\venv.tests\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "X:\Projects\project\venv.tests\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "X:\Projects\project\venv.tests\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 74, in wrapper
    f(*args, **kwargs)
  File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 254, in climain
    post_mutation, use_patch_file))
  File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 352, in main
    using_testmon=using_testmon
  File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 689, in time_test_suite
    returncode = popen_streaming_output(test_command, feedback)
  File "X:\Projects\project\venv.tests\lib\site-packages\mutmut\__main__.py", line 459, in popen_streaming_output
    stderr=subprocess.PIPE
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

LLKoder avatar May 19 '19 14:05 LLKoder

Hmm... Sounds like it isn't finding python. If you change the runner command to the absolute path to the python in the venv, does it work?

boxed avatar May 19 '19 16:05 boxed

No, it doesn't help.

LLKoder avatar May 19 '19 23:05 LLKoder

@nklapste maybe you can help?

boxed avatar May 20 '19 05:05 boxed

@LLKoder could you try a config similar too:

[mutmut]
runner=C:\\path\\to\\your\\project\\venv\\Scripts\\python.exe -m unittest discover

For specifying your runner?

I found my runtime was tripping over python escaping \ weirdly.

nklapste avatar Jun 13 '19 23:06 nklapste

Based on other issues, it appears that there are Windows users of mutmut, so this probably isnt a problem, but it is worth noting that dependency whatthepatch has some features which are not supported on Windows, and has no Windows CI to maintain support. https://github.com/cscorley/whatthepatch/issues/26 . However I noticed that mutmut tests depended patch & ed on unix, so maybe it is a relevant problem for Windows.

And there is no Windows CI for mutmut, or for https://github.com/TriOptima/tri.declarative or its dependencies. @nklapste / @boxed , do you have a preference for Windows CI provider?

jayvdb avatar Sep 04 '19 02:09 jayvdb

(ah, I see the Travis CI here is using the new Windows Travis support. nice!)

jayvdb avatar Sep 04 '19 02:09 jayvdb

This specific problem would be fixed by https://github.com/boxed/mutmut/pull/134

jayvdb avatar Sep 04 '19 05:09 jayvdb

@jayvdb Does this mean this issue can be closed when #134 is merged?

boxed avatar Sep 07 '19 16:09 boxed

Probably also fixed by #220.

moltob avatar Sep 07 '21 16:09 moltob