Skip to content

Commit 807a317

Browse files
committed
simplify
1 parent 10d48bc commit 807a317

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/conan_py_build/build.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,16 +658,16 @@ def _do_build_wheel(
658658
except Exception as e:
659659
raise RuntimeError(f"Conan export-pkg failed: {e}") from e
660660

661-
pkg_path = Path(export_result["graph"].serialize()["nodes"]["0"]["package_folder"])
661+
root_node = export_result["graph"].serialize()["nodes"]["0"]
662+
pkg_path = Path(root_node["package_folder"])
662663
shutil.copytree(
663664
pkg_path, staging_dir,
664665
ignore=lambda _, names: [n for n in names if n in ("conaninfo.txt", "conanmanifest.txt")],
665666
dirs_exist_ok=True,
666667
)
667668

668669
if _clean_after_wheel(tool):
669-
exported_conanfile = export_result["graph"].root.conanfile
670-
conan_ref = f"{exported_conanfile.name}/{exported_conanfile.version}"
670+
conan_ref = root_node["ref"]
671671
try:
672672
conan_api.command.run(["remove", conan_ref, "-c"])
673673
except Exception as e:

0 commit comments

Comments
 (0)