diff --git a/pipenv/core.py b/pipenv/core.py index faea4dd5..e75f12c0 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -1218,7 +1218,7 @@ def do_init( if (project.lockfile_exists and not ignore_pipfile) and not skip_lock: old_hash = project.get_lockfile_hash() new_hash = project.calculate_pipfile_hash() - if new_hash != old_hash: + if new_hash.value != old_hash: if deploy: click.secho( "Your Pipfile.lock ({}) is out of date. Expected: ({}).".format( @@ -1244,7 +1244,7 @@ def do_init( else: msg = fix_utf8("Pipfile.lock is corrupted, replaced with ({1})...") click.secho( - msg.format(old_hash[-6:], new_hash[-6:]), + msg.format(old_hash[-6:], new_hash.value[-6:]), fg="yellow", bold=True, err=True, diff --git a/pipenv/project.py b/pipenv/project.py index fb4df7a1..8f4a8986 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -556,14 +556,16 @@ class Project: @property def _lockfile(self): """Pipfile.lock divided by PyPI and external dependencies.""" - pfile = plette.Pipfile.load(self.pipfile_location) - lockfile = json.loads(pfile.lock()) + lockfile = plette.Lockfile.with_meta_from( + plette.Pipfile.load(open(self.pipfile_location)) + ) for section in ("default", "develop"): lock_section = lockfile.get(section, {}) for key in list(lock_section.keys()): norm_key = pep423_name(key) lockfile[section][norm_key] = lock_section.pop(key) - return lockfile + + return lockfile._data @property def _pipfile(self): @@ -1008,8 +1010,8 @@ class Project: def calculate_pipfile_hash(self): # Update the lockfile if it is out-of-date. - p = plette.Pipfile.load(self.pipfile_location) - return p.hash + p = plette.Pipfile.load(open(self.pipfile_location)) + return p.get_hash() def ensure_proper_casing(self): """Ensures proper casing of Pipfile packages"""