)]}'
{
  "commit": "6ffb04e299d483222ebb5bb940d13c25b51cdb5e",
  "tree": "7cbfee80681ac3f8c307c825421bfb13cb332b97",
  "parents": [
    "27450f94c6c7fb088674392cf72a60c217082633"
  ],
  "author": {
    "name": "Zhongpeng Lin",
    "email": "zplin@uber.com",
    "time": "Wed Dec 13 05:47:22 2023 -0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Dec 13 13:47:22 2023 +0000"
  },
  "message": "feat: Creating one py_binary per main module (#1584)\n\nMany existing Python repos don\u0027t use `__main__.py` to indicate the the\nmain module. Instead, they put something like below in any Python files:\n\n```python\nif __name__ \u003d\u003d \"__main__\":\n  main()\n```\n\nThis PR makes the Gazelle extension able to recognize main modules like\nthis, when `__main__.py` doesn\u0027t exist. This reduces the need to create\n`__main__.py` when enabling Gazelle extensions in existing Python repos.\n\nThe current behavior of creating single `py_binary` for `__main__.py` is\npreserved and takes precedence. So this is a backward-compatible change.\n\nCloses #1566.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6a4fdb8c4fc09f9713a2f226a15f12757fd04228",
      "old_mode": 33188,
      "old_path": "examples/bzlmod/BUILD.bazel",
      "new_id": "bb16f98a6f6aaccc234ae2fbc178dd2cecd5d181",
      "new_mode": 33188,
      "new_path": "examples/bzlmod/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "1d9460c3472032aba25472bcfef5a327785eb846",
      "old_mode": 33188,
      "old_path": "gazelle/python/BUILD.bazel",
      "new_id": "fd051ebda60237359ebf36127ff691c2e01a0355",
      "new_mode": 33188,
      "new_path": "gazelle/python/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "18bc1ca37f0bc86ade03815bf6d4bdd5c57ebc65",
      "old_mode": 33188,
      "old_path": "gazelle/python/__main__.py",
      "new_id": "9974c66d13fc26173cdf42d526ef34bf003b9620",
      "new_mode": 33188,
      "new_path": "gazelle/python/__main__.py"
    },
    {
      "type": "modify",
      "old_id": "25fb1943706d9dfc8ad5f45d1979aee66e76c61b",
      "old_mode": 33188,
      "old_path": "gazelle/python/generate.go",
      "new_id": "f812f17a63c10ba9b4ecd24f13ef5f0ec03790e6",
      "new_mode": 33188,
      "new_path": "gazelle/python/generate.go"
    },
    {
      "type": "modify",
      "old_id": "6c0ef69598526fbcba0a7860e443617765b2524f",
      "old_mode": 33188,
      "old_path": "gazelle/python/parse.py",
      "new_id": "daa6d2b47ceca7e9ff88bddae9772f1e62f8392a",
      "new_mode": 33188,
      "new_path": "gazelle/python/parse.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "3ebded44b3fd6249e946ee1f6efc36fb93ccf37c",
      "new_mode": 33188,
      "new_path": "gazelle/python/parse_test.py"
    },
    {
      "type": "modify",
      "old_id": "89310267c3f1164dc68e8907c5fd975a1794518e",
      "old_mode": 33188,
      "old_path": "gazelle/python/parser.go",
      "new_id": "d22850b6a95a73553f8b75dc28c2e436ffb60b0f",
      "new_mode": 33188,
      "new_path": "gazelle/python/parser.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7aace6794f7f5f8225ed94e1f0406de31af17557",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/binary_without_entrypoint/BUILD.in"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c88f2ff11ecd35d6d4cbf439bf3f067067987d78",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/binary_without_entrypoint/BUILD.out"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e91250d0ac135baa538da1e14ef692f5977a3195",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/binary_without_entrypoint/README.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "faff6af87ac0ef60c3f9dacae80ca00b08118b58",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/binary_without_entrypoint/WORKSPACE"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "730755995d03c9da12287a7fcb7bc4c6bfdf1070",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/binary_without_entrypoint/__init__.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "3668fcc4455ea42edcf48a1facfb530792c6e88f",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/binary_without_entrypoint/collided_main.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "3668fcc4455ea42edcf48a1facfb530792c6e88f",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/binary_without_entrypoint/main.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "84e642a0298092f91c81d1d221e7f9874b644371",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/binary_without_entrypoint/main2.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "505a7663195fe6ca468225ba2041790e81faef4f",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/binary_without_entrypoint/main_test.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "44e4ae83644ddee1123d398c7d2291dd5c53e4aa",
      "new_mode": 33188,
      "new_path": "gazelle/python/testdata/binary_without_entrypoint/test.yaml"
    }
  ]
}
