diff --git a/python/helpers/lib/hasher.py b/python/helpers/lib/hasher.py index b134017d79e4..7e105c18c472 100644 --- a/python/helpers/lib/hasher.py +++ b/python/helpers/lib/hasher.py @@ -1,6 +1,6 @@ import hashin import json -import pipfile +import plette from poetry.factory import Factory @@ -15,9 +15,10 @@ def get_dependency_hash(dependency_name, dependency_version, algorithm): def get_pipfile_hash(directory): - p = pipfile.load(directory + '/Pipfile') + with open(directory + '/Pipfile') as f: + pipfile = plette.Pipfile.load(f) - return json.dumps({"result": p.hash}) + return json.dumps({"result": pipfile.get_hash().value}) def get_pyproject_hash(directory): diff --git a/python/helpers/requirements.txt b/python/helpers/requirements.txt index 21973cdcc72a..dff07d8e24f3 100644 --- a/python/helpers/requirements.txt +++ b/python/helpers/requirements.txt @@ -3,7 +3,7 @@ pip-tools==7.3.0 flake8==6.1.0 hashin==0.17.0 pipenv@git+https://github.com/pypa/pipenv@main -pipfile==0.0.2 +plette==0.4.4 poetry==1.7.1 # TODO: Replace 3p package `toml` with 3.11's new stdlib `tomllib` once we drop support for Python 3.10. toml==0.10.2