Skip to content

Commit

Permalink
add travis auto update diff badges
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tal committed Jun 11, 2015
1 parent 678d59d commit ab6c774
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 8 deletions.
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# decrypted key
travis-ci
34 changes: 26 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ python:
- "3.4"

env:
- TOXENV=py26
- TOXENV=py27
- TOXENV=py32
- TOXENV=py33
- TOXENV=py34
- TOXENV=pypy
- TOXENV=pypy3
- TOXENV=pep8
global:
secure: "ZUW2raXYAiqfOFpN4aPd9ntc916eVxHJlopASex5nF8LaDYwvNDGSiPlIHsqU6JTttkWCzqPlOC2KPML+evS0hEIgBtAIk1DZncrQU+tLpVvf2jTQnBfq+vuo2acAP2HJCbWmBj9ePKVWiMfjK5+iXY31CzhFl0naYYxlMMt1fc="
matrix:
- TOXENV=py26
- TOXENV=py27
- TOXENV=py32
- TOXENV=py33
- TOXENV=py34
- TOXENV=pypy
- TOXENV=pypy3
- TOXENV=pep8

before_install:
- pip install -U pip tox coveralls wheel setuptools
Expand All @@ -22,6 +25,21 @@ script: tox
after_success:
- coveralls

after_script:
- INSERTS=$(git diff --shortstat 62d52e04bb86614efc3e6e280b2c9adccddde83f master | cut -d ',' -f2 | awk '{print $1}')
- DELETES=$(git diff --shortstat 62d52e04bb86614efc3e6e280b2c9adccddde83f master | cut -d ',' -f3 | awk '{print $1}')
- TOTAL=$(expr $INSERTS + $DELETES)
- git checkout 62d52e04bb86614efc3e6e280b2c9adccddde83f
- STARTING=$(git ls-files | xargs wc -l | grep total | awk '{print $1}')
- DIFF=$(awk "BEGIN {printf \"%.2f\n\", $TOTAL/$STARTING * 100}")
- git checkout master
- git config --global user.name "a-tal"
- git config --global user.email "github@talsma.ca"
- sed -i -e "s/lines_in-.*/lines_in-$INSERTS-green.svg/" README.rst
- sed -i -e "s/lines_out-.*/lines_out-$DELETES-red.svg/" README.rst
- sed -i -e "s/total_change-.*/total_change-$DIFF%-yellow.svg/" README.rst
- if [[ $TOXENV == "py34" ]]; then git add README.rst; git commit -m '[ci skip] auto updated diff badges'; git push --force "https://$github_token@github.com/a-tal/bladerunner.git" master; fi

before_deploy:
- python setup.py build sdist bdist_wheel
- if [ "x" == "$(grep $(git tag -l --points-at=HEAD) bladerunner/__init__.py)x" ]; then echo 'new tag does not exist in __init__.py; bailing!'; exit 1; else echo "tag found in __init__.py"; fi
Expand Down
31 changes: 31 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,34 @@ If you come across a bug, please create a new issue in the `issue
tracking system <https://github.com/a-tal/bladerunner/issues>`__ with
enough relevant details and it will be dealt with promptly.


Authoritative Source
====================

Note that `this repository <https://github.com/a-tal/bladerunner>`__ is the
source repository for the Python Packaging Index and is the upstream repository
for all bug fixes and feature development.

This repository is distributed under the GPLv2 license, with the acknowledgement
that some (most, for now) of the library source code is under the BSD license
and is still Copyright (c) 2015 Activision Publishing, Inc (see the LICENSE file
for full details).

Having said that, this project is transitioning away from the prior codebase.
To track how much of the code base is GPLv2 vs BSD, you can use:

.. code:: bash
$ git diff --stat 62d52e04bb86614efc3e6e280b2c9adccddde83f master
It's also being tracked and updated via Travis-CI right here:

|Lines In|

|Lines Out|

|Total Change|

.. |Build Status| image:: https://travis-ci.org/a-tal/bladerunner.png?branch=master
:target: https://travis-ci.org/a-tal/bladerunner
.. |Coverage Status| image:: https://coveralls.io/repos/a-tal/bladerunner/badge.png?branch=master
Expand All @@ -340,3 +368,6 @@ enough relevant details and it will be dealt with promptly.
:target: https://pypi.python.org/pypi/bladerunner/
.. |Downloads this month| image:: https://img.shields.io/pypi/dm/bladerunner.svg
:target: https://pypi.python.org/pypi/bladerunner/
.. |Lines In| image:: https://img.shields.io/badge/lines_in-619-green.svg
.. |Lines out| image:: https://img.shields.io/badge/lines_out-1096-red.svg
.. |Total Change| image:: https://img.shields.io/badge/total_change-22.74%-yellow.svg

0 comments on commit ab6c774

Please sign in to comment.