Open jkirk opened 5 years ago
Good question.
I've actually never tried to run this on Linux but in theory this should work as long as you have mono installed (which in turn supports nuget). But clearly it doesn't work ;-)
I'll dig a bit deeper and report back here, feel free to do the same.
The project seems to be very interesting. The reason why I can't say exactly is that I use Linux. To tell the truth it is a very strange approach to product vision - the product was developed for developers (who else uses git) however doesn't support Linux (main OS among developers). So, please, implement support for it a little bit faster :)
The pythonnet
dependency has been removed in 107fbac681 so the "pip install" error doesn't hit me anymore.
I started an attempt to create a build script for Linux (Debian/buster) here: https://github.com/jkirk/git-xl/tree/linux-support
And it seems to do something:
% scripts/linux/build
-----------
Version tag: 0.0.0
Build number: 0
Commit hash: dev
Generate file version: 0.0.0.0
-----------
110 INFO: PyInstaller: 3.3.1
110 INFO: Python: 3.7.3
110 INFO: Platform: Linux-5.7.0-0.bpo.2-amd64-x86_64-with-debian-10.6
111 INFO: wrote /home/jkirk/projects/misc/git-xltrail/git-xl-diff-x64.spec
112 INFO: UPX is not available.
113 INFO: Extending PYTHONPATH with paths
['/home/jkirk/projects/misc/git-xltrail/src',
'/home/jkirk/projects/misc/git-xltrail']
113 INFO: checking Analysis
116 INFO: checking PYZ
117 INFO: checking PKG
117 INFO: Bootloader /home/jkirk/projects/misc/git-xltrail/venv3/lib/python3.7/site-packages/PyInstaller/bootloader/Linux-64bit/run
117 INFO: checking EXE
118 WARNING: ignoring version, manifest and resources, platform not capable
118 WARNING: ignoring icon, platform not capable
102 INFO: PyInstaller: 3.3.1
102 INFO: Python: 3.7.3
103 INFO: Platform: Linux-5.7.0-0.bpo.2-amd64-x86_64-with-debian-10.6
106 INFO: wrote /home/jkirk/projects/misc/git-xltrail/git-xl-x64.spec
111 INFO: UPX is not available.
113 INFO: Extending PYTHONPATH with paths
['/home/jkirk/projects/misc/git-xltrail/src',
'/home/jkirk/projects/misc/git-xltrail']
113 INFO: checking Analysis
116 INFO: Building because /home/jkirk/projects/misc/git-xltrail/src/cli.py changed
116 INFO: Initializing module dependency graph...
118 INFO: Initializing module graph hooks...
119 INFO: Analyzing base_library.zip ...
1984 INFO: running Analysis out00-Analysis.toc
2008 INFO: Caching module hooks...
2014 INFO: Analyzing /home/jkirk/projects/misc/git-xltrail/src/cli.py
2093 INFO: Loading module hooks...
2094 INFO: Loading module hook "hook-xml.py"...
2277 INFO: Loading module hook "hook-encodings.py"...
2321 INFO: Loading module hook "hook-pydoc.py"...
2331 INFO: Looking for ctypes DLLs
2369 INFO: Analyzing run-time hooks ...
2376 INFO: Looking for dynamic libraries
2598 INFO: Looking for eggs
2598 INFO: Python library not in binary dependencies. Doing additional searching...
2647 INFO: Using Python library /usr/lib/x86_64-linux-gnu/libpython3.7m.so.1.0
2651 INFO: Warnings written to /home/jkirk/projects/misc/git-xltrail/build/git-xl-x64/warngit-xl-x64.txt
2680 INFO: Graph cross-reference written to /home/jkirk/projects/misc/git-xltrail/build/git-xl-x64/xref-git-xl-x64.html
2686 INFO: checking PYZ
2688 INFO: Building because toc changed
2688 INFO: Building PYZ (ZlibArchive) /home/jkirk/projects/misc/git-xltrail/build/git-xl-x64/out00-PYZ.pyz
2943 INFO: Building PYZ (ZlibArchive) /home/jkirk/projects/misc/git-xltrail/build/git-xl-x64/out00-PYZ.pyz completed successfully.
2945 INFO: checking PKG
2946 INFO: Building because toc changed
2946 INFO: Building PKG (CArchive) out00-PKG.pkg
5044 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
5045 INFO: Bootloader /home/jkirk/projects/misc/git-xltrail/venv3/lib/python3.7/site-packages/PyInstaller/bootloader/Linux-64bit/run
5045 INFO: checking EXE
5045 INFO: Building because toc changed
5045 INFO: Building EXE from out00-EXE.toc
5046 INFO: Appending archive to ELF section in EXE /home/jkirk/projects/misc/git-xltrail/dist/git-xl-x64
5060 INFO: Building EXE from out00-EXE.toc completed successfully.
scripts/linux/build 5.14s user 0.31s system 100% cpu 5.435 total
But the tools git-xl-diff-x64
+ git-xl-x64
do not work:
% cd dist
% ./git-xl-diff-x64
Fatal Python error: initfsencoding: Unable to get the locale encoding
zipimport.ZipImportError: can't find module 'encodings'
Current thread 0x00007f8de665d740 (most recent call first):
[1] 9577 abort ./git-xl-diff-x64
% ./git-xl-x64
Fatal Python error: initfsencoding: Unable to get the locale encoding
zipimport.ZipImportError: can't find module 'encodings'
Current thread 0x00007f4a05881740 (most recent call first):
[1] 9597 abort ./git-xl-x64
How can I proceed from here? I need help. Thank you!
Fatal Python error: initfsencoding: Unable to get the locale encoding
zipimport.ZipImportError: can't find module 'encodings'
This is an issue with pyinstaller 3.3.1. Upgrading to 4.2 fixes the issue :). Testing if the package works now...
Doesn't work. git diff runs ok, it reports a clean diff. No error at all. I modified the macros using Libreoffice. Maybe is something related
[demo-git-xl]$ git diff dev..master
diff --xl a/demo.xlsx b/demo.xlsx
[demo-git-xl]$ echo $?
0
Does any of the above commenters have been able to create a working package? Could one of the developers point out where they their opinion is on supporting multiple platforms. Seems interesting to work on it in some spare time.
You may want to have a look at the discussion here: https://github.com/xlwings/git-xl/pull/75
As @Navax99 reported, even after installing it on Linux (for example using @watercrossing solution described in #75), it does not detect any difference for any file.
The issue seems to come from the underlying library oletools. This line returns an empty list in all my test:
https://github.com/xlwings/git-xl/blob/37ce4d3c04a2885b19ac54a731808dd955d5fdb8/src/diff.py#L12
I was not able to find the precise source. It may be related to this oletools issue.
Would it be accurate to say that making git-xl installable via pip
(#75) is blocked by the fact that vba_modules = vba_parser.extract_all_macros() if vba_parser.detect_vba_macros() else []
returns an empty list on Linux, but not on Windows? I am interested in seeing this open-source project become available on other platforms.
the quoted issue in the previous comment doesn't look like it's a platform-dependent issue, so no, I wouldn't expect this to be a blocker.
@fzumstein thank you for the quick response. Would you be open to a new PR to follow-up on the work of #75, but use a pyproject.toml file instead of setup.py?
Yes, but I guess what might make even more sense is to provide git-xl as pre-commit hook: https://pre-commit.com/
I see, but would this work on a non-windows system (e.g. Linux)?
sure, pre-commit isn't platform-dependent
Apologies for the confusion. I'm confused as to how to set this up on a non-windows machine. I am trying to follow the instructions on the README. Are the following steps correct?
pip install -r requirements.txt
git xl install
(I think I'm missing something here)Actually, forget pre-commit again, you'll want git diff
to work, not git commit
.
Got it. Yeah I've used pre-commit to enforce linting on my Python packages before but the key feature of this project is the git diff
view right? How does one configure git diff
to use this without the pre-compiled windows installer?
@fzumstein Could you say if git-xl can be used on Linux now?
We currently don't have the resource to look into this, but I don't see any reason why this can't be done nowadays. It's pure python nowadays.
I just updated my linux-support
branch and created a PR #83 to make it a bit more visible.
git-xl compiles under Linux (Debian/bookworm), but as far as I can see git xl install
(./git-xl-x64 install
) and git-xl-diff-x64
need to be fixed.
Thank you for this wonderful project.
My setup might be unusual but I run Windows + Excel in Virtualbox on a GNU/Linux Debian/stretch machine. My project folder is a shared folder so I can use all the command line stuff in Linux and work with Excel in the Virtualbox.
It would be fantastic if
git xltrail
was available in Linux too. Currently the setup/installation fails (after cloning) :I tracked it down a bit and it seems to be related to pythonnet/pythonnet#729.
Do you have any idea what to do or how I can help to make this happen?