DoIt on Windows

Bug #218276 reported by schettino72
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
doit
Confirmed
High
Michael Gliwinski

Bug Description

Make sure DoIt runs on Windows.

Revision history for this message
schettino72 (schettino72) wrote :

I dont work on Windows. Anyone?

Changed in doit:
importance: Undecided → High
status: New → Confirmed
Changed in doit:
assignee: nobody → doit-team
Revision history for this message
Benny Bach (benny-bach) wrote :

Well the description doesn't give much to go on, but I suspect it might be related to setup.py on windows. Check this python issue:

http://bugs.python.org/issue4015

I installed doit with the patch included in this issue and doit seams to run fine for me on windows.

Revision history for this message
schettino72 (schettino72) wrote :

Actually I've never tried to run it on Windows. I think it should work but it might have some problems. I am using the subprocess module and I know there are some differences.

One problem is that I using the unix command 'ls' on my unit-tests. This need to be changed, so the tests can run in other platforms. I will try to work on this issue this week.

Have you tried to run the tests? If the tests pass I guess we can close this, and say it works on Windows :)

Revision history for this message
Benny Bach (benny-bach) wrote :

Finally found some time to try the tests. I did not have nose installed. Installed version 0.14.4 and ran the tests. There was some errors:

Ran 101 tests in 2.547s

FAILED (errors=13, failures=1)

I have attached the output. Haven't looked further into what fails. Concerning 'ls': I have cygwin installed, so that might actually be working.

Revision history for this message
schettino72 (schettino72) wrote :

Hi Benny,

Thanks for testing it. you got baically 3 different errors:

 * DBPermissionsError: (1, 'Operation not permitted')
make sure you have write permission on the test folder. the tests need to create a file...

 * File "D:\Projects\python\doit-0.1.0\lib\doit\task.py", line 117, in execute
    raise TaskFailed("")
doit (like unittests) differentiate a failure from an error. the problem is that different systems use different conventions... see http://en.wikipedia.org/wiki/Exit_status
I was using random non_exitent process name to raise an error. but it seems like you were getting an exit code that on unix means failure. i changed the code to give a better error message. and changed the test to use a specific process that will return always the same code. so it should work now.

* assert "hi from stdout\n" == sys.stdout.getvalue(),sys.stdout.getvalue()
AssertionError: hi from stdout
It was using the echo command. i guess you were getting a different new line character. now the assert error message will give a better description of the error. and it is not using the echo cmd anymore. so it should work.

-----------------------------
Could you please checkout the latest revision (71) and run the tests again?
Could you also test it without using cygwin?

Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

I installed doit-0.2 on Windows and it installed the "executable" in C:\Python26\Scripts\doit but on Windows you cannot run files without extension. You need to add a wrapper like doit.cmd

I tried to run manually the doit from there but it does not find the module dodo.

I would consider this issue critical.

Revision history for this message
schettino72 (schettino72) wrote :

Hi Sorin,

I will take a look on how I can create a file with an extension for Windows during the instalation... but I dont have a Windows machine and have no experience using python on Windows, so I cant test it. If you could submit a patch fixing that I would appreciate.

The dodo module is a user file. This the file where you define your tasks, something like a Makefile. The command line will look for a file named "dodo.py" on the folder the binary is being executed. You can specify another file (or another folder) using the command line parameter "-f".

Maybe the error description is not clear enough that the dodo file is not part of the library. I will take a look at what the message says :)

Revision history for this message
Benny Bach (benny-bach) wrote :

If you use the patch I mentioned in #2 setup.py will generate a doit.bat file in C:\python26\Scripts

Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

I applied the patch to setuptools and reinstalled doit (setup.py install)

After this I got an error that pychecker is not installed - shouldn't this be checked before installing doit?

I installed it anyway here is the new result of running it:
checker:lib/doit\dependency.py => Cmd: pychecker lib/doit\dependency.py
  File "C:\Python26\Scripts\pychecker.bat", line 1
    @REM $name $version ($date)
         ^
SyntaxError: invalid syntax

Task failed => checker:lib/doit\dependency.py

Revision history for this message
schettino72 (schettino72) wrote :

Is the any way to create this "bat" without patching setuptools? I cant believe all projects need this patch to be installed on windows!

Pychecker is not a dependency of doit. But I use pychecker on the development of doit itself. It seems you are trying to execute doit test suite. You need to create your on "dodo.py" file.

doit support tasks defined as python functions and shell commands. On my test suite i execute pychecker as shell command, but I dont know if these shell commands are portable from linux to windows... It seems the slashes are messed up... that might explain the error in pychecker.

Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

You could but the problem is that current version of setuptools does not work at all under x64 Win. I think it would be a good idea to add a comment to this bug http://bugs.python.org/setuptools/issue2 maybe they will commit the bug and make a new release faster.

Also, regarding my previous post - I think the issue is not due to the slashes. I will test on another platform to see if there is a bug in pychecker.

Changed in doit:
assignee: doit (doit-team) → nobody
Revision history for this message
Michael Gliwinski (tzeentch-gm) wrote :

I was planning to experiment with doit on one of our Windows servers, so I'll have a look if there's anything that does not work over next couple of weeks.

First thing is I can't check out the code on Windows due to symlink (doc/changes.rst -> ../CHANGES) and a bug in Bazaar (https://bugs.launchpad.net/bzr/+bug/81689). Eduardo, do you have any preference on what to do with this file? I could either change it to only keep one copy (doc/changes.rst) or maybe change the sphinx task to generate changes.rst by copying CHANGES?

Revision history for this message
schettino72 (schettino72) wrote :

dont waste your time with this. Just write this in CHANGES:
"""
see doc/changes.rst
# Note: can not use symlinks on windows because bzr has a bug https://bugs.launchpad.net/bzr/+bug/81689
"""

Changed in doit:
assignee: nobody → Michael Gliwinski (tzeentch-gm)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.