Skip to content

Commit

Permalink
dependencies fix (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
o-murphy authored Nov 6, 2023
1 parent e6a6672 commit 932ad51
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion a7p/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.0.6'
__version__ = '0.0.7'
__author__ = "o-murphy"
__credits__ = ["Dmytro Yaroshenko"]
__copyright__ = ("",)
Expand Down
3 changes: 3 additions & 0 deletions a7p/a7p.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from a7p import profedit_pb2
from google.protobuf.json_format import MessageToJson, MessageToDict, Parse
from a7p import protovalidate as validator

__all__ = ['A7PFile', 'A7PDataError']

Expand All @@ -21,6 +22,7 @@ def loads(string: bytes):
if md5_hash == string[:32].decode():
profile = profedit_pb2.Payload()
profile.ParseFromString(data)
validator.validate(profile)
return profile
else:
raise A7PDataError("Input data is missing for MD5 hashing")
Expand All @@ -32,6 +34,7 @@ def load(file: BinaryIO) -> profedit_pb2.Payload:

@staticmethod
def dumps(profile: profedit_pb2.Payload) -> bytes:
validator.validate(profile)
data = profile.SerializeToString()
md5_hash = hashlib.md5(data).hexdigest().encode()
return md5_hash + data
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = ["google", "protobuf"]
dependencies = ["google", "protobuf", "cel-python"]
dynamic = ["version"]


Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
google==3.0.0
protobuf==4.24.0
cel-python

0 comments on commit 932ad51

Please sign in to comment.