Skip to content

Commit 33d7de4

Browse files
committed
fixup! Add the outline for structured output
1 parent 40187ef commit 33d7de4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/pip/_internal/commands/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def get_available_package_versions(self, options: Values, args: List[Any]) -> No
147147
}
148148

149149
if dist is not None:
150-
structured_output["installed_version"] = dist.version
150+
structured_output["installed_version"] = str(dist.version)
151151

152152

153153
write_output(json.dumps(structured_output))

tests/functional/test_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_json_structured_output(script: PipTestEnvironment) -> None:
2929
"1.5.2, 1.5.1, 1.5, 1.4.1, 1.4, 1.3.1, 1.3, 1.2.1, 1.2, 1.1, 1.0.2,"
3030
" 1.0.1, 1.0, 0.8.3, 0.8.2, 0.8.1, 0.8, 0.7.2, 0.7.1, 0.7, 0.6.3, "
3131
"0.6.2, 0.6.1, 0.6, 0.5.1, 0.5, 0.4, 0.3.1, "
32-
"0.3, 0.2.1, 0.2" in structured_output.get("versions")
32+
"0.3, 0.2.1, 0.2" in ", ".join(structured_output.get("versions"))
3333
)
3434

3535
@pytest.mark.network

0 commit comments

Comments
 (0)