Skip to content

Commit

Permalink
Make ujson optional
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed May 23, 2021
1 parent 8700996 commit 20ddfbb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion mathics_pygments/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
# Licensed under the MIT License (https://opensource.org/licenses/MIT)

import os.path as osp
import ujson
try:
import ujson
except ImportError:
import json as ujson

def get_datadir():
datadir = osp.normcase(osp.join(osp.dirname(osp.abspath(__file__)), "data"))
Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# ujson is really just optional
ujson
pytest
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def read(*rnames):
"data/mma-tables.json",
],
},
install_requires=["Pygments >= 2", "Mathics_Scanner>=1.2.0", "ujson"],
install_requires=["Pygments >= 2", "Mathics_Scanner>=1.2.0"],
include_package_data=False,
platforms=["any"],
entry_points={
Expand Down

0 comments on commit 20ddfbb

Please sign in to comment.