126 Commits

Author SHA1 Message Date
Jon Grace-Cox
25cdd6912b test: Add xml output to invoke test execution v1.16.0 2025-01-11 14:56:19 -08:00
Jon Grace-Cox
af9d06f5b0 test: Add escaping tests 2025-01-11 14:56:19 -08:00
Jon Grace-Cox
27b4fffcb8 chore: Update issue template markdown 2025-01-11 14:56:19 -08:00
Jon Grace-Cox
7be9e3e966 fix: Fix package version (#106)
Attempt to fix the package version bug by fetching the entire repo
in the package build workflow. This should get the tag so it can be
used when setting the version.

Closes #106.
2025-01-11 14:56:19 -08:00
Jon Grace-Cox
08fba7be99 feat: Correctly detect emoji character widths 2025-01-11 14:56:19 -08:00
Jon Grace-Cox
575833bf19 test: Ensure tests run against correct version
Update the `inv --test.local` command to ensure that tests are run against
the correct version of the package. The invoke command has been updated to:

- Ensure the `anybadge` command is not available on the system to start with

- Ensure `pip` is available

- Pip install the local project

- Run tests

- Pip uninstall `anybadge`

The net result is that invoke will be more robust in terms of making sure the
installed version is in sync when running CLI tests.
2025-01-11 14:56:19 -08:00
Jon Grace-Cox
6199d65ee7 fix: Fix invoke when anybadge not installed 2025-01-11 14:56:19 -08:00
Jon Grace-Cox
d474a4065b feat: Handle bad thresholds more elegantly 2025-01-11 14:56:19 -08:00
Jon Grace-Cox
c20d66fe0a fix: Fix label and value escaping
Fix label and value escaping by defaulting to html escaping them.
Provide Python and CLI args to allow reverting to old behavior of
not escaping.

Fixes #91
2025-01-11 14:56:19 -08:00
Jon Grace-Cox
67af6673fc fix: Fix pypi publish authentication v1.15.6 2024-12-30 11:06:17 -05:00
Jon Grace-Cox
ba4ef2f8c1 fix: Download dist before deploying to pypi v1.15.5 2024-12-30 11:00:51 -05:00
Jon Grace-Cox
44d6c67fb1 fix: Fix Python release workflow v1.15.4 2024-12-30 10:50:25 -05:00
Jon Grace-Cox
93e9816fde fix: Fix gh-action-pypi-publish action version v1.15.3 2024-12-30 10:22:15 -05:00
Jon Grace-Cox
87e8f3bde0 fix: Fix release workflow v1.15.2 2024-12-30 10:13:15 -05:00
Jon Grace-Cox
03a91dd6a5 test: Limit tox execution
Only run tox when code changes.
v1.15.1
2024-12-30 10:03:56 -05:00
Jon Grace-Cox
16c7eab136 fix: Fix tox workflow python versions
Remove 3.7 from python version list due to bug in action:

https://github.com/actions/setup-python/issues/962
2024-12-30 10:03:56 -05:00
Jon Grace-Cox
bfdc87b313 fix: Fix package release workflow 2024-12-30 10:03:56 -05:00
Jon Grace-Cox
ba0b8a333d chore: Use git tag for package version
Update `setup.py` to use git tag for package version.
v1.15.0
2024-12-30 09:08:43 -05:00
Jon Grace-Cox
d053fb613a chore: Replace email with protected email 2024-12-30 09:08:43 -05:00
Jon Grace-Cox
267939bcea chore: Switch release workflow to github
Switch from using TravisCI to GitHub for the Python package release workflow.
2024-12-30 09:08:43 -05:00
Jon Grace-Cox
e6318f3446 test: Add tox testing
Add `tox.ini` config with supported versions, and a new tox CI
workflow to run tox tests on master branch changes. This is "expensive"
so we may consider limiting execution further.
2024-12-30 08:29:56 -05:00
Jon Grace-Cox
43a4bea37c fix: Fix pre-commit on master branch
Ignore no-commit-to-branch check when running in CI workflow, since this check
is only relevant to running locally, and fails when running on master branch in
CI workflow.
2024-12-30 07:57:26 -05:00
Jon Grace-Cox
cda1c4ddfa test: Run PR checks on master push
Run PR checks on pushes to master in addition to master branch PRs. This
allows the check to be used in a master branch ruleset.
2024-12-30 07:50:44 -05:00
Jon Grace-Cox
9d660b5652 refactor: Refactor PR checks into single workflow
Refactor the pre-commit and python test workflows into a single workflow
in order to use pre-commit check as a gate for Python tests. This will help
limit execution of Python tests.
2024-12-30 07:50:44 -05:00
Jon Grace-Cox
96d102f307 test: Run cli checks in PR workflow
Simplify execution of CLI tests and run them in the CI workflow after
Python tests.
2024-12-30 07:30:11 -05:00
Jon Grace-Cox
bb9ef961fb chore: Add github workflows
Add github workflows for running pre-commit hooks on all files and
running pytests.
2024-12-30 07:16:00 -05:00
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
a076a4867a chore: Update pre-commit hooks
Update pre-commit hooks to latest version and apply fixes for
mypy type checking and linting.
2024-12-30 06:46:24 -05:00
Jon Grace-Cox
cc5a757663 Add 3.11 to travis ci (#85)
Switch to Ubuntu jammy release, and add 3.11 testing.
2023-03-27 10:30:29 -07:00
Jon Grace-Cox
65ee5a2578 Update pypi deploy to use token (#84) 2022-08-25 17:10:44 -04:00
Jon Grace-Cox
f4fbb70d87 Add pepy.tech total downloads badge to readme (#83) 2022-08-24 18:52:28 -04:00
Jon Grace-Cox
bc1ff41348 Fix readme and contribution guide (#82) 2022-08-24 18:44:22 -04:00
Jon Grace-Cox
ea180efc1e Add snyk health badge to readme (#81) v1.14.0 2022-08-24 18:36:59 -04:00
Jon Grace-Cox
cb40df6d11 Refactor invoke tasks (#80)
- Add `--version` to cli
- Add invoke tasks:
  - `package.build`
  - `package.install`
  - `test.cli`
- Refactor invoke task implementation
- Refactor `run_pypi_tests.sh`
- Split into separate files to support running locally
2022-08-24 17:05:55 -04:00
Jannis Mainczyk
2bd52f41cd anybadge cli accessible via python -m (#79)
* anybadge cli can be called via python -m

* fix: anybadge should be shown in cli usage string

* also allow executing anybadge.server as module

* test: same output regardless of how cli is called
2022-08-24 15:08:08 -04:00
Jon Grace-Cox
2af319bc6b Add standard color names (#76)
Closes #56
v1.13.0
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
34374dbc2b Add emoji examples to documentation (#74)
Closes #43
2022-08-14 12:33:12 -04:00
Jon Grace-Cox
ea2eccd948 Add testing for PyPi releases (#72) v1.12.0 2022-08-13 15:35:46 -04:00
Jon Grace-Cox
ff0ee0d5e0 Fix pypi deploy (#71)
Ensure deploy happens from project root directory
v1.11.2rc2
2022-08-13 14:57:10 -04:00
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`
v1.11.2rc1
2022-08-13 13:22:15 -04:00
Jon Grace-Cox
9b7318417d Fix broken server import (#70)
Closes #66
2022-08-13 12:12:19 -04:00
Jon Grace-Cox
b891c596d6 Allow template as pathlib.Path (#69) 2022-08-13 12:07:55 -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
27b25f7a26 Fix backage build missing templates submodule (#63) (#64) v1.11.1 2022-08-09 08:22:05 -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)
v1.11.0
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.
v1.10.0
2022-08-08 19:02:02 -04:00
Jon Grace-Cox
217555a155 Fix typo in readme (#49) (#58) 2022-08-08 18:38:04 -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