prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  `pants_requirement` should include the `; python_version<'3'` environment marker
  Until pants can run on python 3, the `pants_requirement` should add an environment marker to restict the python environment it applies to. After pants only supports `>=3.5` a change should be made to the environment marker.
  
  </issue>
  <code>
  [start of src/python/pants/backend/python/pants_requirement.py]
  1 # coding=utf-8
  2 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
  3 # Licensed under the Apache License, Version 2.0 (see LICENSE).
  4 
  5 from __future__ import absolute_import, division, print_function, unicode_literals
  6 
  7 import os
  8 from builtins import object
  9 
  10 from pants.backend.python.python_requirement import PythonRequirement
  11 from pants.base.build_environment import pants_version
  12 
  13 
  14 class PantsRequirement(object):
  15   """Exports a `python_requirement_library` pointing at the active pants' corresponding sdist.
  16 
  17   This requirement is useful for custom plugin authors who want to build and test their plugin with
  18   pants itself.  Using the resulting target as a dependency of their plugin target ensures the
  19   dependency stays true to the surrounding repo's version of pants.
  20 
  21   NB: The requirement generated is for official pants releases on pypi; so may not be appropriate
  22   for use in a repo that tracks `pantsbuild/pants` or otherwise uses custom pants sdists.
  23 
  24   :API: public
  25   """
  26 
  27   def __init__(self, parse_context):
  28     self._parse_context = parse_context
  29 
  30   def __call__(self, name=None):
  31     """
  32     :param string name: The name to use for the target, defaults to the parent dir name.
  33     """
  34     name = name or os.path.basename(self._parse_context.rel_path)
  35     requirement = PythonRequirement(requirement='pantsbuild.pants=={}'.format(pants_version()))
  36     self._parse_context.create_object('python_requirement_library',
  37                                       name=name,
  38                                       requirements=[requirement])
  39
  [end of src/python/pants/backend/python/pants_requirement.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/src/python/pants/backend/python/pants_requirement.py b/src/python/pants/backend/python/pants_requirement.py
  --- a/src/python/pants/backend/python/pants_requirement.py
  +++ b/src/python/pants/backend/python/pants_requirement.py
  @@ -32,7 +32,14 @@
       :param string name: The name to use for the target, defaults to the parent dir name.
       """
       name = name or os.path.basename(self._parse_context.rel_path)
  -    requirement = PythonRequirement(requirement='pantsbuild.pants=={}'.format(pants_version()))
  +
  +    # TODO(John Sirois): Modify to constraint to >=3.5,<4 as part of
  +    # https://github.com/pantsbuild/pants/issues/6062
  +    env_marker = "python_version>='2.7' and python_version<'3'"
  +
  +    requirement = PythonRequirement(requirement="pantsbuild.pants=={version} ; {env_marker}"
  +                                    .format(version=pants_version(), env_marker=env_marker))
  +
       self._parse_context.create_object('python_requirement_library',
                                         name=name,
                                         requirements=[requirement])
  
verification_info: {"golden_diff": "diff --git a/src/python/pants/backend/python/pants_requirement.py b/src/python/pants/backend/python/pants_requirement.py\n--- a/src/python/pants/backend/python/pants_requirement.py\n+++ b/src/python/pants/backend/python/pants_requirement.py\n@@ -32,7 +32,14 @@\n     :param string name: The name to use for the target, defaults to the parent dir name.\n     \"\"\"\n     name = name or os.path.basename(self._parse_context.rel_path)\n-    requirement = PythonRequirement(requirement='pantsbuild.pants=={}'.format(pants_version()))\n+\n+    # TODO(John Sirois): Modify to constraint to >=3.5,<4 as part of\n+    # https://github.com/pantsbuild/pants/issues/6062\n+    env_marker = \"python_version>='2.7' and python_version<'3'\"\n+\n+    requirement = PythonRequirement(requirement=\"pantsbuild.pants=={version} ; {env_marker}\"\n+                                    .format(version=pants_version(), env_marker=env_marker))\n+\n     self._parse_context.create_object('python_requirement_library',\n                                       name=name,\n                                       requirements=[requirement])\n", "issue": "`pants_requirement` should include the `; python_version<'3'` environment marker\nUntil pants can run on python 3, the `pants_requirement` should add an environment marker to restict the python environment it applies to. After pants only supports `>=3.5` a change should be made to the environment marker.\n", "before_files": [{"content": "# coding=utf-8\n# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).\n# Licensed under the Apache License, Version 2.0 (see LICENSE).\n\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os\nfrom builtins import object\n\nfrom pants.backend.python.python_requirement import PythonRequirement\nfrom pants.base.build_environment import pants_version\n\n\nclass PantsRequirement(object):\n  \"\"\"Exports a `python_requirement_library` pointing at the active pants' corresponding sdist.\n\n  This requirement is useful for custom plugin authors who want to build and test their plugin with\n  pants itself.  Using the resulting target as a dependency of their plugin target ensures the\n  dependency stays true to the surrounding repo's version of pants.\n\n  NB: The requirement generated is for official pants releases on pypi; so may not be appropriate\n  for use in a repo that tracks `pantsbuild/pants` or otherwise uses custom pants sdists.\n\n  :API: public\n  \"\"\"\n\n  def __init__(self, parse_context):\n    self._parse_context = parse_context\n\n  def __call__(self, name=None):\n    \"\"\"\n    :param string name: The name to use for the target, defaults to the parent dir name.\n    \"\"\"\n    name = name or os.path.basename(self._parse_context.rel_path)\n    requirement = PythonRequirement(requirement='pantsbuild.pants=={}'.format(pants_version()))\n    self._parse_context.create_object('python_requirement_library',\n                                      name=name,\n                                      requirements=[requirement])\n", "path": "src/python/pants/backend/python/pants_requirement.py"}]}