Allow value and thresholds to be interpreted as semantic version numbers
by passing --semver (cli) or semver=True (python).
Add docs, unittests, import error handling, cli updates, requirements updates.
* Set default padding chars to 0.5.
* Split num_padding_chars into num_label_padding_chars and num_value_padding_chars
to allow better control. Retain num_padding_chars as an input parameter, but
internally it is dropped.
* Remove padding multipliers.
* Add measurements image for developers. Helps show what each of the internal
measurements are.
* Add script to build example badges.
* Update example badges.
Reliability
=======
* Raise a value error if an invalid font is passed.
* Handle labels that are not passed as str.
* Raise a value error if an invalid color name is passed.
Testing
=======
* Expand doctests to increase test coverage.
* Add Arial size 11 font and extra font sizes (mainly for testing).
* Make parse_args and main more testable by taking args as an input parameter.
* Use useful badge text in unittest badges.
* Add template svg file for testing.
* Add HTML coverage generation to travis yaml.
* Fix int and float value detection (Closes#25)
* Fix badge_width doctest
* Ignore all svg files across the whole project. This is mainly to prevent
accidentally adding them after tests run.
* Update badge widths
Switch to using get_text_width(' ') to get padding width.
This results in a more compact badge as the font_width that was used before
was the guesstimated font width that was too large.
* Update default num padding chars
This commit updates the number of padding characters to zero. Many issues have been
raised around producing more compact badges, so it feels like the most common usage would be
with this option defaulted to zero.
Within a single Python session anybadge will use different SVG mask IDs.
This is an attempt to fix the issue where SVG files displayed in the same
HTML will re-use the same mask, and therefore appear with the same dimensions.
Uses a singleton on the class to maintain a sequence of mask ids.
Includes unittests to ensure new ID is used for each badge.
* Add __repr__ function that prints the object representation.
* Add __str__ function that prints the Badge SVG text.
Also:
* Add constructor args to the Badge class docstring.
* Change the way defaults are used in the Badge constuctor. Instead of
setting values, use None and set arguments to the default values inside
the constructor.
* Fix unittests that don't use overwrite=True.
Classifiers are a standard way of specifying a license, and make it easy
for automated tools to properly detect the license of the package.
The "license" field should only be used if the license has no
corresponding Trove classifier.
* Stop using Mr Bump for version handling.
* Only deploy to pypi on tags (not master branch).
* Pick up version number from Travis CI TRAVIS_TAG environment variable.
* Switch default version to Python 3.7.
* Add 3.7 to the supported versions list.
* Remove redundant test.py.
This test module was basic and is being replaced by doctests and unittests.
* Use a better estimation technique to guess text widths.
* Add unittests for validating badge widths for various size badges.
* Add return types to function docstrings.
* Update relevant doctests.