A pybuilder plugin that generates badges for your project
Project description
pybuilder-anybadge
A pybuilder plugin that generates badges for your project. The plugin by default will create badges using anybadge
, for more information refer to the anybadge pypi page. The plugin can also be configured to generate the badges using img.shields.io
.
To add this plugin into your pybuilder project, add the following line near the top of your build.py:
use_plugin('pypi:pybuilder_anybadge')
NOTE if you are using Pybuilder version v0.11.x
, then specify the following version of the plugin:
use_plugin('pypi:pybuilder_anybadge', '~=0.1.6')
Pybuilder anybadge properties
The pybuilder task pyb anybadge
will use anybadge to generate badges for your project by processing reports produced from various plugins; the badges that are currently supported are:
- complexity - requires the pybuilder_radon plugin. Generate badge using cyclomatic complexity score of your most complicated function.
- vulnerabilities - requires the pybuilder_bandit plugin. Generate badge using number of security vulnerabilities discovered by vulnerabilities.
- coverage - requires the
coverage
plugin. Generate badge for overall unit test coverage. - python - Generate badge for version of Python being used
The plugin will write the respective badges to the docs/images
folder. The following plugin properties are available to further configure badge generation.
Name | Type | Default Value | Description |
---|---|---|---|
anybadge_exclude | str | '' | Comma delimited string of badges to exclude from processing, valid values are 'complexity', 'vulnerabilities', 'coverage' and 'python' |
anybadge_complexity_use_average | bool | False | Use overall average complexity as score when generating complexity badge |
anybadge_use_shields | bool | False | Will use img.shields.io to create the badges instead of anybadge |
Note the plugin will add the badge references but you must commit/push the changes (including svg files in the docs/images folder)
The plugin properties are set using project.set_property
, the following is an example of how to set the properties:
project.set_property('anybadge_exclude', 'vulnerabilities,coverage')
project.set_property('anybadge_complexity_use_average', True)
project.set_property('anybadge_use_shields', False)
By default the plugin will use anybadge
to create the badges and save them as svg files in the docs\images
folder:
However, setting anybadge_use_shields
to True
will render the badges using img.shields.io
:
Development
Clone the repository and ensure the latest version of Docker is installed on your development server.
Build the Docker image:
docker image build \
-t \
pybanybadge:latest .
Run the Docker container:
docker container run \
--rm \
-it \
-v $PWD:/pybuilder-anybadge \
pybanybadge:latest \
/bin/sh
Execute the build:
pyb -X
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pybuilder_anybadge-0.2.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6fb6ddf12fe7559ecd76eb35ab9f186d76079348088ac144ab6e7ee2c285501 |
|
MD5 | f984291b3d9efd94390125961646e864 |
|
BLAKE2b-256 | e1b11ad6f706af5e3fd4b840e5e886bdf47ff5db1c458fa7840d8cfbe4bf4c42 |