Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extension-pkg-whitelist=
buildstream._utils,
buildstream._variables,
buildstream._yaml,
ujson
orjson

# Add files or directories to the blacklist. They should be base names, not
# paths.
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ psutil
ruamel.yaml >= 0.16.7
ruamel.yaml.clib >= 0.1.2
pyroaring
ujson
orjson >= 3.10,<4
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ psutil==7.2.2
ruamel.yaml==0.19.1
ruamel.yaml.clib==0.2.15
pyroaring==1.1.0
ujson==5.12.0
orjson==3.12.0
## The following requirements were added by pip freeze:
MarkupSafe==3.0.3
typing_extensions==4.15.0
4 changes: 2 additions & 2 deletions src/buildstream/_cachekey.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import hashlib

import ujson
import orjson

# Internal record of the size of a cache key
_CACHEKEY_SIZE = len(hashlib.sha256().hexdigest())
Expand Down Expand Up @@ -58,5 +58,5 @@ def is_key(key):
# (str): An sha256 hex digest of the given value
#
def generate_key(value):
ustring = ujson.dumps(value, sort_keys=True, escape_forward_slashes=False).encode("utf-8")
ustring = orjson.dumps(value, option=orjson.OPT_SORT_KEYS)
return hashlib.sha256(ustring).hexdigest()
2 changes: 1 addition & 1 deletion src/buildstream/node.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ cdef class Node:
self.column = column

# This is in order to ensure we never add a `Node` to a cache key
# as ujson will try to convert objects if they have a `__json__`
# as orjson will try to convert objects if they have a `__json__`
# attribute.
def __json__(self):
raise ValueError("Nodes should not be allowed when jsonify-ing data", self)
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ commands =
deps =
mypy==1.13.0
types-protobuf==5.28.3.20241030
types-ujson==5.10.0.20240515
-rrequirements/requirements.txt
-rrequirements/dev-requirements.txt

Expand Down
Loading