)]}'
{
  "commit": "4725d98a3a53ebf90c45d29245691fa060f9c734",
  "tree": "44e6d11e286da8d43d48905663b293df59aa1388",
  "parents": [
    "69abe80724c8ef353fec3d59e578e949dad540a0"
  ],
  "author": {
    "name": "Reid D McKenzie",
    "email": "me@arrdem.com",
    "time": "Tue Nov 28 11:03:01 2023 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Nov 28 18:03:01 2023 +0000"
  },
  "message": "feat(pip_repository): Support pip parse cycles (#1166)\n\nThis patch reworks the `pip_repository` machinery to allow users to\nmanually annotate groups of libraries which form packaging cycles in\nPyPi and must be simultaneously installed.\n\nThe strategy here is to transform any dependencies `A` and `B` which\nhave dependencies and are mutually dependent\n\n```mermaid\ngraph LR;\n    A--\u003eB;\n    A--\u003eD;\n    A--\u003eE;\n    B--\u003eA;\n    B--\u003eF;\n    B--\u003eG;\n```\n\ninto a new \"dependency group\" `C` which has `A*` and `B*` as\ndependencies, defined as `A` and `B` less any direct dependencies which\nare members of the group. This is viable _for python_ because Python\nfiles just need to be emplaced into a runfiles directory for the\ninterpreter. We don\u0027t actually have a true hard dependency between the\nbuild definition of `A` requiring the build product `B` be available\nwhich requires that the build product of `A` be available.\n\n```mermaid\ngraph LR\n     C--\u003eA*;\n     A*--\u003eD;\n     A*--\u003eE;\n     C--\u003eB*;\n     B*--\u003eF;\n     B*--\u003eG;\n```\nThis gets us most of the way there, as a user can now safely write\n`requirement(\"A\")` and we can provide them with `C`, which has the\ndesired effect of pulling in `A`, `B` and their respective transitives.\n\nThere is one remaining problem - a user writing `deps \u003d\n[requirement(\"A\"), requirement(\"B\")]` will take a double direct\ndependency on `C`. So we need to insert a layer of indirection,\ngenerating `C_A` and `C_B` which serve only as unique aliases for `C` so\nthat we can support the double dependency. Our final dependency graph\nthen is as follows\n\n```mermaid\ngraph LR\n     C_A--\u003eC;\n     C_B--\u003eC;\n     C--\u003eA*;\n     A*--\u003eD;\n     A*--\u003eE;\n     C--\u003eB*;\n     B*--\u003eF;\n     B*--\u003eG;\n```\n\nAddresses #1076, #1188\n\n## To do\n- [x] Get rebased\n- [x] Get re-validated manually\n- [x] Buildifier\n- [x] Get CI happy\n- [x] Update documentation\n- [x] Update changelog\n\n---------\n\nCo-authored-by: Ignas Anikevicius \u003c240938+aignas@users.noreply.github.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7820b89f68ac358714a2d742bbf5def16bc05268",
      "old_mode": 33188,
      "old_path": "CHANGELOG.md",
      "new_id": "96b86707d841ab887a3ea232c9803eae1d3f0219",
      "new_mode": 33188,
      "new_path": "CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "ee19fbe90c68744b0d5c1cbab4823c948fe2aa2c",
      "old_mode": 33188,
      "old_path": "docs/sphinx/pypi-dependencies.md",
      "new_id": "9838f29deb0ede8c5fb902936670106308f3556c",
      "new_mode": 33188,
      "new_path": "docs/sphinx/pypi-dependencies.md"
    },
    {
      "type": "modify",
      "old_id": "7b9766eb1a17a5fc3cedabc284867da8bc04173c",
      "old_mode": 33188,
      "old_path": "examples/build_file_generation/BUILD.bazel",
      "new_id": "4d270dd850e81522f850ba66859cdb950695bf4d",
      "new_mode": 33188,
      "new_path": "examples/build_file_generation/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "c656d5b35201e3af33cde8e81da7b06229df307d",
      "old_mode": 33188,
      "old_path": "examples/build_file_generation/WORKSPACE",
      "new_id": "e283260ea24df74a7af6bbb0708ad69e1680a218",
      "new_mode": 33188,
      "new_path": "examples/build_file_generation/WORKSPACE"
    },
    {
      "type": "modify",
      "old_id": "add73dafcc2ab76f45967e8ebc04a013c7b27585",
      "old_mode": 33188,
      "old_path": "examples/build_file_generation/__init__.py",
      "new_id": "37dea1b0deb858df5b40166387f588d8dbc8c604",
      "new_mode": 33188,
      "new_path": "examples/build_file_generation/__init__.py"
    },
    {
      "type": "modify",
      "old_id": "b3757a3126843196571f4aa3f56bd821ed3c4f71",
      "old_mode": 33188,
      "old_path": "examples/build_file_generation/gazelle_python.yaml",
      "new_id": "6761b8dacf318121b5ebc20e681d134058e3b067",
      "new_mode": 33188,
      "new_path": "examples/build_file_generation/gazelle_python.yaml"
    },
    {
      "type": "modify",
      "old_id": "7e1060246fd6746a14204539a72e199a25469a05",
      "old_mode": 33188,
      "old_path": "examples/build_file_generation/requirements.in",
      "new_id": "d1380fa948efaa29b70579db1d705bc5d3a11a3f",
      "new_mode": 33188,
      "new_path": "examples/build_file_generation/requirements.in"
    },
    {
      "type": "modify",
      "old_id": "443db71ddc0c9155dda97ac26bda5ef95c6df09d",
      "old_mode": 33188,
      "old_path": "examples/build_file_generation/requirements_lock.txt",
      "new_id": "995a56a28eaeb95de862e543cfa5f647d859c7f9",
      "new_mode": 33188,
      "new_path": "examples/build_file_generation/requirements_lock.txt"
    },
    {
      "type": "modify",
      "old_id": "bdd536fdcf61e94522710acd0d3a2ed51c7838a2",
      "old_mode": 33188,
      "old_path": "examples/build_file_generation/requirements_windows.txt",
      "new_id": "19709690eab7d45e864ff8ff3d491dcb60f31454",
      "new_mode": 33188,
      "new_path": "examples/build_file_generation/requirements_windows.txt"
    },
    {
      "type": "modify",
      "old_id": "5e2509af28ee2230d6dfbaa42bee7fafd3a720a9",
      "old_mode": 33188,
      "old_path": "examples/bzlmod/BUILD.bazel",
      "new_id": "6a4fdb8c4fc09f9713a2f226a15f12757fd04228",
      "new_mode": 33188,
      "new_path": "examples/bzlmod/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "5824280ed1d33c13d2c5798ab14ede5dd118f3ed",
      "old_mode": 33188,
      "old_path": "examples/bzlmod/MODULE.bazel",
      "new_id": "44d686e3dc676fca463b42632f8bca4e2d49c708",
      "new_mode": 33188,
      "new_path": "examples/bzlmod/MODULE.bazel"
    },
    {
      "type": "modify",
      "old_id": "646c6e890f8e67b4496c1aa200acf2fe5fe400ef",
      "old_mode": 33188,
      "old_path": "examples/bzlmod/lib.py",
      "new_id": "5f0167f4e7a4dc3535388c55717873ee2edfd733",
      "new_mode": 33188,
      "new_path": "examples/bzlmod/lib.py"
    },
    {
      "type": "modify",
      "old_id": "702e15103de0bd6e0b82c5ecf81a4d4d0b9335d2",
      "old_mode": 33188,
      "old_path": "examples/bzlmod/requirements.in",
      "new_id": "ed177755abf584d6d1161b7b54877919e5d14271",
      "new_mode": 33188,
      "new_path": "examples/bzlmod/requirements.in"
    },
    {
      "type": "modify",
      "old_id": "c9e659ea2e58ad0eeaa8fc7a5c8fb560b2f5966f",
      "old_mode": 33188,
      "old_path": "examples/bzlmod/requirements_lock_3_10.txt",
      "new_id": "a10d02e58987ca2d9dcacfd832b336d114ddbfef",
      "new_mode": 33188,
      "new_path": "examples/bzlmod/requirements_lock_3_10.txt"
    },
    {
      "type": "modify",
      "old_id": "c63555d0abc85317dd75fe4e9c4bd3918ac7620b",
      "old_mode": 33188,
      "old_path": "examples/bzlmod/requirements_lock_3_9.txt",
      "new_id": "6fb57e11caf1788b9d0e2f60979334fe945a3840",
      "new_mode": 33188,
      "new_path": "examples/bzlmod/requirements_lock_3_9.txt"
    },
    {
      "type": "modify",
      "old_id": "11592479a0daf902267571c021bcb9fc7e70261d",
      "old_mode": 33188,
      "old_path": "examples/bzlmod/requirements_windows_3_10.txt",
      "new_id": "60d4980ed7d3301b45d5a0ac5419d578709c9d7b",
      "new_mode": 33188,
      "new_path": "examples/bzlmod/requirements_windows_3_10.txt"
    },
    {
      "type": "modify",
      "old_id": "e990003bc85c605deb3826930f6218b5ae9e49e1",
      "old_mode": 33188,
      "old_path": "examples/bzlmod/requirements_windows_3_9.txt",
      "new_id": "4d5c31e46e1d2034002993b5539a99a38314d668",
      "new_mode": 33188,
      "new_path": "examples/bzlmod/requirements_windows_3_9.txt"
    },
    {
      "type": "modify",
      "old_id": "c2cc9a3276627f9b6e9be65502556189df1a34d9",
      "old_mode": 33188,
      "old_path": "examples/pip_parse/BUILD.bazel",
      "new_id": "367a795728390f3a2eaaeef70e31a1308acec7dd",
      "new_mode": 33188,
      "new_path": "examples/pip_parse/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "79aca14b8cf5bd2431fec0548d93f02a51a4a4dd",
      "old_mode": 33188,
      "old_path": "examples/pip_parse/WORKSPACE",
      "new_id": "415d064ed669ea5a44f05f4942d8c5ead9dc9f62",
      "new_mode": 33188,
      "new_path": "examples/pip_parse/WORKSPACE"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "26c0f857a1343ac322296a1095a5cfaea1af167b",
      "new_mode": 33188,
      "new_path": "examples/pip_parse/report.txt"
    },
    {
      "type": "modify",
      "old_id": "279dd6068e9fa9ca18e5c78f8c72c8d9222a0031",
      "old_mode": 33188,
      "old_path": "examples/pip_parse/requirements.in",
      "new_id": "9d9e766d21f0010f297d7dbb40c37b1fe9a49e21",
      "new_mode": 33188,
      "new_path": "examples/pip_parse/requirements.in"
    },
    {
      "type": "modify",
      "old_id": "7f993769e9535f02267d80130599db42d24d8061",
      "old_mode": 33188,
      "old_path": "examples/pip_parse/requirements_lock.txt",
      "new_id": "b0eedf3697a4bfbbf0c51b72bfa70ce3c53a00c3",
      "new_mode": 33188,
      "new_path": "examples/pip_parse/requirements_lock.txt"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "18ab80f1e0c26d22bd575152d35d6a51c0ed323b",
      "new_mode": 33188,
      "new_path": "examples/pip_parse/requirements_windows.txt"
    },
    {
      "type": "modify",
      "old_id": "21a255631902893a6bb1ec1d416a0ab400d84c05",
      "old_mode": 33188,
      "old_path": "examples/pip_parse_vendored/requirements.bzl",
      "new_id": "adbee66cafdceb392a19795120ae28a8f44085ed",
      "new_mode": 33188,
      "new_path": "examples/pip_parse_vendored/requirements.bzl"
    },
    {
      "type": "modify",
      "old_id": "54fc8add808b388d51f15df321aa6e51aaadbcf3",
      "old_mode": 33188,
      "old_path": "gazelle/modules_mapping/def.bzl",
      "new_id": "4da626749330ec4be90e779766659a5589051abe",
      "new_mode": 33188,
      "new_path": "gazelle/modules_mapping/def.bzl"
    },
    {
      "type": "modify",
      "old_id": "c39ca6a2444cbd2c2ca90f1a7d0469e4ce9df3fb",
      "old_mode": 33188,
      "old_path": "python/pip_install/BUILD.bazel",
      "new_id": "d6d2b3cb0bd65bd03df52cf13c16fdea46a05af0",
      "new_mode": 33188,
      "new_path": "python/pip_install/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "07ca3c22f5dfe5e404c3b20fa64752f20632a326",
      "old_mode": 33188,
      "old_path": "python/pip_install/pip_repository.bzl",
      "new_id": "f7c46561776e76f72fa415a39ac87e178026120a",
      "new_mode": 33188,
      "new_path": "python/pip_install/pip_repository.bzl"
    },
    {
      "type": "modify",
      "old_id": "7a9e54c5012e9e6710521caa6cb5920e3f2caf2a",
      "old_mode": 33188,
      "old_path": "python/pip_install/pip_repository_requirements.bzl.tmpl",
      "new_id": "2b88f5c41ac3e841c12dfb51e1a8835887cc079d",
      "new_mode": 33188,
      "new_path": "python/pip_install/pip_repository_requirements.bzl.tmpl"
    },
    {
      "type": "modify",
      "old_id": "2cc4cbd70dd33f872c077862b0e1584a076b1f8a",
      "old_mode": 33188,
      "old_path": "python/pip_install/private/BUILD.bazel",
      "new_id": "887d2d34687b5e78ba18f1d29eabd0b1a6567fb1",
      "new_mode": 33188,
      "new_path": "python/pip_install/private/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c122b04781e9bb3cbc003ace15b709620661ef70",
      "new_mode": 33188,
      "new_path": "python/pip_install/private/generate_group_library_build_bazel.bzl"
    },
    {
      "type": "modify",
      "old_id": "f0f5242161a5b3405be994a87288ecbb03e85c14",
      "old_mode": 33188,
      "old_path": "python/pip_install/private/generate_whl_library_build_bazel.bzl",
      "new_id": "6d0f167f02418bea11582a9737b00949287db69d",
      "new_mode": 33188,
      "new_path": "python/pip_install/private/generate_whl_library_build_bazel.bzl"
    },
    {
      "type": "modify",
      "old_id": "04c7af6da899883bdfc72aa77fdd578f7fe8cd4b",
      "old_mode": 33188,
      "old_path": "python/private/BUILD.bazel",
      "new_id": "4f472064493dc8dbe3d9dab998549e02fef536c1",
      "new_mode": 33188,
      "new_path": "python/private/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "166f2134bae299e7b4562bf10a14c551516e0e1f",
      "old_mode": 33188,
      "old_path": "python/private/bzlmod/pip.bzl",
      "new_id": "305039fb2eeeca6a98fe78f3ded91d33a854bf31",
      "new_mode": 33188,
      "new_path": "python/private/bzlmod/pip.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "73df07b2d262bc9ac7270575f5df6b81e242024a",
      "new_mode": 33188,
      "new_path": "python/private/labels.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5a27e112dbdb1203d6ff946b9c00576e23ea07d7",
      "new_mode": 33188,
      "new_path": "tests/pip_install/group_library/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e7d6b44d3ffffbc6397a59f1451e290613f5aa3d",
      "new_mode": 33188,
      "new_path": "tests/pip_install/group_library/generate_build_bazel_tests.bzl"
    },
    {
      "type": "modify",
      "old_id": "b6af0c718287986dcb6e426950f787962ae85793",
      "old_mode": 33188,
      "old_path": "tests/pip_install/whl_library/generate_build_bazel_tests.bzl",
      "new_id": "c65beb54ae8209d67ac34276655043dc82892fe2",
      "new_mode": 33188,
      "new_path": "tests/pip_install/whl_library/generate_build_bazel_tests.bzl"
    }
  ]
}
