Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

CLI doesnt work on windows directly #28

Closed
bendtherules opened this issue Oct 1, 2015 · 7 comments
Closed

CLI doesnt work on windows directly #28

bendtherules opened this issue Oct 1, 2015 · 7 comments

Comments

@bendtherules
Copy link
Contributor

Pontoon put a few scripts inside scripts dir, but they seem to be just the python files without any file extension.

Trying to run configure as python .\pontoon-configure only shows the cli usage docs Usage: pontoon configure [--help] and nothing else happens.

Is the cli thing using anything linux specific?

@duggan
Copy link
Owner

duggan commented Oct 1, 2015

I suspect the configure command makes a lot of assumptions about being on a POSIX system (particularly SSH key generation, which just shells out to the command line).

Most of the relevant code is in pontoon/configure.py and pontoon/ui.py.

As mentioned in the README, pontoon does not explicitly support Windows, though I'm sure it's entirely possible to fix what doesn't work.

@bendtherules bendtherules changed the title How to run cli from windows? CLI doesnt work on windows directly Oct 2, 2015
@bendtherules
Copy link
Contributor Author

Cli doesnt work because files without .py extension but with !python in the top are not considered as executables in Windows.
So, pontoon configure wont work as it is just the pontoon.py file a python file without extension . This works on linux though. I think setup.py is capable of creating exe scipts directly on windows,as files like tox.exe and pip.exe are already there in my scipts folder. Probably just a tweak is needed in setup.py, need to look it up.

So, to get it working, one can use python pontoon configure, but there is another problem - pontoon tries to call child scripts like this pontoon-configure configure, which wont work due to the same limitation. So, currently the best bet is to use python pontoon-configure configure directly on cmd in Windows.

Edit:

Ok, so I first thought the scripts in scripts folder in pontoon was created by pip install, but now I see that they are Python files written by @duggan and they are just copy-pasted by pip to install directory.

Renaming them to .py and calling them as such would solve the problem for now, but dont think it is the best way - scipts would need to be called as pontoon.py, and that would only work if Python is the preferred application for .py files

@duggan
Copy link
Owner

duggan commented Oct 2, 2015

I think modifying setup.py to detect Windows and use different file extensions, etc, should be simple enough. I just wish there was some way to have it testable in Travis.

@bendtherules
Copy link
Contributor Author

No, I think there is a better way to do it with setup.py.

Looks like console_scripts is the entry point for this in setup.py which also generates required exes. I'll give it a shot.

Couldnt find actual doc for it, but this SO answer is pretty understandable : http://stackoverflow.com/a/782984/2534890

@duggan
Copy link
Owner

duggan commented Oct 2, 2015

👍

@bendtherules
Copy link
Contributor Author

#30 should fix this now.

@bendtherules
Copy link
Contributor Author

I'll close this one, but BATS cli tests should be replaced with something cross-platform in the future as mentioned in #31 . That will ensure that the CLI interface is working just as intended on all platforms.

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

No branches or pull requests

2 participants