prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Turbinia's setup.py seems to be broken with the latest version of pip
  Turbinia can't be isntalled with the latest version of `pip`. (20.1)
  
  ```
  Collecting pip
    Downloading pip-20.1-py2.py3-none-any.whl (1.5 MB)
  Installing collected packages: pip
    Attempting uninstall: pip
      Found existing installation: pip 20.0.2
      Uninstalling pip-20.0.2:
        Successfully uninstalled pip-20.0.2
  Successfully installed pip-20.1
  [snip]
  Collecting turbinia==20190819.6
    Downloading turbinia-20190819.6.tar.gz (88 kB)
      ERROR: Command errored out with exit status 1:
       command: /opt/hostedtoolcache/Python/3.6.10/x64/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jz1lyg2d/turbinia/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jz1lyg2d/turbinia/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-rm1k5ext
           cwd: /tmp/pip-install-jz1lyg2d/turbinia/
      Complete output (7 lines):
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/tmp/pip-install-jz1lyg2d/turbinia/setup.py", line 65, in <module>
          'requirements.txt', session=False)
        File "/tmp/pip-install-jz1lyg2d/turbinia/setup.py", line 64, in <listcomp>
          install_requires=[str(req.req) for req in parse_requirements(
      AttributeError: 'ParsedRequirement' object has no attribute 'req'
  ```
  
  Works fine on pip 19.1.1.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  1 #!/usr/bin/env python
  2 # -*- coding: utf-8 -*-
  3 #
  4 # Copyright 2017 Google Inc.
  5 #
  6 # Licensed under the Apache License, Version 2.0 (the "License");
  7 # you may not use this file except in compliance with the License.
  8 # You may obtain a copy of the License at
  9 #
  10 #      http://www.apache.org/licenses/LICENSE-2.0
  11 #
  12 # Unless required by applicable law or agreed to in writing, software
  13 # distributed under the License is distributed on an "AS IS" BASIS,
  14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15 # See the License for the specific language governing permissions and
  16 # limitations under the License.
  17 """This is the setup file for the project."""
  18 
  19 # yapf: disable
  20 
  21 from __future__ import unicode_literals
  22 
  23 import sys
  24 
  25 from setuptools import find_packages
  26 from setuptools import setup
  27 
  28 try:  # for pip >= 10
  29   from pip._internal.req import parse_requirements
  30 except ImportError:  # for pip <= 9.0.3
  31   from pip.req import parse_requirements
  32 
  33 
  34 # make sure turbinia is in path
  35 sys.path.insert(0, '.')
  36 
  37 import turbinia  # pylint: disable=wrong-import-position
  38 
  39 turbinia_description = (
  40     'Turbinia is an open-source framework for deploying, managing, and running'
  41     'forensic workloads on cloud platforms. It is intended to automate running '
  42     'of common forensic processing tools (i.e. Plaso, TSK, strings, etc) to '
  43     'help with processing evidence in the Cloud, scaling the processing of '
  44     'large amounts of evidence, and decreasing response time by parallelizing'
  45     'processing where possible.')
  46 
  47 setup(
  48     name='turbinia',
  49     version=turbinia.__version__,
  50     description='Automation and Scaling of Digital Forensics Tools',
  51     long_description=turbinia_description,
  52     license='Apache License, Version 2.0',
  53     url='http://turbinia.plumbing/',
  54     maintainer='Turbinia development team',
  55     maintainer_email='turbinia-dev@googlegroups.com',
  56     classifiers=[
  57         'Development Status :: 4 - Beta',
  58         'Environment :: Console',
  59         'Operating System :: OS Independent',
  60         'Programming Language :: Python',
  61     ],
  62     packages=find_packages(),
  63     include_package_data=True,
  64     zip_safe=False,
  65     entry_points={'console_scripts': ['turbiniactl=turbinia.turbiniactl:main']},
  66     install_requires=[str(req.req) for req in parse_requirements(
  67         'requirements.txt', session=False)
  68     ],
  69     extras_require={
  70         'dev': ['mock', 'nose', 'yapf', 'celery~=4.1', 'coverage'],
  71         'local': ['celery~=4.1', 'kombu~=4.1', 'redis~=3.0'],
  72         'worker': ['plaso>=20171118', 'pyhindsight>=2.2.0']
  73     }
  74 )
  75
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -25,11 +25,6 @@
   from setuptools import find_packages
   from setuptools import setup
   
  -try:  # for pip >= 10
  -  from pip._internal.req import parse_requirements
  -except ImportError:  # for pip <= 9.0.3
  -  from pip.req import parse_requirements
  -
   
   # make sure turbinia is in path
   sys.path.insert(0, '.')
  @@ -44,6 +39,9 @@
       'large amounts of evidence, and decreasing response time by parallelizing'
       'processing where possible.')
   
  +requirements = []
  +with open('requirements.txt','r') as f:
  +  requirements = f.read().splitlines()
   setup(
       name='turbinia',
       version=turbinia.__version__,
  @@ -63,9 +61,7 @@
       include_package_data=True,
       zip_safe=False,
       entry_points={'console_scripts': ['turbiniactl=turbinia.turbiniactl:main']},
  -    install_requires=[str(req.req) for req in parse_requirements(
  -        'requirements.txt', session=False)
  -    ],
  +    install_requires=requirements,
       extras_require={
           'dev': ['mock', 'nose', 'yapf', 'celery~=4.1', 'coverage'],
           'local': ['celery~=4.1', 'kombu~=4.1', 'redis~=3.0'],
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -25,11 +25,6 @@\n from setuptools import find_packages\n from setuptools import setup\n \n-try:  # for pip >= 10\n-  from pip._internal.req import parse_requirements\n-except ImportError:  # for pip <= 9.0.3\n-  from pip.req import parse_requirements\n-\n \n # make sure turbinia is in path\n sys.path.insert(0, '.')\n@@ -44,6 +39,9 @@\n     'large amounts of evidence, and decreasing response time by parallelizing'\n     'processing where possible.')\n \n+requirements = []\n+with open('requirements.txt','r') as f:\n+  requirements = f.read().splitlines()\n setup(\n     name='turbinia',\n     version=turbinia.__version__,\n@@ -63,9 +61,7 @@\n     include_package_data=True,\n     zip_safe=False,\n     entry_points={'console_scripts': ['turbiniactl=turbinia.turbiniactl:main']},\n-    install_requires=[str(req.req) for req in parse_requirements(\n-        'requirements.txt', session=False)\n-    ],\n+    install_requires=requirements,\n     extras_require={\n         'dev': ['mock', 'nose', 'yapf', 'celery~=4.1', 'coverage'],\n         'local': ['celery~=4.1', 'kombu~=4.1', 'redis~=3.0'],\n", "issue": "Turbinia's setup.py seems to be broken with the latest version of pip\nTurbinia can't be isntalled with the latest version of `pip`. (20.1)\r\n\r\n```\r\nCollecting pip\r\n  Downloading pip-20.1-py2.py3-none-any.whl (1.5 MB)\r\nInstalling collected packages: pip\r\n  Attempting uninstall: pip\r\n    Found existing installation: pip 20.0.2\r\n    Uninstalling pip-20.0.2:\r\n      Successfully uninstalled pip-20.0.2\r\nSuccessfully installed pip-20.1\r\n[snip]\r\nCollecting turbinia==20190819.6\r\n  Downloading turbinia-20190819.6.tar.gz (88 kB)\r\n    ERROR: Command errored out with exit status 1:\r\n     command: /opt/hostedtoolcache/Python/3.6.10/x64/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-install-jz1lyg2d/turbinia/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-install-jz1lyg2d/turbinia/setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' egg_info --egg-base /tmp/pip-pip-egg-info-rm1k5ext\r\n         cwd: /tmp/pip-install-jz1lyg2d/turbinia/\r\n    Complete output (7 lines):\r\n    Traceback (most recent call last):\r\n      File \"<string>\", line 1, in <module>\r\n      File \"/tmp/pip-install-jz1lyg2d/turbinia/setup.py\", line 65, in <module>\r\n        'requirements.txt', session=False)\r\n      File \"/tmp/pip-install-jz1lyg2d/turbinia/setup.py\", line 64, in <listcomp>\r\n        install_requires=[str(req.req) for req in parse_requirements(\r\n    AttributeError: 'ParsedRequirement' object has no attribute 'req'\r\n```\r\n\r\nWorks fine on pip 19.1.1.\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2017 Google Inc.\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.\"\"\"\n\n# yapf: disable\n\nfrom __future__ import unicode_literals\n\nimport sys\n\nfrom setuptools import find_packages\nfrom setuptools import setup\n\ntry:  # for pip >= 10\n  from pip._internal.req import parse_requirements\nexcept ImportError:  # for pip <= 9.0.3\n  from pip.req import parse_requirements\n\n\n# make sure turbinia is in path\nsys.path.insert(0, '.')\n\nimport turbinia  # pylint: disable=wrong-import-position\n\nturbinia_description = (\n    'Turbinia is an open-source framework for deploying, managing, and running'\n    'forensic workloads on cloud platforms. It is intended to automate running '\n    'of common forensic processing tools (i.e. Plaso, TSK, strings, etc) to '\n    'help with processing evidence in the Cloud, scaling the processing of '\n    'large amounts of evidence, and decreasing response time by parallelizing'\n    'processing where possible.')\n\nsetup(\n    name='turbinia',\n    version=turbinia.__version__,\n    description='Automation and Scaling of Digital Forensics Tools',\n    long_description=turbinia_description,\n    license='Apache License, Version 2.0',\n    url='http://turbinia.plumbing/',\n    maintainer='Turbinia development team',\n    maintainer_email='turbinia-dev@googlegroups.com',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: Console',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n    ],\n    packages=find_packages(),\n    include_package_data=True,\n    zip_safe=False,\n    entry_points={'console_scripts': ['turbiniactl=turbinia.turbiniactl:main']},\n    install_requires=[str(req.req) for req in parse_requirements(\n        'requirements.txt', session=False)\n    ],\n    extras_require={\n        'dev': ['mock', 'nose', 'yapf', 'celery~=4.1', 'coverage'],\n        'local': ['celery~=4.1', 'kombu~=4.1', 'redis~=3.0'],\n        'worker': ['plaso>=20171118', 'pyhindsight>=2.2.0']\n    }\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2017 Google Inc.\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.\"\"\"\n\n# yapf: disable\n\nfrom __future__ import unicode_literals\n\nimport sys\n\nfrom setuptools import find_packages\nfrom setuptools import setup\n\n\n# make sure turbinia is in path\nsys.path.insert(0, '.')\n\nimport turbinia  # pylint: disable=wrong-import-position\n\nturbinia_description = (\n    'Turbinia is an open-source framework for deploying, managing, and running'\n    'forensic workloads on cloud platforms. It is intended to automate running '\n    'of common forensic processing tools (i.e. Plaso, TSK, strings, etc) to '\n    'help with processing evidence in the Cloud, scaling the processing of '\n    'large amounts of evidence, and decreasing response time by parallelizing'\n    'processing where possible.')\n\nrequirements = []\nwith open('requirements.txt','r') as f:\n  requirements = f.read().splitlines()\nsetup(\n    name='turbinia',\n    version=turbinia.__version__,\n    description='Automation and Scaling of Digital Forensics Tools',\n    long_description=turbinia_description,\n    license='Apache License, Version 2.0',\n    url='http://turbinia.plumbing/',\n    maintainer='Turbinia development team',\n    maintainer_email='turbinia-dev@googlegroups.com',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: Console',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n    ],\n    packages=find_packages(),\n    include_package_data=True,\n    zip_safe=False,\n    entry_points={'console_scripts': ['turbiniactl=turbinia.turbiniactl:main']},\n    install_requires=requirements,\n    extras_require={\n        'dev': ['mock', 'nose', 'yapf', 'celery~=4.1', 'coverage'],\n        'local': ['celery~=4.1', 'kombu~=4.1', 'redis~=3.0'],\n        'worker': ['plaso>=20171118', 'pyhindsight>=2.2.0']\n    }\n)\n", "path": "setup.py"}]}