Skip to content

Commit

Permalink
Optionally support orjson for loading api json
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch committed Feb 2, 2024
1 parent 80ed95a commit f3bb221
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ lint:
touch honesty/__version__.py
python -m ufmt check $(SOURCES)
python -m flake8 $(SOURCES)
python -m checkdeps --allow-names honesty honesty
python -m checkdeps --allow-names honesty --metadata-extras orjson honesty
mypy --strict --install-types --non-interactive honesty

.PHONY: pessimist
Expand Down
5 changes: 5 additions & 0 deletions honesty/releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

from .cache import Cache

try:
import orjson as json # type: ignore[no-redef] # noqa: F811
except ImportError:
pass

LOG = logging.getLogger(__name__)

# Apologies in advance, "parsing" html via regex
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ dev =
test =
coverage >= 6
setuptools >= 65 ; python_version >= '3.12'
orjson =
orjson

[options.entry_points]
console_scripts =
Expand Down

0 comments on commit f3bb221

Please sign in to comment.