vifactor / repostat

Inspired by gitstats project: git repository desktop analyzer
GNU General Public License v3.0
106 stars 13 forks source link

How to run on macOS? #110

Closed borekb closed 4 years ago

borekb commented 4 years ago

I tried running

pip install git+https://github.com/vifactor/repostat

but got this:

$ pip install git+https://github.com/vifactor/repostat
Collecting git+https://github.com/vifactor/repostat
  Cloning https://github.com/vifactor/repostat to /private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-req-build-03u7r_63
  Running command git clone -q https://github.com/vifactor/repostat /private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-req-build-03u7r_63
Collecting cffi==1.11.5
  Downloading https://files.pythonhosted.org/packages/0b/ba/32835c9965d8a0090723e1d0b47373365525c4bd08c807b5efdc9fecbc99/cffi-1.11.5-cp37-cp37m-macosx_10_9_x86_64.whl (163kB)
     |████████████████████████████████| 163kB 322kB/s
Collecting Jinja2>=2.10.1
  Downloading https://files.pythonhosted.org/packages/27/24/4f35961e5c669e96f6559760042a55b9bcfcdb82b9bdb3c8753dbe042e35/Jinja2-2.11.1-py2.py3-none-any.whl (126kB)
     |████████████████████████████████| 133kB 609kB/s
Collecting MarkupSafe==1.0
  Downloading https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz
Collecting pygit2~=1.0.0
  Downloading https://files.pythonhosted.org/packages/cd/18/c674c9389aef8c940393e0507f9fe9437efd8e56ff1efa837d3fbfcd1d42/pygit2-1.0.3.tar.gz (501kB)
     |████████████████████████████████| 501kB 574kB/s
Collecting pytz>=2018.5
  Downloading https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl (509kB)
     |████████████████████████████████| 512kB 1.2MB/s
Collecting six>=1.11.0
  Downloading https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Collecting pandas~=0.25.3
  Downloading https://files.pythonhosted.org/packages/16/b5/bab3477466a4d9e705d40829ac65683155e7977acbc07f05b06fabded1be/pandas-0.25.3-cp37-cp37m-macosx_10_9_x86_64.whl (10.2MB)
     |████████████████████████████████| 10.2MB 2.6MB/s
Collecting pycparser
  Using cached https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl
Collecting python-dateutil>=2.6.1
  Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
     |████████████████████████████████| 235kB 1.8MB/s
Collecting numpy>=1.13.3
  Downloading https://files.pythonhosted.org/packages/2f/5b/2cc2b9285e8b2ca8d2c1e4a2cbf1b12d70a2488ea78170de1909bca725f2/numpy-1.18.1-cp37-cp37m-macosx_10_9_x86_64.whl (15.1MB)
     |████████████████████████████████| 15.1MB 718kB/s
Building wheels for collected packages: repo-stat, MarkupSafe, pygit2
  Building wheel for repo-stat (setup.py) ... done
  Created wheel for repo-stat: filename=repo_stat-1.3.1-cp37-none-any.whl size=32438 sha256=c9fb28eff35b482b31d8dd25d0b307e3278e02d4b06b87b8eb8baac2907fc274
  Stored in directory: /private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-ephem-wheel-cache-pai9njrq/wheels/91/23/70/a91cf06438f190290a3f9092cfea076864cfa3033dad238b0b
  Building wheel for MarkupSafe (setup.py) ... done
  Created wheel for MarkupSafe: filename=MarkupSafe-1.0-cp37-cp37m-macosx_10_15_x86_64.whl size=15565 sha256=c88bf8cce4132cd62b45d9805f810ba8359850f80f70b72ce0ba716121b57f3b
  Stored in directory: /Users/borekb/Library/Caches/pip/wheels/33/56/20/ebe49a5c612fffe1c5a632146b16596f9e64676768661e4e46
  Building wheel for pygit2 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-install-ti3fxn15/pygit2/setup.py'"'"'; __file__='"'"'/private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-install-ti3fxn15/pygit2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-wheel-76im5dwg --python-tag cp37
       cwd: /private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-install-ti3fxn15/pygit2/
  Complete output (60 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.15-x86_64-3.7
  creating build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/config.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/index.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/credentials.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/remote.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/__init__.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/_build.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/refspec.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/submodule.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/utils.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/blame.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/settings.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/errors.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/_run.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/repository.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  copying pygit2/ffi.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
  creating build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/oid.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/index.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/attr.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/blame.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/pack.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/revert.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/net.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/config.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/types.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/repository.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/clone.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/submodule.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/errors.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/merge.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/graph.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/describe.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/stash.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/remote.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/strarray.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/buffer.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/diff.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/common.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/proxy.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/refspec.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/transport.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  copying pygit2/decl/checkout.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
  running build_ext
  generating cffi module 'build/temp.macosx-10.15-x86_64-3.7/pygit2._libgit2.c'
  creating build/temp.macosx-10.15-x86_64-3.7
  building '_pygit2' extension
  creating build/temp.macosx-10.15-x86_64-3.7/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/blob.c -o build/temp.macosx-10.15-x86_64-3.7/src/blob.o
  In file included from src/blob.c:30:
  src/blob.h:33:10: fatal error: 'git2.h' file not found
  #include <git2.h>
           ^~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pygit2
  Running setup.py clean for pygit2
Successfully built repo-stat MarkupSafe
Failed to build pygit2
Installing collected packages: pycparser, cffi, MarkupSafe, Jinja2, pygit2, pytz, six, python-dateutil, numpy, pandas, repo-stat
    Running setup.py install for pygit2 ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-install-ti3fxn15/pygit2/setup.py'"'"'; __file__='"'"'/private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-install-ti3fxn15/pygit2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-record-fj4sz30s/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-install-ti3fxn15/pygit2/
    Complete output (60 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.15-x86_64-3.7
    creating build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/config.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/index.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/credentials.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/remote.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/__init__.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/_build.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/refspec.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/submodule.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/utils.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/blame.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/settings.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/errors.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/_run.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/repository.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    copying pygit2/ffi.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
    creating build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/oid.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/index.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/attr.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/blame.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/pack.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/revert.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/net.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/config.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/types.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/repository.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/clone.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/submodule.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/errors.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/merge.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/graph.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/describe.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/stash.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/remote.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/strarray.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/buffer.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/diff.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/common.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/proxy.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/refspec.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/transport.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    copying pygit2/decl/checkout.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
    running build_ext
    generating cffi module 'build/temp.macosx-10.15-x86_64-3.7/pygit2._libgit2.c'
    creating build/temp.macosx-10.15-x86_64-3.7
    building '_pygit2' extension
    creating build/temp.macosx-10.15-x86_64-3.7/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/blob.c -o build/temp.macosx-10.15-x86_64-3.7/src/blob.o
    In file included from src/blob.c:30:
    src/blob.h:33:10: fatal error: 'git2.h' file not found
    #include <git2.h>
             ^~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-install-ti3fxn15/pygit2/setup.py'"'"'; __file__='"'"'/private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-install-ti3fxn15/pygit2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/ly/ffw1d5c91v748gt47gtvd0s80000gn/T/pip-record-fj4sz30s/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

macOS / OS X is not mentioned in this repo at all so I'm not sure if this is supposed to work or not (but Windows is supported, #57, so I hope I can use this utility on macOS as well.

vifactor commented 4 years ago

Thanks for contacting, the issue is with pygit2 package which is a dependency of repostat. There is an instruction on how to make it work on OSX.

Note, that there is gnuplot dependency. This one should also be installed prior to repostat.

Please, report any issues here. In case of success, I will appreciate list of installation instructions published here or a PR to README.md file.

From my side, I will try to establish CI for Mac OS when I find time.

vifactor commented 4 years ago

@borekb , looks like this should work for you:

$ brew update
$ brew install libgit2
$ brew install gnuplot

$ pip3 install git+https://github.com/vifactor/repostat
borekb commented 4 years ago

@vifactor That indeed worked, thank you!