)]}'
{
  "commit": "b5af6bd31867235a85afefaf459de2162adbf31d",
  "tree": "a7ad61f9e21dcc733346fb24cb834ed08dc15d5f",
  "parents": [
    "c2cc62d1db687606c7850fa10a73fe281c3d500d"
  ],
  "author": {
    "name": "Ignas Anikevicius",
    "email": "240938+aignas@users.noreply.github.com",
    "time": "Sat Nov 21 01:24:42 2026 +0900"
  },
  "committer": {
    "name": "Ignas Anikevicius",
    "email": "240938+aignas@users.noreply.github.com",
    "time": "Sat Nov 21 01:24:42 2026 +0900"
  },
  "message": "fix(pypi): evaluate the env markers like packaging does\n\nThe marker evaluation did not validate the markers and did not follow\nthe spec for the less common inputs. Rewrite it as a tokenizer, a\nparser that validates the marker and a single pass evaluator.\n\nTokenizer:\n* A variable followed by a closing parenthesis was dropped, e.g.\n  `(\u0027arm\u0027 in platform_machine)` failed to evaluate.\n* Parenthesis and the other kind of quotes are allowed in the strings.\n* The deprecated PEP 345 names, e.g. `os.name`, are supported.\n\nValidation:\n* Invalid markers, e.g. unterminated strings, unbalanced parenthesis,\n  dangling operators or unknown variables, are now an error instead of\n  evaluating to something truthy.\n\nComparison:\n* `platform_release` is compared as a version and `platform_version`\n  is not, as per the spec.\n* The comparison falls back to the string comparison if the expression\n  is not a valid version specifier, e.g. when using the `in` operator.\n* The ordered comparison of strings is not defined, so `\u003c` and `\u003e`\n  are always false and `\u003c\u003d` and `\u003e\u003d` check the equality.\n\nThe cases from the packaging test-suite are added to the conformance\ntests and the results are the same as of packaging for all of them,\nincluding the markers that are an error to evaluate.\n\nThe markers are tokenized with the string methods instead of one\ncharacter at a time and they are evaluated without building a tree of\nstructs and closures. The evaluation of a long marker takes 3 times\nfewer steps, which is 2 times faster in Bazel. `parse` returns a value\nthat `evaluate` accepts instead of the string, so that a marker that is\nevaluated for many environments is only parsed once.\n\nComparing two variables, which `packaging` does not evaluate correctly\neither, is an error instead of being false. `to_string` and\n`marker_expr` were not used and are removed.\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b4b7e7011fdafd5dae1e830a154b2dc228acfccc",
      "new_mode": 33188,
      "new_path": "news/pypi-env-marker-conformance.fixed.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1c886f87531f9998f982f89f66d903158a79af6c",
      "new_mode": 33188,
      "new_path": "news/pypi-env-marker-validation.changed.md"
    },
    {
      "type": "modify",
      "old_id": "47fb78d8c990d53ed5b3d0a419621c6c1e0cc2b3",
      "old_mode": 33188,
      "old_path": "python/private/BUILD.bazel",
      "new_id": "78e4c48cd2f2a014251cd01b4a8203ccacc4c38f",
      "new_mode": 33188,
      "new_path": "python/private/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "5d51f2a01e304222205bb92760a44a6845b01f42",
      "old_mode": 33188,
      "old_path": "python/private/pypi/BUILD.bazel",
      "new_id": "1bc83e17547523a190b7b6256c01f7b2408024f4",
      "new_mode": 33188,
      "new_path": "python/private/pypi/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "fba7e1a53beb664227a75a71fcc3f8e5db883acb",
      "old_mode": 33188,
      "old_path": "python/private/pypi/pep508_evaluate.bzl",
      "new_id": "29a52aeaafe5d4d2c63a6155478e987689074a43",
      "new_mode": 33188,
      "new_path": "python/private/pypi/pep508_evaluate.bzl"
    },
    {
      "type": "modify",
      "old_id": "bbbe3eb44baa9dd60312d0163bfab35365d808b0",
      "old_mode": 33188,
      "old_path": "tests/perf/BUILD.bazel",
      "new_id": "4a198cd04f70936889e5c33df8d7a0b89b81866d",
      "new_mode": 33188,
      "new_path": "tests/perf/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "ad582515fb540d79f88c8da58a6c163a15751e7e",
      "old_mode": 33188,
      "old_path": "tests/perf/README.md",
      "new_id": "ace9113bc1d70a06a7a74da4bffd2464cb437d4e",
      "new_mode": 33188,
      "new_path": "tests/perf/README.md"
    },
    {
      "type": "modify",
      "old_id": "8a4e10e81e5eb6333b6fcbbb2da2cc0e2a369271",
      "old_mode": 33188,
      "old_path": "tests/perf/steps_test.py",
      "new_id": "3fb53383d648ff69bb83b47a6a0435a8a2fd29a7",
      "new_mode": 33188,
      "new_path": "tests/perf/steps_test.py"
    },
    {
      "type": "modify",
      "old_id": "74fa9f562ed34825a977286b835c716967c1b5a5",
      "old_mode": 33188,
      "old_path": "tests/perf/workloads.bzl",
      "new_id": "ef17a480b02a60ba1743787a3a2986c958296b55",
      "new_mode": 33188,
      "new_path": "tests/perf/workloads.bzl"
    },
    {
      "type": "modify",
      "old_id": "36fce0fa8901b87a2933013e2c58242246a30048",
      "old_mode": 33188,
      "old_path": "tests/pypi/pep508/BUILD.bazel",
      "new_id": "a65fffefa307641b9fc32d9c7c076691731ad99a",
      "new_mode": 33188,
      "new_path": "tests/pypi/pep508/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "9145a9cf8f36f3b273a6c0ebf6563533e9ed36fa",
      "old_mode": 33188,
      "old_path": "tests/pypi/pep508/evaluate_tests.bzl",
      "new_id": "5b521d5ccf15d0cb7bcc31711cdf4776efea5940",
      "new_mode": 33188,
      "new_path": "tests/pypi/pep508/evaluate_tests.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "8ac7570da17602080bf781128bd02f39ad3d6bbf",
      "new_mode": 33188,
      "new_path": "tests/pypi/pep508/packaging_cases.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9cda459d57b7dea867b10d203473f847d1d89570",
      "new_mode": 33188,
      "new_path": "tests/pypi/pep508/packaging_conformance_tests.bzl"
    },
    {
      "type": "modify",
      "old_id": "c05cd2639724461a3d0d52447e891d5fbf8d2da5",
      "old_mode": 33188,
      "old_path": "tests/support/pypa_packaging/BUILD.bazel",
      "new_id": "c53229aa251550c68d10cb248432c9cace07982e",
      "new_mode": 33188,
      "new_path": "tests/support/pypa_packaging/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "08105244447c0a85917cd050b0c5bf9af82c6803",
      "old_mode": 33188,
      "old_path": "tests/support/pypa_packaging/generate.py",
      "new_id": "775af7986a4496df7415bb15cd887b92cce804a9",
      "new_mode": 33188,
      "new_path": "tests/support/pypa_packaging/generate.py"
    }
  ]
}
