mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #5529 from pypa/issue-5486-null-markers
Issue 5486 null markers
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Solve issue where null markers were getting added to lock file when extras were provided.
|
||||
@@ -234,7 +234,8 @@ def clean_resolved_dep(dep, is_top_level=False, pipfile_entry=None):
|
||||
else:
|
||||
try:
|
||||
pipfile_entry = translate_markers(pipfile_entry)
|
||||
lockfile["markers"] = pipfile_entry.get("markers")
|
||||
if pipfile_entry.get("markers"):
|
||||
lockfile["markers"] = pipfile_entry.get("markers")
|
||||
except TypeError:
|
||||
pass
|
||||
return {name: lockfile}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@@ -719,3 +718,17 @@ six = "*"
|
||||
assert c.returncode == 0
|
||||
assert p.lockfile["prereq"]["six"]["index"] == "test"
|
||||
assert p.lockfile["default"]["requests"]["index"] == "test"
|
||||
|
||||
def test_pinned_pipfile_no_null_markers_when_extras(pipenv_instance_pypi):
|
||||
with pipenv_instance_pypi() as p:
|
||||
with open(p.pipfile_path, "w") as f:
|
||||
contents = """
|
||||
[packages]
|
||||
dataclasses-json = {extras = ["dev"], version = "==0.5.7"}
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
c = p.pipenv("lock")
|
||||
assert c.returncode == 0
|
||||
assert "dataclasses-json" in p.pipfile["packages"]
|
||||
assert "dataclasses-json" in p.lockfile["default"]
|
||||
assert "markers" not in p.lockfile["default"]["dataclasses-json"]
|
||||
Reference in New Issue
Block a user