Skip to content

Commit

Permalink
serialize pyrequires path, needed for buildinfo (#14886)
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded authored Oct 9, 2023
1 parent 4650e12 commit 1bc18fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion conans/client/graph/python_requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def __init__(self, module, conanfile, ref, path, recipe_status, remote):

def serialize(self):
return {"remote": self.remote.name if self.remote is not None else None,
"recipe": self.recipe}
"recipe": self.recipe,
"path": self.path}


class PyRequires(object):
Expand Down
8 changes: 7 additions & 1 deletion conans/test/integration/command/info/info_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os
import textwrap

from conan.cli.exit_codes import ERROR_GENERAL
Expand Down Expand Up @@ -199,7 +200,12 @@ class pkg(ConanFile):

client.run("graph info . --format=json")
info = json.loads(client.stdout)
assert "tool/0.1#4d670581ccb765839f2239cc8dff8fbd" in info["graph"]["nodes"]["0"]["python_requires"]
pyrequires = info["graph"]["nodes"]["0"]["python_requires"]
tool = pyrequires["tool/0.1#4d670581ccb765839f2239cc8dff8fbd"]
# lets make sure the path exists
assert tool["recipe"] == "Cache"
assert tool["remote"] is None
assert os.path.exists(tool["path"])

def test_build_id_info(self):
client = TestClient()
Expand Down

0 comments on commit 1bc18fb

Please sign in to comment.