Skip to content

Commit

Permalink
remove dependency, documentation updates, universal builds
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Apr 2, 2016
1 parent 6afed85 commit 23ee88f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ gitfame/*.c
gitfame/*.so
build/
dist/
gitfame.egg-info/
git_fame.egg-info/
.coverage
23 changes: 16 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Pretty-print ``git`` repository collaborators sorted by contributions.
~$ git fame
Blame: 100%|███████████████████████████████████| 11/11 [00:00<00:00, 208.43it/s]
Total commits: 30
Total files: 17
Total loc: 522
Total commits: 302
Total files: 37
Total loc: 3134
+----------------------+------+------+------+----------------+
| Author | loc | coms | fils | distribution |
+======================+======+======+======+================+
| Casper da Costa-Luis | 3123 | 297 | 35 | 99.6/98.3/85.4 |
| Not Committed Yet | 7 | 4 | 2 | 0.2/ 1.3/ 4.9 |
| Nikolay Yakimov | 4 | 1 | 1 | 0.1/ 0.3/ 2.4 |
| Evïan Etàcidñys | 4 | 1 | 1 | 0.1/ 0.3/ 2.4 |
+----------------------+------+------+------+----------------+
------------------------------------------
Expand Down Expand Up @@ -59,8 +59,17 @@ Usage

.. code:: sh
~$ git fame # If alias registered with git (see above)
~$ python -m gitfame # Alternative execution as python module
$ git fame # If alias registered with git (see above)
$ python -m gitfame # Alternative execution as python module
$ git fame -h # Print help
For example, to print statistics regarding all source files in a C++/CUDA
repository (``*.c/h/t(pp), *.cu(h)``), carefully handling whitespace and line
copies:

.. code:: sh
$ git fame --incl '\.[cht][puh]{0,2}$' -twMC
Documentation
Expand Down Expand Up @@ -99,7 +108,7 @@ Licence
OSI approved.
Copyright (c) 2016 Casper da Costa-Luis <[email protected]>.
Copyright (c) 2016 Casper da Costa-Luis.
This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0.
Expand Down
5 changes: 2 additions & 3 deletions gitfame/_gitfame.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@
# from __future__ import absolute_import
import subprocess
import re
from ._utils import TERM_WIDTH, int_cast_or_len, Max, fext, _str
from tqdm import tqdm
from ._utils import TERM_WIDTH, int_cast_or_len, Max, fext, _str, tqdm

__author__ = "Casper da Costa-Luis <[email protected]>"
__date__ = "2016"
__licence__ = "[MPLv2.0](https://mozilla.org/MPL/2.0/)"
__all__ = ["main"]
__copyright__ = ' '.join(("Copyright (c)", __date__, __author__, __licence__))
__version__ = "1.0.1"
__version__ = "1.0.2"
__license__ = __licence__ # weird foreign language


Expand Down
20 changes: 15 additions & 5 deletions gitfame/_utils.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import sys
try:
from tqdm import tqdm
except:
print ('warning | module tqdm not found')

def tqdm(*args, **kwargs):
if args:
return args[0]
return kwargs.get('iterable', None)

__author__ = "Casper da Costa-Luis <[email protected]>"
__date__ = "2016"
__licence__ = "[MPLv2.0](https://mozilla.org/MPL/2.0/)"
__all__ = ["TERM_WIDTH", "int_cast_or_len", "Max", "fext", "_str"]
__copyright__ = ' '.join((__author__, __date__, __licence__))
__all__ = ["TERM_WIDTH", "int_cast_or_len", "Max", "fext", "_str", "tqdm"]
__copyright__ = ' '.join(("Copyright (c)", __date__, __author__, __licence__))
__license__ = __licence__ # weird foreign language


def _str(s):
try:
def _str(s): # pragma: no cover
try: # python2
return s.decode(encoding='utf-8')
except:
except: # python3
return s


Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def cythonize(*args, **kwargs):
platforms=['any'],
packages=['gitfame'],
provides=['gitfame'],
requires=['tqdm'],
ext_modules=cythonize(["gitfame/_gitfame.py", "gitfame/_utils.py"],
nthreads=2),
classifiers=[
Expand Down

0 comments on commit 23ee88f

Please sign in to comment.