grimoirelab-perceval
grimoirelab-perceval copied to clipboard
windows 10 changed #!/usr/bin/env python3 to #!/usr/bin/env python
-changed #!/usr/bin/env python3 to #!/usr/bin/env python so that windows will not error "/usr/bin/env: ‘python3’: No such file or directory" -may cause issues if a user has more than one version of python installed -could make a windows specific copy "pip3 install perceval_windows"
Coverage remained the same at 97.058% when pulling 9a696626c31339ad12d83645741da11809ca668b on dereklowlind:windows_path_fix into 47209be60f16472e49710f4e3ced7d257d00621f on chaoss:master.
Coverage remained the same at 97.058% when pulling 9a696626c31339ad12d83645741da11809ca668b on dereklowlind:windows_path_fix into 47209be60f16472e49710f4e3ced7d257d00621f on chaoss:master.
Thank you @dereklowlind for the PR. I've tested the PR and it works fine, however I'm not sure about the change you propose since #!/usr/bin/env python3 and #!/usr/bin/env python should have different meanings in Linux, and it seems in Windows too (as reported here).
I like the idea of having a perceval for Windows, and it seems reasonable since we have already some issues reported (i.e., https://github.com/chaoss/grimoirelab-perceval/issues/399, https://github.com/chaoss/grimoirelab-perceval/issues/331, https://github.com/chaoss/grimoirelab-perceval/issues/447). However, we have also to keep in mind that perceval is developed on Linux, thus we don't have proper envs (windows 7, 10, ...) to test it and thus we cannot guarantee that perceval_windows will be as good as the Linux version.
@sduenas @jgbarah please share your thoughts, thanks!
I have packaged my windows "port" and uploaded it to the pip test site and it works installing from the pip command line tool. I added this message to the top of the description "Warning: This is a port to windows in which some features are broken. Please use only to test out the concept and then setup linux and run normal Perceval". Would anyone object to me putting perceval-windows onto the main pip site?
Thank you @dereklowlind for pushing this forward. It's ok for me, but we really need the feedback of @sduenas and @jgbarah.
Btw, where will be located this version of perceval? shouldn't perceval-windows be a repo under chaoss org?
I did this first port in a forked repo in my personal account (for ease of submitting changes). If the community would like to make it more official then my side project, I would be very happy for it to become a repo of chaoss.org!
Great @dereklowlind! :) It would be really nice if you can join the community and help to maintain perceval-windows.
Please @sduenas, @jgbarah share your thoughts
Timeline for moving forward on perceval-windows?
ping @sduenas @jgbarah
I find it very interesting to have Perceval running in Windows. And as a temporary solution, using perceval-windows as a pip package, could be a good idea. However, a couple of comments:
- I'm not sure the change from
python3topythonis a good idea for non-Windows systems. Probably it is going to become a minor issues as python3 becomes the only python, but I see problems meanwhile, specially when people have both systems installed. I know with virtual environments this is a non-issue, but still... Is there no way of fixing this in Windows in some other way? - With respect to the
perceval-windowspackage in pip, which differences would it have? Because right now,percevalis mostly a source package.
I agree it would be great to have Perceval running on Windows. I don't see the solution you propose in this PR the best one, though. It will break how it works in Linux systems now.
One of the possible solutions that might work would be to install a different script depending the OS. A BAT file (or similar) for Windows and the Python file for Unix systems.
Some parts of the code should be adapted to support multi-platform. We can also have tests for both environments in Travis.
How about using the unspecified python version, checking if it is acceptable, then if not finding the highest version available on the system? I have not checked if the code below works.
https://unix.stackexchange.com/questions/66210/how-can-i-have-more-than-one-possibility-in-a-scripts-shebang-line
#!/usr/bin/env python import os, sys
pythons = [ '/usr/bin/python2.3','/usr/bin/python2.4', '/usr/bin/python2.5', '/usr/bin/python2.6', '/usr/bin/python2.7' ] py = list(filter( os.path.isfile, pythons )) if py: py = py.pop() thepy = int( py[-3:-2] + py[-1:] ) mypy = int( ''.join( map(str, sys.version_info[0:2]) ) ) if thepy > mypy: print("moving versions to "+py) args = sys.argv args.insert( 0, sys.argv[0] ) os.execv( py, args )
print("do normal stuff")
Closing this ticket because we don't support Windows in GrimoireLab. Feel free to submit another one in the case you find the way to fix this issue and other windows related issues.