prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Set up linters for the project
  It helps if we set up linters early in the development process (less big PRs for fixes in the future). We may consider: mypy, pylint, black, isort, pydocstyle, flake8, bandit and xdoctest.
  
  </issue>
  <code>
  [start of setup.py]
  1 # -------------------------------------------------------------------------
  2 # Copyright (c) Microsoft Corporation. All rights reserved.
  3 # Licensed under the MIT License.
  4 # --------------------------------------------------------------------------
  5 
  6 # -*- coding: utf-8 -*-
  7 
  8 from distutils.core import setup
  9 from setuptools import find_packages
  10 import os
  11 this = os.path.dirname(__file__)
  12 
  13 with open(os.path.join(this, "requirements.txt"), "r") as f:
  14     requirements = [_ for _ in [_.strip("\r\n ")
  15                                 for _ in f.readlines()] if _ is not None]
  16 
  17 packages = find_packages()
  18 assert packages
  19 
  20 # read version from the package file.
  21 version_str = '1.0.0'
  22 with (open(os.path.join(this, 'onnxscript/__init__.py'), "r")) as f:
  23     line = [_ for _ in [_.strip("\r\n ")
  24                         for _ in f.readlines()] if _.startswith("__version__")]
  25     if len(line) > 0:
  26         version_str = line[0].split('=')[1].strip('" ')
  27 
  28 README = os.path.join(os.getcwd(), "README.md")
  29 with open(README) as f:
  30     long_description = f.read()
  31     start_pos = long_description.find('## Contributing')
  32     if start_pos >= 0:
  33         long_description = long_description[:start_pos]
  34 
  35 setup(
  36     name='onnx-script',
  37     version=version_str,
  38     description="Authoring ONNX functions in Python",
  39     long_description=long_description,
  40     long_description_content_type='text/markdown',
  41     license='Apache License v2.0',
  42     author='Microsoft Corporation',
  43     author_email='onnx@microsoft.com',
  44     url='https://github.com/onnx/onnx-script',
  45     packages=packages,
  46     include_package_data=True,
  47     install_requires=requirements,
  48     classifiers=[
  49         'Development Status :: 4 - Beta',
  50         'Environment :: Console',
  51         'Intended Audience :: Developers',
  52         'Operating System :: MacOS :: MacOS X',
  53         'Operating System :: Microsoft :: Windows',
  54         'Programming Language :: Python',
  55         'Programming Language :: Python :: 3.7',
  56         'Programming Language :: Python :: 3.8',
  57         'Programming Language :: Python :: 3.9',
  58         'License :: OSI Approved :: Apache Software License'],
  59 )
  60
  [end of setup.py]
  [start of onnxscript/__init__.py]
  1 # -------------------------------------------------------------------------
  2 # Copyright (c) Microsoft Corporation. All rights reserved.
  3 # Licensed under the MIT License.
  4 # --------------------------------------------------------------------------
  5 
  6 __version__ = '0.1'
  7 
  8 from .main import script, export_onnx_lib, OnnxFunction
  9 from .backend.onnx_export import export2python as proto2python
  10 
  11 __all__ = [script, export_onnx_lib, OnnxFunction, proto2python]
  12
  [end of onnxscript/__init__.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/onnxscript/__init__.py b/onnxscript/__init__.py
  --- a/onnxscript/__init__.py
  +++ b/onnxscript/__init__.py
  @@ -3,9 +3,22 @@
   # Licensed under the MIT License.
   # --------------------------------------------------------------------------
   
  -__version__ = '0.1'
  -
  +import sys
   from .main import script, export_onnx_lib, OnnxFunction
   from .backend.onnx_export import export2python as proto2python
   
  -__all__ = [script, export_onnx_lib, OnnxFunction, proto2python]
  +if sys.version_info[0:2] >= (3, 8):
  +    import importlib.metadata as importlib_metadata
  +else:
  +    # TODO: Remove this when Python 3.7 is deprecated
  +    import importlib_metadata
  +
  +try:
  +    # TODO: should we algin the folder name with package name?
  +    # It's onnxscript and onnx-script now. That way, we can use __package__ here.
  +    __version__ = importlib_metadata.version("onnx-script")
  +except importlib_metadata.PackageNotFoundError:
  +    __version__ = None
  +
  +
  +__all__ = ["script", "export_onnx_lib", "OnnxFunction", "proto2python"]
  diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -5,55 +5,26 @@
   
   # -*- coding: utf-8 -*-
   
  -from distutils.core import setup
  -from setuptools import find_packages
   import os
  -this = os.path.dirname(__file__)
  +import setuptools
   
  -with open(os.path.join(this, "requirements.txt"), "r") as f:
  -    requirements = [_ for _ in [_.strip("\r\n ")
  -                                for _ in f.readlines()] if _ is not None]
  +this = os.path.dirname(__file__)
   
  -packages = find_packages()
  +packages = setuptools.find_packages()
   assert packages
   
  -# read version from the package file.
  -version_str = '1.0.0'
  -with (open(os.path.join(this, 'onnxscript/__init__.py'), "r")) as f:
  -    line = [_ for _ in [_.strip("\r\n ")
  -                        for _ in f.readlines()] if _.startswith("__version__")]
  -    if len(line) > 0:
  -        version_str = line[0].split('=')[1].strip('" ')
  -
   README = os.path.join(os.getcwd(), "README.md")
  -with open(README) as f:
  +with open(README, encoding="utf-8") as f:
       long_description = f.read()
       start_pos = long_description.find('## Contributing')
       if start_pos >= 0:
           long_description = long_description[:start_pos]
   
  -setup(
  -    name='onnx-script',
  -    version=version_str,
  -    description="Authoring ONNX functions in Python",
  +setuptools.setup(
       long_description=long_description,
       long_description_content_type='text/markdown',
  -    license='Apache License v2.0',
  -    author='Microsoft Corporation',
  -    author_email='onnx@microsoft.com',
       url='https://github.com/onnx/onnx-script',
       packages=packages,
       include_package_data=True,
  -    install_requires=requirements,
  -    classifiers=[
  -        'Development Status :: 4 - Beta',
  -        'Environment :: Console',
  -        'Intended Audience :: Developers',
  -        'Operating System :: MacOS :: MacOS X',
  -        'Operating System :: Microsoft :: Windows',
  -        'Programming Language :: Python',
  -        'Programming Language :: Python :: 3.7',
  -        'Programming Language :: Python :: 3.8',
  -        'Programming Language :: Python :: 3.9',
  -        'License :: OSI Approved :: Apache Software License'],
  +    package_data={"onnx-script": ["py.typed"], "onnx": ["py.typed"],},
   )
  
verification_info: {"golden_diff": "diff --git a/onnxscript/__init__.py b/onnxscript/__init__.py\n--- a/onnxscript/__init__.py\n+++ b/onnxscript/__init__.py\n@@ -3,9 +3,22 @@\n # Licensed under the MIT License.\n # --------------------------------------------------------------------------\n \n-__version__ = '0.1'\n-\n+import sys\n from .main import script, export_onnx_lib, OnnxFunction\n from .backend.onnx_export import export2python as proto2python\n \n-__all__ = [script, export_onnx_lib, OnnxFunction, proto2python]\n+if sys.version_info[0:2] >= (3, 8):\n+    import importlib.metadata as importlib_metadata\n+else:\n+    # TODO: Remove this when Python 3.7 is deprecated\n+    import importlib_metadata\n+\n+try:\n+    # TODO: should we algin the folder name with package name?\n+    # It's onnxscript and onnx-script now. That way, we can use __package__ here.\n+    __version__ = importlib_metadata.version(\"onnx-script\")\n+except importlib_metadata.PackageNotFoundError:\n+    __version__ = None\n+\n+\n+__all__ = [\"script\", \"export_onnx_lib\", \"OnnxFunction\", \"proto2python\"]\ndiff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -5,55 +5,26 @@\n \n # -*- coding: utf-8 -*-\n \n-from distutils.core import setup\n-from setuptools import find_packages\n import os\n-this = os.path.dirname(__file__)\n+import setuptools\n \n-with open(os.path.join(this, \"requirements.txt\"), \"r\") as f:\n-    requirements = [_ for _ in [_.strip(\"\\r\\n \")\n-                                for _ in f.readlines()] if _ is not None]\n+this = os.path.dirname(__file__)\n \n-packages = find_packages()\n+packages = setuptools.find_packages()\n assert packages\n \n-# read version from the package file.\n-version_str = '1.0.0'\n-with (open(os.path.join(this, 'onnxscript/__init__.py'), \"r\")) as f:\n-    line = [_ for _ in [_.strip(\"\\r\\n \")\n-                        for _ in f.readlines()] if _.startswith(\"__version__\")]\n-    if len(line) > 0:\n-        version_str = line[0].split('=')[1].strip('\" ')\n-\n README = os.path.join(os.getcwd(), \"README.md\")\n-with open(README) as f:\n+with open(README, encoding=\"utf-8\") as f:\n     long_description = f.read()\n     start_pos = long_description.find('## Contributing')\n     if start_pos >= 0:\n         long_description = long_description[:start_pos]\n \n-setup(\n-    name='onnx-script',\n-    version=version_str,\n-    description=\"Authoring ONNX functions in Python\",\n+setuptools.setup(\n     long_description=long_description,\n     long_description_content_type='text/markdown',\n-    license='Apache License v2.0',\n-    author='Microsoft Corporation',\n-    author_email='onnx@microsoft.com',\n     url='https://github.com/onnx/onnx-script',\n     packages=packages,\n     include_package_data=True,\n-    install_requires=requirements,\n-    classifiers=[\n-        'Development Status :: 4 - Beta',\n-        'Environment :: Console',\n-        'Intended Audience :: Developers',\n-        'Operating System :: MacOS :: MacOS X',\n-        'Operating System :: Microsoft :: Windows',\n-        'Programming Language :: Python',\n-        'Programming Language :: Python :: 3.7',\n-        'Programming Language :: Python :: 3.8',\n-        'Programming Language :: Python :: 3.9',\n-        'License :: OSI Approved :: Apache Software License'],\n+    package_data={\"onnx-script\": [\"py.typed\"], \"onnx\": [\"py.typed\"],},\n )\n", "issue": "Set up linters for the project\nIt helps if we set up linters early in the development process (less big PRs for fixes in the future). We may consider: mypy, pylint, black, isort, pydocstyle, flake8, bandit and xdoctest.\n", "before_files": [{"content": "# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n# --------------------------------------------------------------------------\n\n# -*- coding: utf-8 -*-\n\nfrom distutils.core import setup\nfrom setuptools import find_packages\nimport os\nthis = os.path.dirname(__file__)\n\nwith open(os.path.join(this, \"requirements.txt\"), \"r\") as f:\n    requirements = [_ for _ in [_.strip(\"\\r\\n \")\n                                for _ in f.readlines()] if _ is not None]\n\npackages = find_packages()\nassert packages\n\n# read version from the package file.\nversion_str = '1.0.0'\nwith (open(os.path.join(this, 'onnxscript/__init__.py'), \"r\")) as f:\n    line = [_ for _ in [_.strip(\"\\r\\n \")\n                        for _ in f.readlines()] if _.startswith(\"__version__\")]\n    if len(line) > 0:\n        version_str = line[0].split('=')[1].strip('\" ')\n\nREADME = os.path.join(os.getcwd(), \"README.md\")\nwith open(README) as f:\n    long_description = f.read()\n    start_pos = long_description.find('## Contributing')\n    if start_pos >= 0:\n        long_description = long_description[:start_pos]\n\nsetup(\n    name='onnx-script',\n    version=version_str,\n    description=\"Authoring ONNX functions in Python\",\n    long_description=long_description,\n    long_description_content_type='text/markdown',\n    license='Apache License v2.0',\n    author='Microsoft Corporation',\n    author_email='onnx@microsoft.com',\n    url='https://github.com/onnx/onnx-script',\n    packages=packages,\n    include_package_data=True,\n    install_requires=requirements,\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Environment :: Console',\n        'Intended Audience :: Developers',\n        'Operating System :: MacOS :: MacOS X',\n        'Operating System :: Microsoft :: Windows',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'License :: OSI Approved :: Apache Software License'],\n)\n", "path": "setup.py"}, {"content": "# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n# --------------------------------------------------------------------------\n\n__version__ = '0.1'\n\nfrom .main import script, export_onnx_lib, OnnxFunction\nfrom .backend.onnx_export import export2python as proto2python\n\n__all__ = [script, export_onnx_lib, OnnxFunction, proto2python]\n", "path": "onnxscript/__init__.py"}]}