prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Pylint not present in requirements.txt
  Not pinning version of Pylint makes our build a bit non-deterministic. Pylint's behavior can change between versions and break our build.
  
  </issue>
  <code>
  [start of setup.py]
  1 #!/usr/bin/env python
  2 # Copyright 2015 Google Inc. All rights reserved.
  3 #
  4 # Licensed under the Apache License, Version 2.0 (the "License");
  5 # you may not use this file except in compliance with the License.
  6 # You may obtain a copy of the License at
  7 #
  8 #     http://www.apache.org/licenses/LICENSE-2.0
  9 #
  10 # Unless required by applicable law or agreed to in writing, software
  11 # distributed under the License is distributed on an "AS IS" BASIS,
  12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 # See the License for the specific language governing permissions and
  14 # limitations under the License.
  15 """This is the setup file for the project. The standard setup rules apply:
  16 
  17    python setup.py build
  18    sudo python setup.py install
  19 """
  20 
  21 import os.path
  22 import sys
  23 import time
  24 
  25 from setuptools import find_packages
  26 from setuptools import setup
  27 
  28 timesketch_version = u'20170721'
  29 
  30 timesketch_description = (
  31     u'Timesketch is a web based tool for collaborative forensic timeline '
  32     u'analysis. Using sketches you and your collaborators can easily organize '
  33     u'timelines and analyze them all at the same time.  Add meaning to '
  34     u'your raw data with rich annotations, comments, tags and stars.')
  35 
  36 def check_before_upload():
  37     """Warn user if frontend build is not present or is not recent.
  38 
  39     Make sure that .js and .css bundles included in the PyPI package are up to
  40     date.
  41 
  42     Raises:
  43     UserWarning
  44     """
  45     this_dir = os.path.dirname(__file__)
  46     frontend_dist_dir = os.path.join(
  47         this_dir, 'timesketch', 'ui', 'static', 'dist',
  48     )
  49     js = os.path.join(frontend_dist_dir, 'bundle.js')
  50     css = os.path.join(frontend_dist_dir, 'bundle.css')
  51     if not (os.path.isfile(js) and os.path.isfile(css)):
  52         raise UserWarning(
  53             "Build the frontend before uploading to PyPI!"
  54             + " (see docs/Developers-Guide.md)"
  55         )
  56     mtime = min(os.path.getmtime(js), os.path.getmtime(css))
  57     if time.time() - mtime > 180:
  58         raise UserWarning(
  59             "Frontend build is older than 3 minutes, please rebuild!"
  60             + " (see docs/Developers-Guide.md)"
  61         )
  62 
  63 if 'upload' in sys.argv:
  64     check_before_upload()
  65 
  66 setup(
  67     name=u'timesketch',
  68     version=timesketch_version,
  69     description=u'Digital forensic timeline analysis',
  70     long_description=timesketch_description,
  71     license=u'Apache License, Version 2.0',
  72     url=u'http://www.timesketch.org/',
  73     maintainer=u'Timesketch development team',
  74     maintainer_email=u'timesketch-dev@googlegroups.com',
  75     classifiers=[
  76         u'Development Status :: 4 - Beta',
  77         u'Environment :: Web Environment',
  78         u'Operating System :: OS Independent',
  79         u'Programming Language :: Python',
  80     ],
  81     data_files=[(u'share/timesketch', [u'timesketch.conf'])],
  82     packages=find_packages(),
  83     include_package_data=True,
  84     zip_safe=False,
  85     scripts=[u'tsctl'],
  86     install_requires=frozenset([
  87         u'Flask', u'Flask-Login', u'Flask-script', u'Flask-SQLAlchemy',
  88         u'Flask-Bcrypt', u'Flask-RESTful', u'Flask-WTF', u'Flask-Migrate',
  89         u'SQLAlchemy', u'celery', u'redis', u'blinker', u'elasticsearch',
  90         u'neo4jrestclient', u'python-dateutil'
  91     ]))
  92
  [end of setup.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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -24,6 +24,8 @@
   
   from setuptools import find_packages
   from setuptools import setup
  +from pip.req import parse_requirements
  +from pip.download import PipSession
   
   timesketch_version = u'20170721'
   
  @@ -83,9 +85,7 @@
       include_package_data=True,
       zip_safe=False,
       scripts=[u'tsctl'],
  -    install_requires=frozenset([
  -        u'Flask', u'Flask-Login', u'Flask-script', u'Flask-SQLAlchemy',
  -        u'Flask-Bcrypt', u'Flask-RESTful', u'Flask-WTF', u'Flask-Migrate',
  -        u'SQLAlchemy', u'celery', u'redis', u'blinker', u'elasticsearch',
  -        u'neo4jrestclient', u'python-dateutil'
  -    ]))
  +    install_requires=[str(req.req) for req in parse_requirements(
  +        "requirements.txt", session=PipSession(),
  +    )],
  +)
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -24,6 +24,8 @@\n \n from setuptools import find_packages\n from setuptools import setup\n+from pip.req import parse_requirements\n+from pip.download import PipSession\n \n timesketch_version = u'20170721'\n \n@@ -83,9 +85,7 @@\n     include_package_data=True,\n     zip_safe=False,\n     scripts=[u'tsctl'],\n-    install_requires=frozenset([\n-        u'Flask', u'Flask-Login', u'Flask-script', u'Flask-SQLAlchemy',\n-        u'Flask-Bcrypt', u'Flask-RESTful', u'Flask-WTF', u'Flask-Migrate',\n-        u'SQLAlchemy', u'celery', u'redis', u'blinker', u'elasticsearch',\n-        u'neo4jrestclient', u'python-dateutil'\n-    ]))\n+    install_requires=[str(req.req) for req in parse_requirements(\n+        \"requirements.txt\", session=PipSession(),\n+    )],\n+)\n", "issue": "Pylint not present in requirements.txt\nNot pinning version of Pylint makes our build a bit non-deterministic. Pylint's behavior can change between versions and break our build.\n", "before_files": [{"content": "#!/usr/bin/env python\n# Copyright 2015 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"This is the setup file for the project. The standard setup rules apply:\n\n   python setup.py build\n   sudo python setup.py install\n\"\"\"\n\nimport os.path\nimport sys\nimport time\n\nfrom setuptools import find_packages\nfrom setuptools import setup\n\ntimesketch_version = u'20170721'\n\ntimesketch_description = (\n    u'Timesketch is a web based tool for collaborative forensic timeline '\n    u'analysis. Using sketches you and your collaborators can easily organize '\n    u'timelines and analyze them all at the same time.  Add meaning to '\n    u'your raw data with rich annotations, comments, tags and stars.')\n\ndef check_before_upload():\n    \"\"\"Warn user if frontend build is not present or is not recent.\n\n    Make sure that .js and .css bundles included in the PyPI package are up to\n    date.\n\n    Raises:\n    UserWarning\n    \"\"\"\n    this_dir = os.path.dirname(__file__)\n    frontend_dist_dir = os.path.join(\n        this_dir, 'timesketch', 'ui', 'static', 'dist',\n    )\n    js = os.path.join(frontend_dist_dir, 'bundle.js')\n    css = os.path.join(frontend_dist_dir, 'bundle.css')\n    if not (os.path.isfile(js) and os.path.isfile(css)):\n        raise UserWarning(\n            \"Build the frontend before uploading to PyPI!\"\n            + \" (see docs/Developers-Guide.md)\"\n        )\n    mtime = min(os.path.getmtime(js), os.path.getmtime(css))\n    if time.time() - mtime > 180:\n        raise UserWarning(\n            \"Frontend build is older than 3 minutes, please rebuild!\"\n            + \" (see docs/Developers-Guide.md)\"\n        )\n\nif 'upload' in sys.argv:\n    check_before_upload()\n\nsetup(\n    name=u'timesketch',\n    version=timesketch_version,\n    description=u'Digital forensic timeline analysis',\n    long_description=timesketch_description,\n    license=u'Apache License, Version 2.0',\n    url=u'http://www.timesketch.org/',\n    maintainer=u'Timesketch development team',\n    maintainer_email=u'timesketch-dev@googlegroups.com',\n    classifiers=[\n        u'Development Status :: 4 - Beta',\n        u'Environment :: Web Environment',\n        u'Operating System :: OS Independent',\n        u'Programming Language :: Python',\n    ],\n    data_files=[(u'share/timesketch', [u'timesketch.conf'])],\n    packages=find_packages(),\n    include_package_data=True,\n    zip_safe=False,\n    scripts=[u'tsctl'],\n    install_requires=frozenset([\n        u'Flask', u'Flask-Login', u'Flask-script', u'Flask-SQLAlchemy',\n        u'Flask-Bcrypt', u'Flask-RESTful', u'Flask-WTF', u'Flask-Migrate',\n        u'SQLAlchemy', u'celery', u'redis', u'blinker', u'elasticsearch',\n        u'neo4jrestclient', u'python-dateutil'\n    ]))\n", "path": "setup.py"}]}