mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Simplify method
This commit is contained in:
@@ -39,10 +39,7 @@ def format_requirement_for_lockfile(req, markers_lookup, index_lookup, hashes=No
|
||||
return name, entry
|
||||
|
||||
|
||||
def get_locked_dep(dep, pipfile_section, prefer_pipfile=True):
|
||||
# the prefer pipfile flag is not used yet, but we are introducing
|
||||
# it now for development purposes
|
||||
# TODO: Is this implementation clear? How can it be improved?
|
||||
def get_locked_dep(dep, pipfile_section):
|
||||
entry = None
|
||||
cleaner_kwargs = {"is_top_level": False, "pipfile_entry": None}
|
||||
if isinstance(dep, Mapping) and dep.get("name"):
|
||||
@@ -62,8 +59,7 @@ def get_locked_dep(dep, pipfile_section, prefer_pipfile=True):
|
||||
lockfile_version = lockfile_dict.get("version", "")
|
||||
# Keep pins from the lockfile
|
||||
if (
|
||||
prefer_pipfile
|
||||
and lockfile_version != version
|
||||
lockfile_version != version
|
||||
and version.startswith("==")
|
||||
and "*" not in version
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user