conan 2.17.1__tar.gz → 2.18.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (356) hide show
  1. {conan-2.17.1/conan.egg-info → conan-2.18.0}/PKG-INFO +1 -1
  2. {conan-2.17.1 → conan-2.18.0}/conan/__init__.py +1 -1
  3. {conan-2.17.1 → conan-2.18.0}/conan/api/conan_api.py +2 -0
  4. {conan-2.17.1 → conan-2.18.0}/conan/api/output.py +6 -0
  5. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/cache.py +8 -0
  6. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/command.py +2 -1
  7. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/config.py +2 -2
  8. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/local.py +3 -1
  9. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/new.py +4 -0
  10. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/profiles.py +6 -6
  11. conan-2.18.0/conan/api/subapi/report.py +144 -0
  12. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/workspace.py +91 -39
  13. {conan-2.17.1 → conan-2.18.0}/conan/cli/command.py +3 -0
  14. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/audit.py +20 -10
  15. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/cache.py +14 -0
  16. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/create.py +2 -2
  17. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/editable.py +1 -0
  18. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/export_pkg.py +1 -1
  19. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/profile.py +1 -0
  20. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/remote.py +1 -0
  21. conan-2.18.0/conan/cli/commands/report.py +61 -0
  22. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/upload.py +1 -0
  23. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/version.py +1 -0
  24. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/workspace.py +159 -54
  25. conan-2.18.0/conan/cli/formatters/report/__init__.py +1 -0
  26. conan-2.18.0/conan/cli/formatters/report/diff.py +95 -0
  27. conan-2.18.0/conan/cli/formatters/report/diff_html.py +138 -0
  28. {conan-2.17.1 → conan-2.18.0}/conan/cli/printers/graph.py +6 -0
  29. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/detect/detect_api.py +13 -9
  30. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/install/generators.py +4 -2
  31. conan-2.18.0/conan/internal/api/new/premake_exe.py +104 -0
  32. conan-2.18.0/conan/internal/api/new/premake_lib.py +148 -0
  33. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/workspace.py +6 -8
  34. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/profile/profile_loader.py +12 -11
  35. {conan-2.17.1 → conan-2.18.0}/conan/internal/cache/cache.py +8 -0
  36. {conan-2.17.1 → conan-2.18.0}/conan/internal/cache/db/cache_database.py +6 -0
  37. {conan-2.17.1 → conan-2.18.0}/conan/internal/cache/db/packages_table.py +13 -0
  38. {conan-2.17.1 → conan-2.18.0}/conan/internal/cache/db/recipes_table.py +13 -0
  39. {conan-2.17.1 → conan-2.18.0}/conan/internal/cache/integrity_check.py +12 -12
  40. {conan-2.17.1 → conan-2.18.0}/conan/internal/conan_app.py +1 -1
  41. {conan-2.17.1 → conan-2.18.0}/conan/internal/default_settings.py +9 -1
  42. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/compute_pid.py +4 -4
  43. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/graph.py +30 -11
  44. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/graph_binaries.py +2 -2
  45. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/graph_builder.py +17 -5
  46. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/graph_error.py +0 -14
  47. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/install_graph.py +9 -6
  48. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/installer.py +8 -4
  49. {conan-2.17.1 → conan-2.18.0}/conan/internal/hook_manager.py +3 -1
  50. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/conf.py +19 -8
  51. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/cpp_info.py +21 -2
  52. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/workspace.py +23 -25
  53. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/remote_manager.py +19 -5
  54. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/rest_client_local_recipe_index.py +8 -1
  55. {conan-2.17.1 → conan-2.18.0}/conan/test/utils/file_server.py +1 -1
  56. {conan-2.17.1 → conan-2.18.0}/conan/test/utils/tools.py +17 -0
  57. {conan-2.17.1 → conan-2.18.0}/conan/tools/apple/apple.py +0 -6
  58. {conan-2.17.1 → conan-2.18.0}/conan/tools/apple/xcodedeps.py +0 -1
  59. {conan-2.17.1 → conan-2.18.0}/conan/tools/apple/xcodetoolchain.py +13 -5
  60. {conan-2.17.1 → conan-2.18.0}/conan/tools/build/cppstd.py +18 -1
  61. {conan-2.17.1 → conan-2.18.0}/conan/tools/build/cstd.py +16 -0
  62. {conan-2.17.1 → conan-2.18.0}/conan/tools/build/flags.py +35 -5
  63. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmake.py +12 -2
  64. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps/templates/macros.py +17 -2
  65. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps2/target_configuration.py +15 -4
  66. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps2/targets.py +1 -0
  67. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/presets.py +4 -1
  68. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/toolchain/blocks.py +42 -7
  69. {conan-2.17.1 → conan-2.18.0}/conan/tools/gnu/autotoolstoolchain.py +23 -6
  70. {conan-2.17.1 → conan-2.18.0}/conan/tools/gnu/get_gnu_triplet.py +1 -0
  71. {conan-2.17.1 → conan-2.18.0}/conan/tools/gnu/gnutoolchain.py +22 -6
  72. {conan-2.17.1 → conan-2.18.0}/conan/tools/gnu/pkgconfigdeps.py +2 -1
  73. conan-2.18.0/conan/tools/google/bazeldeps.py +547 -0
  74. conan-2.18.0/conan/tools/layout/__init__.py +16 -0
  75. {conan-2.17.1 → conan-2.18.0}/conan/tools/meson/helpers.py +2 -1
  76. {conan-2.17.1 → conan-2.18.0}/conan/tools/meson/meson.py +2 -0
  77. {conan-2.17.1 → conan-2.18.0}/conan/tools/meson/toolchain.py +24 -13
  78. {conan-2.17.1 → conan-2.18.0}/conan/tools/microsoft/msbuilddeps.py +11 -3
  79. conan-2.18.0/conan/tools/premake/__init__.py +3 -0
  80. conan-2.18.0/conan/tools/premake/constants.py +33 -0
  81. conan-2.18.0/conan/tools/premake/premake.py +119 -0
  82. {conan-2.17.1 → conan-2.18.0}/conan/tools/premake/premakedeps.py +7 -10
  83. conan-2.18.0/conan/tools/premake/toolchain.py +296 -0
  84. {conan-2.17.1 → conan-2.18.0}/conan/tools/qbs/common.py +2 -1
  85. {conan-2.17.1 → conan-2.18.0}/conan/tools/sbom/cyclonedx.py +6 -6
  86. {conan-2.17.1 → conan-2.18.0}/conan/tools/scm/git.py +3 -0
  87. {conan-2.17.1 → conan-2.18.0/conan.egg-info}/PKG-INFO +1 -1
  88. {conan-2.17.1 → conan-2.18.0}/conan.egg-info/SOURCES.txt +9 -0
  89. conan-2.17.1/conan/tools/google/bazeldeps.py +0 -644
  90. conan-2.17.1/conan/tools/layout/__init__.py +0 -13
  91. conan-2.17.1/conan/tools/premake/__init__.py +0 -2
  92. conan-2.17.1/conan/tools/premake/premake.py +0 -40
  93. {conan-2.17.1 → conan-2.18.0}/LICENSE.md +0 -0
  94. {conan-2.17.1 → conan-2.18.0}/MANIFEST.in +0 -0
  95. {conan-2.17.1 → conan-2.18.0}/README.md +0 -0
  96. {conan-2.17.1 → conan-2.18.0}/conan/api/__init__.py +0 -0
  97. {conan-2.17.1 → conan-2.18.0}/conan/api/input.py +0 -0
  98. {conan-2.17.1 → conan-2.18.0}/conan/api/model/__init__.py +0 -0
  99. {conan-2.17.1 → conan-2.18.0}/conan/api/model/list.py +0 -0
  100. {conan-2.17.1 → conan-2.18.0}/conan/api/model/refs.py +0 -0
  101. {conan-2.17.1 → conan-2.18.0}/conan/api/model/remote.py +0 -0
  102. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/__init__.py +0 -0
  103. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/audit.py +0 -0
  104. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/download.py +0 -0
  105. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/export.py +0 -0
  106. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/graph.py +0 -0
  107. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/install.py +0 -0
  108. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/list.py +0 -0
  109. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/lockfile.py +0 -0
  110. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/remotes.py +0 -0
  111. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/remove.py +0 -0
  112. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/search.py +0 -0
  113. {conan-2.17.1 → conan-2.18.0}/conan/api/subapi/upload.py +0 -0
  114. {conan-2.17.1 → conan-2.18.0}/conan/cli/__init__.py +0 -0
  115. {conan-2.17.1 → conan-2.18.0}/conan/cli/args.py +0 -0
  116. {conan-2.17.1 → conan-2.18.0}/conan/cli/cli.py +0 -0
  117. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/__init__.py +0 -0
  118. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/build.py +0 -0
  119. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/config.py +0 -0
  120. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/download.py +0 -0
  121. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/export.py +0 -0
  122. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/graph.py +0 -0
  123. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/inspect.py +0 -0
  124. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/install.py +0 -0
  125. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/list.py +0 -0
  126. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/lock.py +0 -0
  127. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/new.py +0 -0
  128. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/pkglist.py +0 -0
  129. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/remove.py +0 -0
  130. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/search.py +0 -0
  131. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/source.py +0 -0
  132. {conan-2.17.1 → conan-2.18.0}/conan/cli/commands/test.py +0 -0
  133. {conan-2.17.1 → conan-2.18.0}/conan/cli/exit_codes.py +0 -0
  134. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/__init__.py +0 -0
  135. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/audit/__init__.py +0 -0
  136. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/audit/vulnerabilities.py +0 -0
  137. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/graph/__init__.py +0 -0
  138. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/graph/build_order_html.py +0 -0
  139. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/graph/graph.py +0 -0
  140. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/graph/graph_info_text.py +0 -0
  141. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/graph/info_graph_dot.py +0 -0
  142. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/graph/info_graph_html.py +0 -0
  143. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/list/__init__.py +0 -0
  144. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/list/list.py +0 -0
  145. {conan-2.17.1 → conan-2.18.0}/conan/cli/formatters/list/search_table_html.py +0 -0
  146. {conan-2.17.1 → conan-2.18.0}/conan/cli/printers/__init__.py +0 -0
  147. {conan-2.17.1 → conan-2.18.0}/conan/cps/__init__.py +0 -0
  148. {conan-2.17.1 → conan-2.18.0}/conan/cps/cps.py +0 -0
  149. {conan-2.17.1 → conan-2.18.0}/conan/errors.py +0 -0
  150. {conan-2.17.1 → conan-2.18.0}/conan/internal/__init__.py +0 -0
  151. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/__init__.py +0 -0
  152. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/audit/__init__.py +0 -0
  153. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/audit/providers.py +0 -0
  154. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/config/__init__.py +0 -0
  155. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/config/config_installer.py +0 -0
  156. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/detect/__init__.py +0 -0
  157. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/detect/detect_vs.py +0 -0
  158. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/export.py +0 -0
  159. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/install/__init__.py +0 -0
  160. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/list/__init__.py +0 -0
  161. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/list/query_parse.py +0 -0
  162. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/local/__init__.py +0 -0
  163. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/local/editable.py +0 -0
  164. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/migrations.py +0 -0
  165. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/__init__.py +0 -0
  166. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/alias_new.py +0 -0
  167. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/autoools_exe.py +0 -0
  168. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/autotools_lib.py +0 -0
  169. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/basic.py +0 -0
  170. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/bazel_7_exe.py +0 -0
  171. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/bazel_7_lib.py +0 -0
  172. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/bazel_exe.py +0 -0
  173. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/bazel_lib.py +0 -0
  174. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/cmake_exe.py +0 -0
  175. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/cmake_lib.py +0 -0
  176. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/header_lib.py +0 -0
  177. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/local_recipes_index.py +0 -0
  178. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/meson_exe.py +0 -0
  179. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/meson_lib.py +0 -0
  180. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/msbuild_exe.py +0 -0
  181. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/msbuild_lib.py +0 -0
  182. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/new/qbs_lib.py +0 -0
  183. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/profile/__init__.py +0 -0
  184. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/profile/detect.py +0 -0
  185. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/remotes/__init__.py +0 -0
  186. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/remotes/encrypt.py +0 -0
  187. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/remotes/localdb.py +0 -0
  188. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/upload.py +0 -0
  189. {conan-2.17.1 → conan-2.18.0}/conan/internal/api/uploader.py +0 -0
  190. {conan-2.17.1 → conan-2.18.0}/conan/internal/cache/__init__.py +0 -0
  191. {conan-2.17.1 → conan-2.18.0}/conan/internal/cache/conan_reference_layout.py +0 -0
  192. {conan-2.17.1 → conan-2.18.0}/conan/internal/cache/db/__init__.py +0 -0
  193. {conan-2.17.1 → conan-2.18.0}/conan/internal/cache/db/table.py +0 -0
  194. {conan-2.17.1 → conan-2.18.0}/conan/internal/cache/home_paths.py +0 -0
  195. {conan-2.17.1 → conan-2.18.0}/conan/internal/deploy.py +0 -0
  196. {conan-2.17.1 → conan-2.18.0}/conan/internal/errors.py +0 -0
  197. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/__init__.py +0 -0
  198. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/build_mode.py +0 -0
  199. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/compatibility.py +0 -0
  200. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/profile_node_definer.py +0 -0
  201. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/provides.py +0 -0
  202. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/proxy.py +0 -0
  203. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/python_requires.py +0 -0
  204. {conan-2.17.1 → conan-2.18.0}/conan/internal/graph/range_resolver.py +0 -0
  205. {conan-2.17.1 → conan-2.18.0}/conan/internal/internal_tools.py +0 -0
  206. {conan-2.17.1 → conan-2.18.0}/conan/internal/loader.py +0 -0
  207. {conan-2.17.1 → conan-2.18.0}/conan/internal/methods.py +0 -0
  208. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/__init__.py +0 -0
  209. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/conan_file.py +0 -0
  210. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/conanfile_interface.py +0 -0
  211. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/dependencies.py +0 -0
  212. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/info.py +0 -0
  213. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/layout.py +0 -0
  214. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/lockfile.py +0 -0
  215. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/manifest.py +0 -0
  216. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/options.py +0 -0
  217. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/pkg_type.py +0 -0
  218. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/profile.py +0 -0
  219. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/recipe_ref.py +0 -0
  220. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/requires.py +0 -0
  221. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/settings.py +0 -0
  222. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/version.py +0 -0
  223. {conan-2.17.1 → conan-2.18.0}/conan/internal/model/version_range.py +0 -0
  224. {conan-2.17.1 → conan-2.18.0}/conan/internal/paths.py +0 -0
  225. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/__init__.py +0 -0
  226. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/auth_manager.py +0 -0
  227. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/caching_file_downloader.py +0 -0
  228. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/client_routes.py +0 -0
  229. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/conan_requester.py +0 -0
  230. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/download_cache.py +0 -0
  231. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/file_downloader.py +0 -0
  232. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/file_uploader.py +0 -0
  233. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/pkg_sign.py +0 -0
  234. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/remote_credentials.py +0 -0
  235. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/rest_client.py +0 -0
  236. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/rest_client_v2.py +0 -0
  237. {conan-2.17.1 → conan-2.18.0}/conan/internal/rest/rest_routes.py +0 -0
  238. {conan-2.17.1 → conan-2.18.0}/conan/internal/runner/__init__.py +0 -0
  239. {conan-2.17.1 → conan-2.18.0}/conan/internal/runner/docker.py +0 -0
  240. {conan-2.17.1 → conan-2.18.0}/conan/internal/runner/output.py +0 -0
  241. {conan-2.17.1 → conan-2.18.0}/conan/internal/runner/ssh.py +0 -0
  242. {conan-2.17.1 → conan-2.18.0}/conan/internal/runner/wsl.py +0 -0
  243. {conan-2.17.1 → conan-2.18.0}/conan/internal/source.py +0 -0
  244. {conan-2.17.1 → conan-2.18.0}/conan/internal/subsystems.py +0 -0
  245. {conan-2.17.1 → conan-2.18.0}/conan/internal/util/__init__.py +0 -0
  246. {conan-2.17.1 → conan-2.18.0}/conan/internal/util/config_parser.py +0 -0
  247. {conan-2.17.1 → conan-2.18.0}/conan/internal/util/dates.py +0 -0
  248. {conan-2.17.1 → conan-2.18.0}/conan/internal/util/files.py +0 -0
  249. {conan-2.17.1 → conan-2.18.0}/conan/internal/util/runners.py +0 -0
  250. {conan-2.17.1 → conan-2.18.0}/conan/test/__init__.py +0 -0
  251. {conan-2.17.1 → conan-2.18.0}/conan/test/assets/__init__.py +0 -0
  252. {conan-2.17.1 → conan-2.18.0}/conan/test/assets/autotools.py +0 -0
  253. {conan-2.17.1 → conan-2.18.0}/conan/test/assets/cmake.py +0 -0
  254. {conan-2.17.1 → conan-2.18.0}/conan/test/assets/genconanfile.py +0 -0
  255. {conan-2.17.1 → conan-2.18.0}/conan/test/assets/sources.py +0 -0
  256. {conan-2.17.1 → conan-2.18.0}/conan/test/assets/visual_project_files.py +0 -0
  257. {conan-2.17.1 → conan-2.18.0}/conan/test/utils/__init__.py +0 -0
  258. {conan-2.17.1 → conan-2.18.0}/conan/test/utils/artifactory.py +0 -0
  259. {conan-2.17.1 → conan-2.18.0}/conan/test/utils/env.py +0 -0
  260. {conan-2.17.1 → conan-2.18.0}/conan/test/utils/mocks.py +0 -0
  261. {conan-2.17.1 → conan-2.18.0}/conan/test/utils/profiles.py +0 -0
  262. {conan-2.17.1 → conan-2.18.0}/conan/test/utils/scm.py +0 -0
  263. {conan-2.17.1 → conan-2.18.0}/conan/test/utils/server_launcher.py +0 -0
  264. {conan-2.17.1 → conan-2.18.0}/conan/test/utils/test_files.py +0 -0
  265. {conan-2.17.1 → conan-2.18.0}/conan/tools/__init__.py +0 -0
  266. {conan-2.17.1 → conan-2.18.0}/conan/tools/android/__init__.py +0 -0
  267. {conan-2.17.1 → conan-2.18.0}/conan/tools/android/utils.py +0 -0
  268. {conan-2.17.1 → conan-2.18.0}/conan/tools/apple/__init__.py +0 -0
  269. {conan-2.17.1 → conan-2.18.0}/conan/tools/apple/xcodebuild.py +0 -0
  270. {conan-2.17.1 → conan-2.18.0}/conan/tools/build/__init__.py +0 -0
  271. {conan-2.17.1 → conan-2.18.0}/conan/tools/build/cpu.py +0 -0
  272. {conan-2.17.1 → conan-2.18.0}/conan/tools/build/cross_building.py +0 -0
  273. {conan-2.17.1 → conan-2.18.0}/conan/tools/build/stdcpp_library.py +0 -0
  274. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/__init__.py +0 -0
  275. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps/__init__.py +0 -0
  276. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps/cmakedeps.py +0 -0
  277. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps/templates/__init__.py +0 -0
  278. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps/templates/config.py +0 -0
  279. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps/templates/config_version.py +0 -0
  280. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps/templates/target_configuration.py +0 -0
  281. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps/templates/target_data.py +0 -0
  282. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps/templates/targets.py +0 -0
  283. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps2/__init__.py +0 -0
  284. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps2/cmakedeps.py +0 -0
  285. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps2/config.py +0 -0
  286. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/cmakedeps2/config_version.py +0 -0
  287. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/layout.py +0 -0
  288. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/toolchain/__init__.py +0 -0
  289. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/toolchain/toolchain.py +0 -0
  290. {conan-2.17.1 → conan-2.18.0}/conan/tools/cmake/utils.py +0 -0
  291. {conan-2.17.1 → conan-2.18.0}/conan/tools/cps/__init__.py +0 -0
  292. {conan-2.17.1 → conan-2.18.0}/conan/tools/cps/cps_deps.py +0 -0
  293. {conan-2.17.1 → conan-2.18.0}/conan/tools/env/__init__.py +0 -0
  294. {conan-2.17.1 → conan-2.18.0}/conan/tools/env/environment.py +0 -0
  295. {conan-2.17.1 → conan-2.18.0}/conan/tools/env/virtualbuildenv.py +0 -0
  296. {conan-2.17.1 → conan-2.18.0}/conan/tools/env/virtualrunenv.py +0 -0
  297. {conan-2.17.1 → conan-2.18.0}/conan/tools/files/__init__.py +0 -0
  298. {conan-2.17.1 → conan-2.18.0}/conan/tools/files/conandata.py +0 -0
  299. {conan-2.17.1 → conan-2.18.0}/conan/tools/files/copy_pattern.py +0 -0
  300. {conan-2.17.1 → conan-2.18.0}/conan/tools/files/files.py +0 -0
  301. {conan-2.17.1 → conan-2.18.0}/conan/tools/files/packager.py +0 -0
  302. {conan-2.17.1 → conan-2.18.0}/conan/tools/files/patches.py +0 -0
  303. {conan-2.17.1 → conan-2.18.0}/conan/tools/files/symlinks/__init__.py +0 -0
  304. {conan-2.17.1 → conan-2.18.0}/conan/tools/files/symlinks/symlinks.py +0 -0
  305. {conan-2.17.1 → conan-2.18.0}/conan/tools/gnu/__init__.py +0 -0
  306. {conan-2.17.1 → conan-2.18.0}/conan/tools/gnu/autotools.py +0 -0
  307. {conan-2.17.1 → conan-2.18.0}/conan/tools/gnu/autotoolsdeps.py +0 -0
  308. {conan-2.17.1 → conan-2.18.0}/conan/tools/gnu/gnudeps_flags.py +0 -0
  309. {conan-2.17.1 → conan-2.18.0}/conan/tools/gnu/makedeps.py +0 -0
  310. {conan-2.17.1 → conan-2.18.0}/conan/tools/gnu/pkgconfig.py +0 -0
  311. {conan-2.17.1 → conan-2.18.0}/conan/tools/google/__init__.py +0 -0
  312. {conan-2.17.1 → conan-2.18.0}/conan/tools/google/bazel.py +0 -0
  313. {conan-2.17.1 → conan-2.18.0}/conan/tools/google/layout.py +0 -0
  314. {conan-2.17.1 → conan-2.18.0}/conan/tools/google/toolchain.py +0 -0
  315. {conan-2.17.1 → conan-2.18.0}/conan/tools/intel/__init__.py +0 -0
  316. {conan-2.17.1 → conan-2.18.0}/conan/tools/intel/intel_cc.py +0 -0
  317. {conan-2.17.1 → conan-2.18.0}/conan/tools/meson/__init__.py +0 -0
  318. {conan-2.17.1 → conan-2.18.0}/conan/tools/microsoft/__init__.py +0 -0
  319. {conan-2.17.1 → conan-2.18.0}/conan/tools/microsoft/layout.py +0 -0
  320. {conan-2.17.1 → conan-2.18.0}/conan/tools/microsoft/msbuild.py +0 -0
  321. {conan-2.17.1 → conan-2.18.0}/conan/tools/microsoft/nmakedeps.py +0 -0
  322. {conan-2.17.1 → conan-2.18.0}/conan/tools/microsoft/nmaketoolchain.py +0 -0
  323. {conan-2.17.1 → conan-2.18.0}/conan/tools/microsoft/subsystems.py +0 -0
  324. {conan-2.17.1 → conan-2.18.0}/conan/tools/microsoft/toolchain.py +0 -0
  325. {conan-2.17.1 → conan-2.18.0}/conan/tools/microsoft/visual.py +0 -0
  326. {conan-2.17.1 → conan-2.18.0}/conan/tools/qbs/__init__.py +0 -0
  327. {conan-2.17.1 → conan-2.18.0}/conan/tools/qbs/qbs.py +0 -0
  328. {conan-2.17.1 → conan-2.18.0}/conan/tools/qbs/qbsdeps.py +0 -0
  329. {conan-2.17.1 → conan-2.18.0}/conan/tools/qbs/qbsprofile.py +0 -0
  330. {conan-2.17.1 → conan-2.18.0}/conan/tools/ros/__init__.py +0 -0
  331. {conan-2.17.1 → conan-2.18.0}/conan/tools/ros/rosenv.py +0 -0
  332. {conan-2.17.1 → conan-2.18.0}/conan/tools/sbom/__init__.py +0 -0
  333. {conan-2.17.1 → conan-2.18.0}/conan/tools/sbom/spdx_licenses.py +0 -0
  334. {conan-2.17.1 → conan-2.18.0}/conan/tools/scm/__init__.py +0 -0
  335. {conan-2.17.1 → conan-2.18.0}/conan/tools/scons/__init__.py +0 -0
  336. {conan-2.17.1 → conan-2.18.0}/conan/tools/scons/sconsdeps.py +0 -0
  337. {conan-2.17.1 → conan-2.18.0}/conan/tools/system/__init__.py +0 -0
  338. {conan-2.17.1 → conan-2.18.0}/conan/tools/system/package_manager.py +0 -0
  339. {conan-2.17.1 → conan-2.18.0}/conan.egg-info/dependency_links.txt +0 -0
  340. {conan-2.17.1 → conan-2.18.0}/conan.egg-info/entry_points.txt +0 -0
  341. {conan-2.17.1 → conan-2.18.0}/conan.egg-info/requires.txt +0 -0
  342. {conan-2.17.1 → conan-2.18.0}/conan.egg-info/top_level.txt +0 -0
  343. {conan-2.17.1 → conan-2.18.0}/conans/__init__.py +0 -0
  344. {conan-2.17.1 → conan-2.18.0}/conans/conan.py +0 -0
  345. {conan-2.17.1 → conan-2.18.0}/conans/conan_server.py +0 -0
  346. {conan-2.17.1 → conan-2.18.0}/conans/migrations.py +0 -0
  347. {conan-2.17.1 → conan-2.18.0}/conans/model/__init__.py +0 -0
  348. {conan-2.17.1 → conan-2.18.0}/conans/model/package_ref.py +0 -0
  349. {conan-2.17.1 → conan-2.18.0}/conans/model/recipe_ref.py +0 -0
  350. {conan-2.17.1 → conan-2.18.0}/conans/requirements.txt +0 -0
  351. {conan-2.17.1 → conan-2.18.0}/conans/requirements_dev.txt +0 -0
  352. {conan-2.17.1 → conan-2.18.0}/conans/requirements_runner.txt +0 -0
  353. {conan-2.17.1 → conan-2.18.0}/conans/requirements_server.txt +0 -0
  354. {conan-2.17.1 → conan-2.18.0}/pyproject.toml +0 -0
  355. {conan-2.17.1 → conan-2.18.0}/setup.cfg +0 -0
  356. {conan-2.17.1 → conan-2.18.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: conan
3
- Version: 2.17.1
3
+ Version: 2.18.0
4
4
  Summary: Conan C/C++ package manager
5
5
  Home-page: https://conan.io
6
6
  Author: JFrog LTD
@@ -2,5 +2,5 @@ from conan.internal.model.conan_file import ConanFile
2
2
  from conan.internal.model.workspace import Workspace
3
3
  from conan.internal.model.version import Version
4
4
 
5
- __version__ = '2.17.1'
5
+ __version__ = '2.18.0'
6
6
  conan_version = Version(__version__)
@@ -7,6 +7,7 @@ from conan.api.subapi.cache import CacheAPI
7
7
  from conan.api.subapi.command import CommandAPI
8
8
  from conan.api.subapi.local import LocalAPI
9
9
  from conan.api.subapi.lockfile import LockfileAPI
10
+ from conan.api.subapi.report import ReportAPI
10
11
  from conan.api.subapi.workspace import WorkspaceAPI
11
12
  from conan.api.subapi.config import ConfigAPI
12
13
  from conan.api.subapi.download import DownloadAPI
@@ -72,6 +73,7 @@ class ConanAPI:
72
73
  self.audit = AuditAPI(self)
73
74
  # Now, lazy loading of editables
74
75
  self.workspace = WorkspaceAPI(self)
76
+ self.report = ReportAPI(self)
75
77
 
76
78
  _check_conan_version(self)
77
79
 
@@ -175,6 +175,12 @@ class ConanOutput:
175
175
 
176
176
  return self
177
177
 
178
+ def box(self, msg):
179
+ color = Color.BRIGHT_GREEN
180
+ self.writeln("\n**************************************************", fg=color)
181
+ self.writeln(f'*{msg: ^48}*', fg=color)
182
+ self.writeln(f"**************************************************\n", fg=color)
183
+
178
184
  def _write_message(self, msg, fg=None, bg=None, newline=True):
179
185
  if isinstance(msg, dict):
180
186
  # For traces we can receive a dict already, we try to transform then into more natural
@@ -259,6 +259,14 @@ class CacheAPI:
259
259
  download_cache = DownloadCache(download_cache_path)
260
260
  return download_cache.get_backup_sources_files(excluded_urls, package_list, only_upload)
261
261
 
262
+ def path_to_ref(self, path):
263
+ cache = PkgCache(self.conan_api.cache_folder, self.conan_api.config.global_conf)
264
+ result = cache.path_to_ref(path)
265
+ if result is None:
266
+ base, folder = os.path.split(path)
267
+ result = cache.path_to_ref(base)
268
+ return result
269
+
262
270
 
263
271
  def _resolve_latest_ref(cache, ref):
264
272
  if ref.revision is None or ref.revision == "latest":
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import shlex
2
3
 
3
4
  from conan.api.output import ConanOutput
4
5
  from conan.errors import ConanException
@@ -12,7 +13,7 @@ class CommandAPI:
12
13
 
13
14
  def run(self, cmd):
14
15
  if isinstance(cmd, str):
15
- cmd = cmd.split()
16
+ cmd = shlex.split(cmd)
16
17
  if isinstance(cmd, list):
17
18
  current_cmd = cmd[0]
18
19
  args = cmd[1:]
@@ -66,11 +66,11 @@ class ConfigAPI:
66
66
 
67
67
  # Basic checks of the package: correct package_type and no-dependencies
68
68
  deps_graph.report_graph_error()
69
- pkg = deps_graph.root.dependencies[0].dst
69
+ pkg = deps_graph.root.edges[0].dst
70
70
  ConanOutput().info(f"Configuration from package: {pkg}")
71
71
  if pkg.conanfile.package_type is not PackageType.CONF:
72
72
  raise ConanException(f'{pkg.conanfile} is not of package_type="configuration"')
73
- if pkg.dependencies:
73
+ if pkg.edges:
74
74
  raise ConanException(f"Configuration package {pkg.ref} cannot have dependencies")
75
75
 
76
76
  # The computation of the "package_id" and the download of the package is done as usual
@@ -82,7 +82,9 @@ class LocalAPI:
82
82
  with conanfile_exception_formatter(conanfile, "layout"):
83
83
  conanfile.layout()
84
84
 
85
- folder = conanfile.recipe_folder
85
+ folder = conanfile.recipe_folder if conanfile.folders.root is None else \
86
+ os.path.normpath(os.path.join(conanfile.recipe_folder, conanfile.folders.root))
87
+
86
88
  conanfile.folders.set_base_source(folder)
87
89
  conanfile.folders.set_base_export_sources(folder)
88
90
  conanfile.folders.set_base_recipe_metadata(os.path.join(folder, "metadata"))
@@ -96,6 +96,8 @@ class NewAPI:
96
96
  from conan.internal.api.new.bazel_7_exe import bazel_exe_files_7
97
97
  from conan.internal.api.new.autotools_lib import autotools_lib_files
98
98
  from conan.internal.api.new.autoools_exe import autotools_exe_files
99
+ from conan.internal.api.new.premake_lib import premake_lib_files
100
+ from conan.internal.api.new.premake_exe import premake_exe_files
99
101
  from conan.internal.api.new.local_recipes_index import local_recipes_index_files
100
102
  from conan.internal.api.new.qbs_lib import qbs_lib_files
101
103
  from conan.internal.api.new.workspace import workspace_files
@@ -114,6 +116,8 @@ class NewAPI:
114
116
  "bazel_7_exe": bazel_exe_files_7,
115
117
  "autotools_lib": autotools_lib_files,
116
118
  "autotools_exe": autotools_exe_files,
119
+ "premake_lib": premake_lib_files,
120
+ "premake_exe": premake_exe_files,
117
121
  "alias": alias_file,
118
122
  "local_recipes_index": local_recipes_index_files,
119
123
  "qbs_lib": qbs_lib_files,
@@ -64,12 +64,12 @@ class ProfilesAPI:
64
64
  cwd = os.getcwd()
65
65
  profile_build = self._get_profile(build_profiles, args.settings_build, args.options_build,
66
66
  args.conf_build, cwd, cache_settings,
67
- profile_plugin, global_conf)
67
+ profile_plugin, global_conf, context="build")
68
68
  profile_host = self._get_profile(host_profiles, args.settings_host, args.options_host, args.conf_host,
69
- cwd, cache_settings, profile_plugin, global_conf)
69
+ cwd, cache_settings, profile_plugin, global_conf, context="host")
70
70
  return profile_host, profile_build
71
71
 
72
- def get_profile(self, profiles, settings=None, options=None, conf=None, cwd=None):
72
+ def get_profile(self, profiles, settings=None, options=None, conf=None, cwd=None, context=None):
73
73
  """ Computes a Profile as the result of aggregating all the user arguments, first it
74
74
  loads the "profiles", composing them in order (last profile has priority), and
75
75
  finally adding the individual settings, options (priority over the profiles)
@@ -81,13 +81,13 @@ class ProfilesAPI:
81
81
  profile_plugin = self._load_profile_plugin()
82
82
 
83
83
  profile = self._get_profile(profiles, settings, options, conf, cwd, cache_settings,
84
- profile_plugin, global_conf)
84
+ profile_plugin, global_conf, context=context)
85
85
  return profile
86
86
 
87
87
  def _get_profile(self, profiles, settings, options, conf, cwd, cache_settings,
88
- profile_plugin, global_conf):
88
+ profile_plugin, global_conf, context):
89
89
  loader = ProfileLoader(self._conan_api.cache_folder)
90
- profile = loader.from_cli_args(profiles, settings, options, conf, cwd)
90
+ profile = loader.from_cli_args(profiles, settings, options, conf, cwd, context)
91
91
  if profile_plugin is not None:
92
92
  try:
93
93
  profile_plugin(profile)
@@ -0,0 +1,144 @@
1
+ import base64
2
+ import os
3
+ from io import StringIO
4
+
5
+ from conan.api.output import ConanOutput
6
+ from conan.errors import ConanException
7
+ from conan.api.model import RecipeReference
8
+ from conan.internal.conan_app import ConanApp
9
+ from conan.internal.errors import conanfile_exception_formatter
10
+ from conan.internal.graph.graph import CONTEXT_HOST
11
+ from conan.internal.graph.profile_node_definer import initialize_conanfile_profile
12
+ from conan.internal.source import config_source
13
+ from conan.internal.util.runners import conan_run
14
+
15
+
16
+ class ReportAPI:
17
+ def __init__(self, conan_api):
18
+ self.conan_api = conan_api
19
+
20
+ def diff(self, old_reference, new_reference, remotes, old_path=None, new_path=None, cwd=None):
21
+ """
22
+ Compare two recipes and return the differences.
23
+ :param old_reference: The reference of the old recipe.
24
+ :param new_reference: The reference of the new recipe.
25
+ :param remotes: List of remotes to search for the recipes.
26
+ :param old_path: Optional path to the old recipe's conanfile.py.
27
+ :param new_path: Optional path to the new recipe's conanfile.py.
28
+ :param cwd: Current working directory, used to resolve paths.
29
+ :return: A dictionary with the differences between the two recipes.
30
+ """
31
+
32
+ def _source(path_to_conanfile, reference):
33
+ if path_to_conanfile is None:
34
+ export_ref, cache_path = _get_ref_from_cache_or_remote(self.conan_api, reference, remotes)
35
+ else:
36
+ export_ref, cache_path = _export_recipe_from_path(self.conan_api, path_to_conanfile,
37
+ reference, remotes, cwd)
38
+ exported_path = self.conan_api.local.get_conanfile_path(cache_path, cwd, py=True)
39
+ _configure_source(self.conan_api, exported_path, export_ref, remotes)
40
+ return export_ref, cache_path
41
+
42
+
43
+ old_export_ref, old_cache_path = _source(old_path, old_reference)
44
+ new_export_ref, new_cache_path = _source(new_path, new_reference)
45
+
46
+ old_diff_path = os.path.abspath(os.path.join(old_cache_path, os.path.pardir)).replace("\\",
47
+ "/")
48
+ new_diff_path = os.path.abspath(os.path.join(new_cache_path, os.path.pardir)).replace("\\",
49
+ "/")
50
+
51
+ src_prefix = base64.b64encode(str(new_export_ref.repr_notime()).encode()).decode() + "/"
52
+ dst_prefix = base64.b64encode(str(old_export_ref.repr_notime()).encode()).decode() + "/"
53
+
54
+ command = (f'git diff --no-index --src-prefix "{src_prefix}" --dst-prefix "{dst_prefix}" '
55
+ f'"{old_diff_path}" "{new_diff_path}"')
56
+
57
+ ConanOutput().info(
58
+ f"Generating diff from {old_export_ref.repr_notime()} to {new_export_ref.repr_notime()} (this might take a while)")
59
+ ConanOutput().info(command)
60
+
61
+ stdout, stderr = StringIO(), StringIO()
62
+ conan_run(command, stdout=stdout, stderr=stderr)
63
+ diff = stdout.getvalue()
64
+
65
+ if old_path:
66
+ self.conan_api.remove.recipe(old_export_ref)
67
+ if new_path:
68
+ self.conan_api.remove.recipe(new_export_ref)
69
+
70
+ return {
71
+ "diff": diff,
72
+ "old_export_ref": old_export_ref,
73
+ "new_export_ref": new_export_ref,
74
+ "old_cache_path": old_diff_path,
75
+ "new_cache_path": new_diff_path,
76
+ "src_prefix": src_prefix,
77
+ "dst_prefix": dst_prefix,
78
+ }
79
+
80
+ def _configure_source(conan_api, conanfile_path, ref, remotes):
81
+ app = ConanApp(conan_api)
82
+ conanfile = app.loader.load_consumer(conanfile_path, name=ref.name, version=str(ref.version),
83
+ user=ref.user, channel=ref.channel, graph_lock=None,
84
+ remotes=remotes)
85
+ # This profile is empty, but with the conf from global.conf
86
+ profile = conan_api.profiles.get_profile([])
87
+ initialize_conanfile_profile(conanfile, profile, profile, CONTEXT_HOST, False)
88
+ # This is important, otherwise the ``conan source`` doesn't define layout and fails
89
+ if hasattr(conanfile, "layout"):
90
+ with conanfile_exception_formatter(conanfile, "layout"):
91
+ conanfile.layout()
92
+
93
+ recipe_layout = app.cache.recipe_layout(ref)
94
+ export_source_folder = recipe_layout.export_sources()
95
+ source_folder = recipe_layout.source()
96
+
97
+ conanfile.folders.set_base_source(source_folder)
98
+ conanfile.folders.set_base_export_sources(export_source_folder)
99
+ conanfile.folders.set_base_recipe_metadata(recipe_layout.metadata())
100
+ config_source(export_source_folder, conanfile, conan_api.config.hook_manager)
101
+
102
+ def _get_ref_from_cache_or_remote(conan_api, reference, enabled_remotes):
103
+ ref = RecipeReference.loads(reference)
104
+ full_ref, matching_remote = None, False
105
+ # The first remote is None, which means local cache for the list subapi methods
106
+ for remote in [None] + enabled_remotes:
107
+ if ref.revision:
108
+ no_rrev_ref = RecipeReference.loads(reference)
109
+ no_rrev_ref.revision = None
110
+ try:
111
+ remote_revisions = conan_api.list.recipe_revisions(no_rrev_ref, remote)
112
+ if ref in remote_revisions:
113
+ full_ref = ref
114
+ matching_remote = remote
115
+ break
116
+ except:
117
+ continue
118
+ else:
119
+ try:
120
+ latest_recipe_revision = conan_api.list.latest_recipe_revision(ref, remote)
121
+ except:
122
+ continue
123
+ if full_ref is None or (latest_recipe_revision.timestamp > full_ref.timestamp):
124
+ full_ref = latest_recipe_revision
125
+ matching_remote = remote
126
+ if full_ref is None or matching_remote is False:
127
+ raise ConanException(f"No matching reference for {reference} in remotes.\n"
128
+ "If you want to check against a local recipe, add an additional --{old,new}-path arg.\n")
129
+ if matching_remote is not None:
130
+ conan_api.download.recipe(full_ref, matching_remote)
131
+ cache_path = conan_api.cache.export_path(full_ref)
132
+ return full_ref, cache_path
133
+
134
+
135
+ def _export_recipe_from_path(conan_api, path_to_conanfile, reference, enabled_remotes, cwd=None):
136
+ path = conan_api.local.get_conanfile_path(path_to_conanfile, cwd, py=True)
137
+ ref = RecipeReference.loads(reference)
138
+ export_ref, conanfile = conan_api.export.export(path=path,
139
+ name=ref.name, version=str(ref.version),
140
+ user=ref.user, channel=ref.channel,
141
+ lockfile=None,
142
+ remotes=enabled_remotes)
143
+ cache_path = conan_api.cache.export_path(export_ref)
144
+ return export_ref, cache_path
@@ -8,8 +8,10 @@ from conan import ConanFile
8
8
  from conan.api.model import RecipeReference
9
9
  from conan.api.output import ConanOutput
10
10
  from conan.cli import make_abs_path
11
+ from conan.cli.printers.graph import print_graph_basic, print_graph_packages
11
12
  from conan.errors import ConanException
12
13
  from conan.internal.conan_app import ConanApp
14
+ from conan.internal.graph.install_graph import ProfileArgs
13
15
  from conan.internal.model.workspace import Workspace, WORKSPACE_YML, WORKSPACE_PY, WORKSPACE_FOLDER
14
16
  from conan.tools.scm import Git
15
17
  from conan.internal.graph.graph import RECIPE_EDITABLE, DepsGraph, CONTEXT_HOST, RECIPE_VIRTUAL, Node, \
@@ -74,6 +76,7 @@ class WorkspaceAPI:
74
76
  TEST_ENABLED = False
75
77
 
76
78
  def __init__(self, conan_api):
79
+ self._enabled = True
77
80
  self._conan_api = conan_api
78
81
  self._folder = _find_ws_folder()
79
82
  if self._folder:
@@ -85,6 +88,9 @@ class WorkspaceAPI:
85
88
  ConanOutput().warning(f"Workspace is a dev-only feature, exclusively for testing")
86
89
  self._ws = _load_workspace(self._folder, conan_api) # Error if not loading
87
90
 
91
+ def enable(self, value):
92
+ self._enabled = value
93
+
88
94
  @property
89
95
  def name(self):
90
96
  self._check_ws()
@@ -94,41 +100,42 @@ class WorkspaceAPI:
94
100
  """
95
101
  @return: the current workspace folder where the conanws.yml or conanws.py is located
96
102
  """
103
+ self._check_ws()
97
104
  return self._folder
98
105
 
99
- @property
100
- def editable_packages(self):
106
+ def packages(self):
101
107
  """
102
108
  @return: Returns {RecipeReference: {"path": full abs-path, "output_folder": abs-path}}
103
109
  """
104
- if not self._folder:
110
+ if not self._folder or not self._enabled:
105
111
  return
106
- editables = self._ws.packages()
107
- editables = {RecipeReference.loads(r): v.copy() for r, v in editables.items()}
108
- for v in editables.values():
109
- path = os.path.normpath(os.path.join(self._folder, v["path"], "conanfile.py"))
112
+ packages = {}
113
+ for editable_info in self._ws.packages():
114
+ rel_path = editable_info["path"]
115
+ path = os.path.normpath(os.path.join(self._folder, rel_path, "conanfile.py"))
110
116
  if not os.path.isfile(path):
111
117
  raise ConanException(f"Workspace editable not found: {path}")
112
- v["path"] = path
113
- if v.get("output_folder"):
114
- v["output_folder"] = os.path.normpath(os.path.join(self._folder,
115
- v["output_folder"]))
116
- return editables
117
-
118
- def select_editables(self, paths):
119
- filtered_refs = [self.editable_from_path(p) for p in paths or []]
120
- editables = self.editable_packages
121
- requires = [ref for ref in editables]
122
- if filtered_refs:
123
- ConanOutput().info(f"Filtering and installing only selected editable packages")
124
- requires = [ref for ref in requires if ref in filtered_refs]
125
- ConanOutput().info(f"Filtered references: {requires}")
126
- return requires
127
-
128
- @property
129
- def products(self):
130
- self._check_ws()
131
- return self._ws.products()
118
+ ref = editable_info.get("ref")
119
+ try:
120
+ if ref is None:
121
+ conanfile = self._ws.load_conanfile(rel_path)
122
+ reference = RecipeReference(name=conanfile.name, version=conanfile.version,
123
+ user=conanfile.user, channel=conanfile.channel)
124
+ else:
125
+ reference = RecipeReference.loads(ref)
126
+ reference.validate_ref(reference)
127
+ except:
128
+ raise ConanException(f"Workspace editable reference could not be deduced by"
129
+ f" {rel_path}/conanfile.py or it is not"
130
+ f" correctly defined in the conanws.yml file.")
131
+ if reference in packages:
132
+ raise ConanException(f"Workspace editable reference '{str(reference)}' already exists.")
133
+ packages[reference] = {"path": path}
134
+ if editable_info.get("output_folder"):
135
+ packages[reference]["output_folder"] = (
136
+ os.path.normpath(os.path.join(self._folder, editable_info["output_folder"]))
137
+ )
138
+ return packages
132
139
 
133
140
  def open(self, require, remotes, cwd=None):
134
141
  app = ConanApp(self._conan_api)
@@ -167,7 +174,7 @@ class WorkspaceAPI:
167
174
  f"'{WORKSPACE_PY}' or '{WORKSPACE_YML}' file")
168
175
 
169
176
  def add(self, path, name=None, version=None, user=None, channel=None, cwd=None,
170
- output_folder=None, remotes=None, product=False):
177
+ output_folder=None, remotes=None):
171
178
  """
172
179
  Add a new editable package to the current workspace (the current workspace must exist)
173
180
  @param path: The path to the folder containing the conanfile.py that defines the package
@@ -178,7 +185,6 @@ class WorkspaceAPI:
178
185
  @param cwd:
179
186
  @param output_folder:
180
187
  @param remotes:
181
- @param product:
182
188
  @return: The reference of the added package
183
189
  """
184
190
  self._check_ws()
@@ -191,7 +197,7 @@ class WorkspaceAPI:
191
197
  ref.validate_ref()
192
198
  output_folder = make_abs_path(output_folder) if output_folder else None
193
199
  # Check the conanfile is there, and name/version matches
194
- self._ws.add(ref, full_path, output_folder, product)
200
+ self._ws.add(ref, full_path, output_folder)
195
201
  return ref
196
202
 
197
203
  @staticmethod
@@ -230,17 +236,10 @@ class WorkspaceAPI:
230
236
  self._check_ws()
231
237
  return {"name": self.name,
232
238
  "folder": self._folder,
233
- "products": self.products,
234
239
  "packages": self._ws.packages()}
235
240
 
236
- def editable_from_path(self, path):
237
- editables = self._ws.packages()
238
- for ref, info in editables.items():
239
- if info["path"].replace("\\", "/") == path:
240
- return RecipeReference.loads(ref)
241
-
242
- def collapse_editables(self, deps_graph, profile_host, profile_build):
243
- ConanOutput().title("Collapsing workspace editables")
241
+ def super_build_graph(self, deps_graph, profile_host, profile_build):
242
+ ConanOutput().title("Collapsing workspace packages")
244
243
 
245
244
  root_class = self._ws.root_conanfile()
246
245
  if root_class is not None:
@@ -282,3 +281,56 @@ class WorkspaceAPI:
282
281
  result.add_edge(root, t.node, r)
283
282
 
284
283
  return result
284
+
285
+ def export(self, lockfile=None, remotes=None):
286
+ self._check_ws()
287
+ exported = []
288
+ for ref, info in self.packages().items():
289
+ exported_ref = self._conan_api.export.export(info["path"], ref.name, str(ref.version),
290
+ ref.user, ref.channel,
291
+ lockfile=lockfile, remotes=remotes)
292
+ ref, _ = exported_ref
293
+ exported.append(ref)
294
+ return exported
295
+
296
+
297
+ def select_packages(self, packages):
298
+ self._check_ws()
299
+ editable = self.packages()
300
+ packages = packages or []
301
+ selected_editables = {}
302
+ for ref, info in editable.items():
303
+ if packages and not any(ref.matches(p, False) for p in packages):
304
+ continue
305
+ selected_editables[ref] = info
306
+ if not selected_editables:
307
+ raise ConanException("There are no selected packages defined in the workspace")
308
+
309
+ return selected_editables
310
+
311
+ def build_order(self, packages, profile_host, profile_build, build_mode, lockfile, remotes,
312
+ profile_args, update=False):
313
+ ConanOutput().title(f"Computing dependency graph for each package")
314
+ conan_api = self._conan_api
315
+ from conan.internal.graph.install_graph import InstallGraph
316
+ install_order = InstallGraph(None)
317
+
318
+ for ref, info in packages.items():
319
+ ConanOutput().title(f"Computing the dependency graph for package: {ref}")
320
+
321
+ deps_graph = conan_api.graph.load_graph_requires([ref], None,
322
+ profile_host, profile_build, lockfile,
323
+ remotes, update)
324
+ deps_graph.report_graph_error()
325
+ print_graph_basic(deps_graph)
326
+ conan_api.graph.analyze_binaries(deps_graph, build_mode, remotes=remotes, update=update,
327
+ lockfile=lockfile)
328
+ print_graph_packages(deps_graph)
329
+
330
+ ConanOutput().success(f"\nAggregating build-order for package: {ref}")
331
+ install_graph = InstallGraph(deps_graph, order_by="recipe",
332
+ profile_args=ProfileArgs.from_args(profile_args))
333
+ install_graph.raise_errors()
334
+ install_order.merge(install_graph)
335
+
336
+ return install_order
@@ -1,4 +1,5 @@
1
1
  import argparse
2
+ import os
2
3
  import textwrap
3
4
  from contextlib import redirect_stdout
4
5
 
@@ -96,6 +97,8 @@ class BaseConanCommand:
96
97
  formatarg, ", ".join(self._help_formatters)))
97
98
 
98
99
  if out_file:
100
+ if os.path.dirname(out_file):
101
+ os.makedirs(os.path.dirname(out_file), exist_ok=True)
99
102
  with open(out_file, 'w') as f:
100
103
  with redirect_stdout(f):
101
104
  formatter(info)
@@ -3,7 +3,7 @@ import os
3
3
 
4
4
  from conan.api.conan_api import ConanAPI
5
5
  from conan.api.input import UserInput
6
- from conan.api.model import MultiPackagesList
6
+ from conan.api.model import MultiPackagesList, RecipeReference
7
7
  from conan.api.output import cli_out_write, ConanOutput
8
8
  from conan.api.subapi.audit import CONAN_CENTER_AUDIT_PROVIDER_NAME
9
9
  from conan.cli import make_abs_path
@@ -14,6 +14,7 @@ from conan.cli.formatters.audit.vulnerabilities import text_vuln_formatter, json
14
14
  from conan.cli.printers import print_profiles
15
15
  from conan.cli.printers.graph import print_graph_basic
16
16
  from conan.errors import ConanException
17
+ from conan.internal.util.files import load
17
18
 
18
19
 
19
20
  def _add_provider_arg(subparser):
@@ -108,18 +109,15 @@ def audit_list(conan_api: ConanAPI, parser, subparser, *args):
108
109
  """
109
110
  List the vulnerabilities of the given reference.
110
111
  """
111
- subparser.add_argument("reference", help="Reference to list vulnerabilities for", nargs="?")
112
- subparser.add_argument("-l", "--list", help="pkglist file to list vulnerabilities for")
112
+ input_group = subparser.add_mutually_exclusive_group(required=True)
113
+ input_group.add_argument("reference", help="Reference to list vulnerabilities for", nargs="?")
114
+ input_group.add_argument("-l", "--list", help="pkglist file to list vulnerabilities for")
115
+ input_group.add_argument("-s", "--sbom", help="sbom file to list vulnerabilities for")
116
+ input_group.add_argument("-lock", "--lockfile", help="lockfile file to list vulnerabilities for")
113
117
  subparser.add_argument("-r", "--remote", help="Remote to use for listing")
114
118
  _add_provider_arg(subparser)
115
119
  args = parser.parse_args(*args)
116
120
 
117
- if not args.reference and not args.list:
118
- raise ConanException("Please specify a reference or a pkglist file")
119
-
120
- if args.reference and args.list:
121
- raise ConanException("Please specify a reference or a pkglist file, not both")
122
-
123
121
  provider = conan_api.audit.get_provider(args.provider or CONAN_CENTER_AUDIT_PROVIDER_NAME)
124
122
 
125
123
  if args.list:
@@ -130,7 +128,19 @@ def audit_list(conan_api: ConanAPI, parser, subparser, *args):
130
128
  refs_to_list = package_list.serialize()
131
129
  references = list(refs_to_list.keys())
132
130
  if not references: # the package list might contain only refs, no revs
133
- ConanOutput().warning("Nothing to list, package list do not contain recipe revisions")
131
+ ConanOutput().warning("Nothing to list, package list does not contain recipe revisions")
132
+ elif args.sbom:
133
+ sbom_file = make_abs_path(args.sbom)
134
+ sbom = json.loads(load(sbom_file))
135
+ if sbom.get("bomFormat") != "CycloneDX":
136
+ raise ConanException(f"Unsupported SBOM format, only CycloneDX is supported.")
137
+ purls = [component["purl"] for component in sbom["components"]]
138
+ references = [purl.split("pkg:conan/")[1].replace("@", "/") for purl in purls]
139
+ elif args.lockfile:
140
+ lock_file = make_abs_path(args.lockfile)
141
+ lockfile = conan_api.lockfile.get_lockfile(lock_file).serialize()
142
+ references = [str(RecipeReference.loads(ref[0] if isinstance(ref, tuple) else ref))
143
+ for ref in lockfile["requires"]]
134
144
  else:
135
145
  references = [args.reference]
136
146
  return conan_api.audit.list(references, provider)
@@ -64,6 +64,19 @@ def cache_path(conan_api: ConanAPI, parser, subparser, *args):
64
64
  return path
65
65
 
66
66
 
67
+ @conan_subcommand(formatters={"text": cli_out_write})
68
+ def cache_ref(conan_api: ConanAPI, parser, subparser, *args):
69
+ """
70
+ Show the reference for a given Conan cache folder
71
+ """
72
+ subparser.add_argument("path", help="Path to a Conan cache folder")
73
+ args = parser.parse_args(*args)
74
+ ref = conan_api.cache.path_to_ref(args.path)
75
+ if ref is None:
76
+ raise ConanException("Reference for this path not found in cache")
77
+ return ref.repr_notime()
78
+
79
+
67
80
  @conan_subcommand()
68
81
  def cache_clean(conan_api: ConanAPI, parser, subparser, *args):
69
82
  """
@@ -187,5 +200,6 @@ def cache_backup_upload(conan_api: ConanAPI, parser, subparser, *args):
187
200
  """
188
201
  Upload all the source backups present in the cache
189
202
  """
203
+ args = parser.parse_args(*args)
190
204
  files = conan_api.cache.get_backup_sources()
191
205
  conan_api.upload.upload_backup_sources(files)
@@ -107,8 +107,8 @@ def create(conan_api, parser, *args):
107
107
  if args.test_folder is None else args.test_folder
108
108
  test_conanfile_path = _get_test_conanfile_path(test_package_folder, path)
109
109
  # If the user provide --test-missing and the binary was not built from source, skip test_package
110
- if args.test_missing and deps_graph.root.dependencies\
111
- and deps_graph.root.dependencies[0].dst.binary != "Build":
110
+ if args.test_missing and deps_graph.root.edges\
111
+ and deps_graph.root.edges[0].dst.binary != "Build":
112
112
  test_conanfile_path = None # disable it
113
113
 
114
114
  if test_conanfile_path:
@@ -77,5 +77,6 @@ def editable_list(conan_api, parser, subparser, *args):
77
77
  """
78
78
  List all the packages in editable mode.
79
79
  """
80
+ parser.parse_args(*args)
80
81
  editables = conan_api.local.editable_list()
81
82
  return editables
@@ -59,7 +59,7 @@ def export_pkg(conan_api, parser, *args):
59
59
 
60
60
  # TODO: Maybe we want to be able to export-pkg it as --build-require
61
61
  deps_graph = conan_api.graph.load_graph_consumer(path,
62
- ref.name, ref.version, ref.user, ref.channel,
62
+ ref.name, str(ref.version), ref.user, ref.channel,
63
63
  profile_host=profile_host,
64
64
  profile_build=profile_build,
65
65
  lockfile=lockfile, remotes=remotes, update=None,
@@ -103,6 +103,7 @@ def profile_list(conan_api, parser, subparser, *args): # noqa
103
103
  """
104
104
  List all profiles in the cache.
105
105
  """
106
+ parser.parse_args(*args)
106
107
  result = conan_api.profiles.list()
107
108
  return result
108
109
 
@@ -170,6 +170,7 @@ def remote_list_users(conan_api, parser, subparser, *args): # noqa
170
170
  """
171
171
  List the users logged into all the remotes.
172
172
  """
173
+ parser.parse_args(*args)
173
174
  remotes = conan_api.remotes.list()
174
175
  ret = OrderedDict()
175
176
  if not remotes: