Commit Graph

12 Commits

Author SHA1 Message Date
Jon Grace-Cox
9d4470a1a0 Allow badges with no value or no label (#89)
This commit allows badges to be generated with only a label or only
a value.

Badges must provide at least a label or a value, so it is not valid
to create a badge with no label and no value. This will result in
a `ValueError` being raised.
2024-12-30 06:53:33 -05:00
Jon Grace-Cox
2af319bc6b Add standard color names (#76)
Closes #56
2022-08-15 14:43:27 -04:00
Jon Grace-Cox
406138d08e Add example emoji svg files (#75)
* Stop ignoring `example/*.svg` files
* Add emoji example svg files
2022-08-14 13:02:41 -04:00
Jon Grace-Cox
8a434d95b5 Drop <3.7 support and add type hints (#59)
- Drop support for Python <3.7
- Bump the pre-commit version used in CI
- Add type hinting and docstrings
- Add mypy to pre-commit config
- Fix typing issues
- Update colors module
  - Update colors module to use uppercase hex codes
  - Add `__lt__` to allow sorting colors by name
- Fix `build_examples.py` to work with color Enum
- Update example badges in `README.md`
- Fix typing issues in server
- Update travis links in `README.md`
- Fix PyPi deployment bug (#60)
2022-08-08 23:19:50 -04:00
Jon Grace-Cox
f16867114a Add pre-commit config and apply changes (#54)
- Add .pre-commit-config.yaml with initial config.
- Add python black pre-commit config
- Apply pre-commit code changes
- Add information to CONTRIBUTING.md
- Add pre-commit to build requirements
- Run pre-commit during travis CI build
- Use a travis build matrix to control when pre-commit runs
  in the CI process. Use explicit include to only run
  pre-commit on Python 3.9.
2022-08-08 19:02:02 -04:00
Jon Grace-Cox
efab2f6f79 Add missing example svg files (#53) 2022-03-10 07:34:48 -05:00
Jon Grace-Cox
b6ca345ebe Drop py27 support and refactor (#51) (#52)
Python version support
======================
- Drop Python 2.7 support
- Add testing for Python 3.4 and 3.9
- Set python version requirements in setup.py

Package changes
===============
- Split module up into a package with submodules
- Break templates out into package resources
- Incorporate server into same package
- Use Enum for colors
- Refresh example badges
- Simplify documentation - Remove cli options and python api
  documentation from the README as it is hard to maintain, and
  often goes out-of-date
- Add CONTRIBUTING.md
2022-03-10 07:26:46 -05:00
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
2022-02-22 08:52:24 -05: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.
2020-03-15 12:51:34 -04: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.
2019-08-12 09:41:50 -04:00
Jon Grace-Cox
397add0179 Added extra examples to README. 2018-02-10 10:31:01 -05:00
Jon Grace-Cox
bf68dd7b92 Include examples in README. Switch to markdown README. 2018-02-10 10:21:31 -05:00