)]}'
{
  "commit": "519574ca7fb9892524d86b6acaac5b550a7b6df5",
  "tree": "377553b0b3650bb44743da4703be148b36e90bcf",
  "parents": [
    "905af697d68e4a87d037a721b385f4d26f8ba848"
  ],
  "author": {
    "name": "Ignas Anikevicius",
    "email": "240938+aignas@users.noreply.github.com",
    "time": "Thu Aug 15 22:11:50 2024 +0300"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Aug 15 19:11:50 2024 +0000"
  },
  "message": "feat(pypi): support env markers in requirements files (#2059)\n\nBefore this change the `all_requirements` and related constants will\nhave\npackages that need to be installed only on specific platforms and will\nmean\nthat users relying on those constants (e.g. `gazelle`) will need to do\nextra\nwork to exclude platform-specific packages. The package managers that\nthat\nsupport outputting such files now include `uv` and `pdm`. This might be\nalso\nuseful in cases where we attempt to handle non-requirements lock files.\n\nNote, that the best way to handle this would be to move all of the\nrequirements\nparsing code to Python, but that may cause regressions as it is a much\nbigger\nchange. This is only changing the code so that we are doing extra\nprocessing\nfor the requirement lines that have env markers. The lines that have no\nmarkers\nwill not see any change in the code execution paths and the python\ninterpreter\nwill not be downloaded.\n\nWe also use the `*_ctx.watch` API where available to correctly\nre-evaluate the\nmarkers if the `packaging` Python sources for this change.\n\nExtra changes that are included in this PR:\n- Extend the `repo_utils` to have a method for `arch` getting from the\n`ctx`.\n- Change the `local_runtime_repo` to perform the validation not relying\non the\n  implementation detail of the `get_platforms_os_name`.\n- Add `$(UV)` make variable for the `uv:current_toolchain` so that we\ncan\n  generate the requirements for `sphinx` using `uv`.\n- Swap the requirement generation using `genrule` and `uv` for `sphinx`\nand co\nso that we can test the `requirement` marker code. Note, the\n`requirement`\n  markers are not working well with the `requirement_cycles`.\n\nFixes #1105.\nFixes #1868.\nWork towards #260, #1975.\nRelated #1663.\n\n---------\n\nCo-authored-by: Richard Levasseur \u003crlevasseur@google.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1ca469cd75584b0f2ebf438dba46f3cf23df84f1",
      "old_mode": 33188,
      "old_path": ".bazelrc",
      "new_id": "b484751c3c235dde37996bb354050527b192a468",
      "new_mode": 33188,
      "new_path": ".bazelrc"
    },
    {
      "type": "modify",
      "old_id": "c87e76e5beca695797f1e719336574f88b60b83f",
      "old_mode": 33188,
      "old_path": "CHANGELOG.md",
      "new_id": "118af045c25ac0d5453d37a32a2ed2ffbd8bf384",
      "new_mode": 33188,
      "new_path": "CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "457d8cc0fa0b452ecd0feab69d704d18494dd824",
      "old_mode": 33188,
      "old_path": "MODULE.bazel",
      "new_id": "c4d0e5f48dd028d6991cff91c875311989f06efd",
      "new_mode": 33188,
      "new_path": "MODULE.bazel"
    },
    {
      "type": "modify",
      "old_id": "6c1ab4f9afc2fe16b9e7e605e4ad07a05069f992",
      "old_mode": 33188,
      "old_path": "WORKSPACE",
      "new_id": "695b0e94e96b6b7bbe85afb2d0de47c4d1dc9e02",
      "new_mode": 33188,
      "new_path": "WORKSPACE"
    },
    {
      "type": "modify",
      "old_id": "b582606ab66318c86dd1a3efdde27df8bc6daa0c",
      "old_mode": 33188,
      "old_path": "docs/sphinx/BUILD.bazel",
      "new_id": "947ebbae1555cbdfd396af3b513804d8de5a5f0c",
      "new_mode": 33188,
      "new_path": "docs/sphinx/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "23c2dd5d2c3404556c884e54830ab2f0c93ccf0e",
      "old_mode": 33188,
      "old_path": "docs/sphinx/requirements.txt",
      "new_id": "e0d3bba4ffb7676fd8bb59c489260f447bed5082",
      "new_mode": 33188,
      "new_path": "docs/sphinx/requirements.txt"
    },
    {
      "type": "modify",
      "old_id": "f444287a859da4a6ed97f2b6310eb9b1aac10f60",
      "old_mode": 33188,
      "old_path": "python/private/pypi/BUILD.bazel",
      "new_id": "3b11dbe7f81a272fa55783eed0a962573b156146",
      "new_mode": 33188,
      "new_path": "python/private/pypi/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c805fd7a59d6b3c8da48ae17a61634e12d24ca47",
      "new_mode": 33188,
      "new_path": "python/private/pypi/evaluate_markers.bzl"
    },
    {
      "type": "modify",
      "old_id": "82e580d3a2f938e618715dc121b0739923326d54",
      "old_mode": 33188,
      "old_path": "python/private/pypi/extension.bzl",
      "new_id": "1bc8f151493c461db573b31403f89b93b3fbd41f",
      "new_mode": 33188,
      "new_path": "python/private/pypi/extension.bzl"
    },
    {
      "type": "modify",
      "old_id": "0cab1d708aaba2e027686e7577db1842f5db1aae",
      "old_mode": 33188,
      "old_path": "python/private/pypi/parse_requirements.bzl",
      "new_id": "eee97d7019012d40ceb5185d61d470a7017750c0",
      "new_mode": 33188,
      "new_path": "python/private/pypi/parse_requirements.bzl"
    },
    {
      "type": "modify",
      "old_id": "137c524e24b995336846fe8b60bb18c2cedd9f06",
      "old_mode": 33188,
      "old_path": "python/private/pypi/pip_repository.bzl",
      "new_id": "0c9e300a4dc571970bc56f5cb0478a446ff68659",
      "new_mode": 33188,
      "new_path": "python/private/pypi/pip_repository.bzl"
    },
    {
      "type": "modify",
      "old_id": "1f9f050893a8effcbb0e89ece4d43d9ca34bf623",
      "old_mode": 33188,
      "old_path": "python/private/pypi/pypi_repo_utils.bzl",
      "new_id": "da449b4b506761a58b489fc7896667bf4dee7cdb",
      "new_mode": 33188,
      "new_path": "python/private/pypi/pypi_repo_utils.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      "new_mode": 33188,
      "new_path": "python/private/pypi/requirements_parser/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c899a943cc0f51c6c44230363f32c2393cecc5f2",
      "new_mode": 33261,
      "new_path": "python/private/pypi/requirements_parser/resolve_target_platforms.py"
    },
    {
      "type": "modify",
      "old_id": "1c50ac6bf4e0f74b5abe02483378e8b8abb2a51f",
      "old_mode": 33188,
      "old_path": "python/private/repo_utils.bzl",
      "new_id": "aab0325a49e2671a55996e05ce67cd1319125fdf",
      "new_mode": 33188,
      "new_path": "python/private/repo_utils.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "aba9264953150c0951a266e198d779f1d61a5cc5",
      "new_mode": 33188,
      "new_path": "tests/pypi/evaluate_markers/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "280dbd1a6c664911e353fe074d2bedf63ac3c0b2",
      "old_mode": 33188,
      "old_path": "tests/pypi/parse_requirements/parse_requirements_tests.bzl",
      "new_id": "25d2961a349616979972cec7af378090056778d8",
      "new_mode": 33188,
      "new_path": "tests/pypi/parse_requirements/parse_requirements_tests.bzl"
    }
  ]
}
