Skip to content

Commit

Permalink
bump version, merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Jun 19, 2019
2 parents f8ab650 + 977e428 commit 9780831
Show file tree
Hide file tree
Showing 21 changed files with 239 additions and 59 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[attr]py-file eol=lf
*.py py-file

.git* export-ignore
MANIFEST.in export-ignore
.travis.yml export-ignore
codecov.yml export-ignore
.git-fame.1.md export-ignore
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Require maintainer's :+1: for changes to the .github/ repo-config files
# mainly due to https://github.com/probot/settings privilege escalation
.github/* @github/pages
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: casperdcl
custom: https://caspersci.uk.to/donate
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*.egg-info
build/
dist/
snapcraft.yaml
git-fame_*_amd64.snap
.dockerignore

# Unit test / coverage reports
.tox/
Expand Down
Binary file added .meta/.casperdcl.gpg.enc
Binary file not shown.
File renamed without changes.
23 changes: 23 additions & 0 deletions .meta/.snapcraft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: git-fame
summary: Pretty-print `git` repository collaborators sorted by contributions
description: |
{description}
adopt-info: git-fame
grade: stable
confinement: strict
base: core18
license: MPL-2.0
parts:
git-fame:
plugin: python
python-version: python3
python-packages: [tqdm, pyyaml]
stage-packages: [git]
source: {source}
source-commit: '{commit}'
parse-info: [setup.py]
apps:
git-fame:
command: bin/git-fame
#completer: git-fame_completion.bash
plugs: [home]
59 changes: 51 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,70 @@ matrix:
- python: 3.6
env: TOXENV=py36
- python: 3.7
dist: xenial
sudo: true
env: TOXENV=py37
dist: xenial
sudo: true # required for py37, docker
services:
- docker
after_success:
- echo "$DOCKER_PWD" | docker login -u $DOCKER_USR --password-stdin
- make -B docker
- |
if [[ -n "$TRAVIS_TAG" ]]; then
docker tag casperdcl/git-fame:latest casperdcl/git-fame:${TRAVIS_TAG#v} ; fi
- docker tag casperdcl/git-fame:latest casperdcl/git-fame:devel
- pip install .[dev]
- make build
- openssl aes-256-cbc -K $encrypted_88867ca921c3_key
-iv $encrypted_88867ca921c3_iv -in .meta/.casperdcl.gpg.enc
-out .casperdcl.gpg -d
- gpg --import .casperdcl.gpg
- rm .casperdcl.gpg
deploy:
- provider: script
script: twine upload -s -i casper.dcl@physics.org dist/git?fame-*
skip_cleanup: true
on:
tags: true
- provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: dist/git?fame-*.whl*
skip_cleanup: true
draft: true
name: git-fame $TRAVIS_TAG stable
on:
tags: true
- provider: script
script: docker push casperdcl/git-fame:${TRAVIS_TAG#v}
on:
tags: true
- provider: script
script: docker push casperdcl/git-fame:latest
- provider: script
script: docker push casperdcl/git-fame:devel
on:
branch: devel
- python: pypy2.7-5.10.0
env: TOXENV=pypy
- python: pypy3.5-5.10.0
env: TOXENV=pypy3
- python: 3.6
env: TOXENV=flake8
- python: 2.7
- python: 3.6
env: TOXENV=setup.py
- python: 3.6
env: TOXENV=nodeps
cache:
pip: true
directories:
- $HOME/.cache/pip
- $HOME/.cache/pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
- rm -f $HOME/.cache/pip/log/debug.log
notifications:
email: false
install:
- pip install tox
- pip install .
- pip install tox
- pip install .
script:
- tox
- tox
8 changes: 8 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ "metadata": {
"title": "git-fame: Pretty-print `git` repository collaborators sorted by contributions",
"keywords": [
"git", "blame", "git-blame", "git-log", "code-analysis", "cost", "loc", "author",
"commit", "shortlog", "ls-files"],
"creators": [
{"name": "da Costa-Luis, Casper O.", "orcid": "0000-0002-7211-1557"}]
}}
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.7-alpine
RUN apk update && apk add --no-cache git
COPY setup.py README.rst git-fame/
COPY gitfame git-fame/gitfame
RUN pip install -U ./git-fame[full]
ENTRYPOINT ["git-fame", "/repo"]
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ recursive-include gitfame/tests *.py

# Examples/Documentation
include README.rst
include git-fame.1
include gitfame/git-fame.1
27 changes: 25 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
build
buildupload
pypi
snap
docker
help
none
run
Expand Down Expand Up @@ -49,6 +51,7 @@ testnose:
nosetests gitfame -d -v

testsetup:
@make gitfame/git-fame.1
python setup.py check --restructuredtext --strict
python setup.py make none

Expand All @@ -59,14 +62,25 @@ testcoverage:
testtimer:
nosetests gitfame --with-timer -d -v

gitfame/git-fame.1: .git-fame.1.md gitfame/_gitfame.py
gitfame/git-fame.1: .meta/.git-fame.1.md gitfame/_gitfame.py
python -m gitfame --help | tail -n+9 | head -n-2 |\
sed -r -e 's/\\/\\\\/g' \
-e 's/^ (--\S+) (\S+)\s*(.*)$$/\n\\\1=*\2*\n: \3/' \
-e 's/^ (-\S+, )(-\S+)\s*/\n\\\1\\\2\n: /' |\
cat "$<" - |\
pandoc -o "$@" -s -t man

snapcraft.yaml: .meta/.snapcraft.yml
cat "$<" | sed -e 's/{version}/'"`python -m gitfame --version`"'/g' \
-e 's/{commit}/'"`git describe --always`"'/g' \
-e 's/{source}/./g' \
-e 's/{description}/https:\/\/github.com\/casperdcl\/git-fame/g' > "$@"

.dockerignore: .gitignore
cat $^ > "$@"
echo -e ".git" > "$@"
git clean -xdn | sed -nr 's/^Would remove (.*)$$/\1/p' >> "$@"

distclean:
@+make coverclean
@+make prebuildclean
Expand Down Expand Up @@ -98,17 +112,26 @@ install:

build:
@make prebuildclean
@make testsetup
python setup.py sdist bdist_wheel
# python setup.py bdist_wininst

pypi:
twine upload dist/*

buildupload:
@make testsetup
@make build
@make pypi

snap:
@make snapcraft.yaml
snapcraft
docker:
@make .dockerignore
@make coverclean
@make clean
docker build . -t casperdcl/git-fame
docker tag casperdcl/git-fame:latest casperdcl/git-fame:$(shell docker run --rm casperdcl/git-fame -v)
none:
# used for unit testing

Expand Down
36 changes: 31 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ git-fame

Pretty-print ``git`` repository collaborators sorted by contributions.

|PyPI-Status| |PyPI-Versions|
|PyPI-Versions| |PyPI-Status| |Docker| |Snapcraft|

|Build-Status| |Coverage-Status| |Branch-Coverage-Status| |Codacy-Grade| |Libraries-Rank|
|Build-Status| |Coverage-Status| |Branch-Coverage-Status| |Codacy-Grade| |Libraries-Rank| |PyPI-Downloads|

|DOI-URI| |LICENCE| |OpenHub-Status| |Gift-Casper|

Expand Down Expand Up @@ -56,6 +56,26 @@ Pull and install in the current directory:
pip install -e git+https://github.com/casperdcl/git-fame.git@master#egg=git-fame
Latest Snapcraft release
~~~~~~~~~~~~~~~~~~~~~~~~

|Snapcraft|

.. code:: sh
snap install git-fame
Latest Docker release
~~~~~~~~~~~~~~~~~~~~~

|Docker|

.. code:: sh
docker pull casperdcl/git-fame
docker run --rm casperdcl/git-fame --help
docker run --rm -v </local/path/to/repository>:/repo casperdcl/git-fame
Register alias with git
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -127,7 +147,7 @@ Documentation

|PyPI-Versions| |README-Hits|

.. code:: sh
.. code::
Usage:
gitfame [--help | options] [<gitdir>]
Expand All @@ -139,7 +159,7 @@ Documentation
-h, --help Print this help and exit.
-v, --version Print module version and exit.
--branch=<b> Branch or tag [default: HEAD] up to which to check.
--sort=<key> [default: loc]|commits|files.
--sort=<key> [default: loc]|commits|files|hours|months.
--excl=<f> Excluded files (default: None).
In no-regex mode, may be a comma-separated list.
Escape (\,) for a literal comma (may require \\, in shell).
Expand All @@ -154,6 +174,8 @@ Documentation
rather than regular expressions [default: False].
NB: if regex is enabled `,` is equivalent to `|`.
-s, --silent-progress Suppress `tqdm` [default: False].
--warn-binary Don't silently skip files which appear to be binary data
[default: False].
-t, --bytype Show stats per file extension [default: False].
-w, --ignore-whitespace Ignore whitespace when comparing the parent's
version and the child's to find where the lines
Expand Down Expand Up @@ -225,13 +247,17 @@ We are grateful for all |GitHub-Contributions|.
.. |GitHub-Updated| image:: https://img.shields.io/github/last-commit/casperdcl/git-fame/master.svg?logo=github&logoColor=white&label=pushed
:target: https://github.com/casperdcl/git-fame/pulse
.. |Gift-Casper| image:: https://img.shields.io/badge/gift-donate-dc10ff.svg
:target: https://caspersci.uk.to/donate.html
:target: https://caspersci.uk.to/donate
.. |PyPI-Status| image:: https://img.shields.io/pypi/v/git-fame.svg
:target: https://pypi.org/project/git-fame
.. |PyPI-Downloads| image:: https://img.shields.io/pypi/dm/git-fame.svg?label=pypi%20downloads&logo=python&logoColor=white
:target: https://pypi.org/project/git-fame
.. |PyPI-Versions| image:: https://img.shields.io/pypi/pyversions/git-fame.svg?logo=python&logoColor=white
:target: https://pypi.org/project/git-fame
.. |Snapcraft| image:: https://img.shields.io/badge/snap-install-82BEA0.svg?logo=snapcraft
:target: https://snapcraft.io/git-fame
.. |Docker| image:: https://img.shields.io/badge/docker-pull-blue.svg?logo=docker
:target: https://hub.docker.com/r/casperdcl/git-fame
.. |Libraries-Rank| image:: https://img.shields.io/librariesio/sourcerank/pypi/git-fame.svg?logo=koding&logoColor=white
:target: https://libraries.io/pypi/git-fame
.. |Libraries-Dependents| image:: https://img.shields.io/librariesio/dependent-repos/pypi/git-fame.svg?logo=koding&logoColor=white
Expand Down
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
comment:
layout: header, changes, diff
coverage:
status:
patch:
default:
target: '80'
project: false
11 changes: 10 additions & 1 deletion git-fame_completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ _git_fame()
"--sort")
COMPREPLY=($(compgen -W 'loc commits files' -- ${cur}))
;;
"--cost")
COMPREPLY=($(compgen -W 'months cocomo hours commits' -- ${cur}))
;;
"--format")
COMPREPLY=($(compgen -W 'pipe markdown yaml json csv tsv tabulate' -- ${cur}))
;;
"--log")
COMPREPLY=($(compgen -W 'FATAL CRITICAL ERROR WARNING INFO DEBUG NOTSET' -- ${cur}))
;;
*)
if [ ${COMP_WORDS[1]} == fame ]; then
COMPREPLY=($(compgen -dW '-h --help -v --version --cost --branch --since --sort --incl --excl -n --no-regex -s --silent-progress -t --bytype -w --ignore-whitespace -M -C --format --manpath --log' -- ${cur}))
COMPREPLY=($(compgen -dW '-h --help -v --version --cost --branch --since --sort --incl --excl -n --no-regex -s --silent-progress --warn-binary -t --bytype -w --ignore-whitespace -M -C --format --manpath --log' -- ${cur}))
fi
;;
esac
Expand Down
Loading

0 comments on commit 9780831

Please sign in to comment.