alfredodeza / konira

beautiful (readable) testing in Python
60 stars 9 forks source link

Unable to run konira command on Windows #9

Closed rudylattae closed 13 years ago

rudylattae commented 13 years ago

Out the box, it is impossible to run konira on Windows because the shell script that is installed is really only *nix-friendly.

Kindly consider using the entry_points parameter to the setup() function in setup.py. You could make it refer to konira:main or some other entry point that does the same thing that the konira script does currently, i.e call KoniraCommands()

    entry_points = {
        'console_scripts': [
            'konira = konira:main'
        ]
    }

With this directive, setup-tools will install the relevant "script" for the platform in question. E.g. on Windows this would probably be konira.exe which loads konira-script.py.


Aside: For those looking for a temporary fix till this issue is resolved, here is my current work-around.

python %~dp0konira-script.py %*

Of course this is really just a hassle, especially for anyone like me who does all their python work in virtualenvs. I'd have to apply this band-aid to every venv I install konira into. It would be great to have a real fix. :)

alfredodeza commented 13 years ago

I have acknowledged the problem and I am willing to make the changes. However, there is an explicit reason why this is the case, and it is to avoid the horrible pkg_resources which delays everything while it looks for the right version.

There is another catch: I am not looking forward for Windows testing. Konira is tested against Linux/Unix with Python2.5, 2.6 and 2.7 and PyPy 1.5 and 1.6

alfredodeza commented 13 years ago

I've investigated this issue and looked at how Mercurial solves it: it appends another win-compatible script to the script list that it is a bat file.

Could you please take a look at this gist: https://gist.github.com/1195540 And tell me if you think this would work? Again, I don't have access to a windows box and would prefer not to need one :)

rudylattae commented 13 years ago

I tried that gist out and updated with my comments. I think it's a good fix so ship-it :)

Thanks for the speedy response.


WRT testing on Windows. I'll be willing to do that. I already tried to run the konira tests through tox on my Win7 box but I end up with an error rsied by the subprocess module, something along the lines of "WindowsError: [Error 2] The system cannot find the file specified"

I've not looked into it much, but it could be due to my funky Python setup. I'll take another look later when I have some time and see if we can't get konira testing itself on Windows as well.

FYI: I used a stripped down tox.ini (py26, py27) for my first stab at testing konira on Windows -- https://gist.github.com/1196364

alfredodeza commented 13 years ago

Can you try and install from scratch the latest push from ms-support branch? I have implemented this fix.

rudylattae commented 13 years ago

Tested. Works as expected. :thumbsup:

Thanks