Commit Graph

13 Commits

Author SHA1 Message Date
Jon Grace-Cox
1c986d4ad8 Add package testing to CI (#68)
* Make `build_examples.py` callable from python
* Allow tests to run from outside project directory
* Add invoke tasks
* Add server tests
* Run travis tests against wheel package instead of local code
* Update `badge.write_badge()` to support `pathlib.Path`
* Update `CONTRIBUTING.md`
2022-08-13 13:22:15 -04:00
Jon Grace-Cox
54fa6a40c2 Add Python 3.10 testing to ci (#67)
Update Travis CI config to use later Ubuntu worker
Add Python 3.10 testing
2022-08-09 19:01:52 -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
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
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
28c58d060d Ensure that modified version is retained during deployment 2019-06-01 04:03:11 -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
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
f0d204d743 Switch to using mister-bump for version bumping. 2018-02-09 21:42:38 -05:00
Jon Grace-Cox
96258f9ac4 Added PyPi deployment to travis.yml. 2017-09-11 21:02:48 -04:00
Jon Grace-Cox
3f7a8f3c17 Added basic travis CI file. 2017-09-11 18:17:12 -04:00