126 Commits

Author SHA1 Message Date
Matt Calvert
6de2da8d58 Add style support and add GitLab Scoped labels (#50)
- Add new `--style` argument
- Add new **GitLab Scoped** label style
- Update documentation to reflect new argument
v1.9.0 v1.9.0rc1
2022-02-22 08:52:24 -05:00
Karthikeyan Singaravelan
17b4addc37 Use assertRaisesRegex for Python 3.11 compatibility (#48)
Use `assertRaisesRegex` instead of `assertRaisesRegexp` for Python 3.11 compatibility.
v1.8.0
2021-11-09 10:49:24 -05:00
Jon Grace-Cox
fa351616e1 Add buymeacoffee link to README.md 2021-11-04 14:45:58 -04:00
Fabian Affolter
6fbc545fad Remove unittest (#47) 2021-08-26 15:40:54 -04:00
Jon Grace-Cox
eec5a0c1bc Update issue templates 2021-05-26 09:40:07 -04:00
Jon Grace-Cox
a5ff4f0dfe Add semantic version support (#45) (#46)
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.
1.8.0rc1
2021-05-25 18:22:43 -04:00
Jon Grace-Cox
0f8dfbb695 Add label and value padding char command line options. (#40)
Also fixes command line usage with args defaulting to None on main function.
v1.7.0rc3 v1.7.0
2020-03-15 13:29:08 -04:00
Jon Grace-Cox
d38230ce3a Fix command line argument passing to main. (#39) v1.7.0rc2 2020-03-15 13:12:41 -04:00
Jon Grace-Cox
aeedfbb93d Fix padding issues (#38)
* 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.
v1.7.0rc1
2020-03-15 12:51:34 -04:00
deeplook
c6af09f82b Render badges inside notebook cells. (#37) 2020-01-27 17:32:05 -05:00
Jon Grace-Cox
b7387b9f1e Fix README code used to generate color examples table 2019-11-16 23:39:46 -05:00
Jon Grace-Cox
32935bd204 Add github cdn url prefixes to README color examples (#35) v1.6.2 2019-11-16 23:34:34 -05:00
Jon Grace-Cox
1cb03dcab9 33 fix setup readme issue (#34)
* Add bash prefixes to README code sections
* Switch to providing long description as markdown in setup.py

Closes #33
v1.6.1
2019-11-16 23:19:38 -05:00
Jon Grace-Cox
c4d06f3e05 Add extra colors and update docs (#31)
* Add a wider set of color names.
* Add better documentation in readme to show use of colors and
  custom colors.
* Add example color badges.
v1.6.0
2019-08-12 09:41:50 -04:00
Jon Grace-Cox
fdf66043a0 Add unittest to validate handling of float values with .00 (#29) v1.5.1 2019-07-16 17:48:24 -04:00
Krukov D
77cd93e79a X.0 is not int (#28) 2019-07-16 17:46:05 -04:00
Jon Grace-Cox
aebea09340 Fix int and float value detection (#26)
* 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.
v1.5.0
2019-07-11 21:43:48 -04:00
Jon Grace-Cox
6465c451c4 Fix widths (#24)
* 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.
2019-07-11 21:17:28 -04:00
Jon Grace-Cox
b394b47cc2 Adding all the badges to README (#23) 2019-06-21 01:12:01 -04:00
Jon Grace-Cox
086a2960aa Merge pull request #22 from jongracecox/add-download-stats
Add downloads stats to README
2019-06-21 00:24:42 -04:00
Jon Grace-Cox
6b232b1e9b Add downloads stats to README 2019-06-21 00:24:17 -04:00
Jon Grace-Cox
a284b4f32e Add demo repl to README.md 2019-06-02 00:28:34 -04:00
Jon Grace-Cox
c5fc1a6c61 Merge pull request #20 from jongracecox/10-fix-mutltiple-badge-width-issue
Use different SVG mask ids for each generated badge
v1.4.0
2019-06-01 23:52:10 -04:00
Jon Grace-Cox
3d24ecba0f Use different SVG mask ids for each generated badge
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.
2019-06-01 23:49:13 -04:00
Jon Grace-Cox
a4b20c60d1 Merge pull request #19 from jongracecox/add-repr-and-str-dunders
Add repr and str dunder functions
v1.3.0
2019-06-01 23:18:33 -04:00
Jon Grace-Cox
4bdb6dcdab Add repr and str dunder functions
* 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.
2019-06-01 23:15:13 -04:00
Jon Grace-Cox
b88eb5fc07 Merge pull request #18 from Steap/license-classifiers
Use classifiers to specify the license.
2019-06-01 10:34:53 -04:00
Cyril Roelandt
3450712ec6 Use classifiers to specify the license.
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.
2019-06-01 16:08:44 +02:00
Jon Grace-Cox
750205a595 Merge pull request #17 from jongracecox/add-pypi-package-badge-to-readme
Add pypi package badge to README.md
2019-06-01 04:36:10 -04:00
Jon Grace-Cox
281c7871d6 Add pypi package badge to README.md 2019-06-01 04:35:10 -04:00
Jon Grace-Cox
aa4977bcf8 Merge pull request #16 from jongracecox/14-fix-extra-padding-around-long-value-text
14 fix extra padding around long value text
v1.2.0 v1.2.0rc9
2019-06-01 04:07:05 -04:00
Jon Grace-Cox
28c58d060d Ensure that modified version is retained during deployment 2019-06-01 04:03:11 -04:00
Jon Grace-Cox
8e4d0d88f0 Ignore test badge files anywhere 2019-06-01 04:02:31 -04:00
Jon Grace-Cox
29dee657f9 Merge pull request #15 from jongracecox/14-fix-extra-padding-around-long-value-text
14 fix extra padding around long value text
v1.2.0rc8 v1.2.0rc1
2019-06-01 03:42:36 -04:00
Jon Grace-Cox
71fb2551f6 Comment out _get_character_percentage_dict function 2019-06-01 03:38:41 -04:00
Jon Grace-Cox
9f58cf07e4 Switch to xenial distribution for TravisCI
This is required in order to use Python3.
https://docs.travis-ci.com/user/languages/python/#python-37-and-higher
2019-06-01 03:38:41 -04:00
Jon Grace-Cox
c22485752f Use git tag for pypi package version
* 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.
2019-06-01 03:38:41 -04:00
Jon Grace-Cox
5405e1920c Update README.md with latest changes 2019-06-01 03:38:41 -04:00
Jon Grace-Cox
13eca9ebfd Run doctests and unittests as part of automated testing
* 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.
2019-06-01 03:38:41 -04:00
Jon Grace-Cox
1f2e030735 Add pytest and pytest-cov to build requirements 2019-06-01 03:38:41 -04:00
Jon Grace-Cox
cc8dd5ac96 Add threshold and text color unittests 2019-06-01 03:38:41 -04:00
Jon Grace-Cox
1532cc247e Add more accurate width calculations for truetype fonts
* 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.
2019-06-01 03:38:34 -04:00
Jon Grace-Cox
59976b5c25 Update ignored files
* .pytest_cache directory
* badge files generated by unittests
* htmlcov directory
2019-06-01 02:34:07 -04:00
Jon Grace-Cox
1850a95806 Fix green color, and default badge color. release-1.1.1 2018-03-26 07:44:51 -04:00
Jon Grace-Cox
debb72385a Added ability to set server logging level via env var. Added Dockerfile for running server. 2018-02-21 00:25:39 -05:00
Jon Grace-Cox
45f3a68a66 Added first implementation of anybadge HTTP server. 2018-02-18 23:03:27 -05:00
Jon Grace-Cox
2905d4a022 Switch to renderable SVG links in README. 2018-02-10 11:43:08 -05:00
Jon Grace-Cox
8eccc69ec6 Added pygments to build requirements. 2018-02-10 11:31:16 -05:00
Jon Grace-Cox
6d9863262c Added reStructuredText syntax check to setup.py and updated README. 2018-02-10 11:27:40 -05:00
Jon Grace-Cox
259437b4b1 Removed setup.cfg, as it may be causing documentation to be incrrectly rendered in PyPi. 2018-02-10 11:01:48 -05:00