prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Proposal: Upload the nightlies at each commit on the master branch
  We already build the wheels already anyway. It's just missing the push to pypi. Yes/No?
  
  </issue>
  <code>
  [start of setup.py]
  1 # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #     http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 # ==============================================================================
  15 """TensorFlow Addons.
  16 
  17 TensorFlow Addons is a repository of contributions that conform to well-
  18 established API patterns, but implement new functionality not available
  19 in core TensorFlow. TensorFlow natively supports a large number of
  20 operators, layers, metrics, losses, and optimizers. However, in a fast
  21 moving field like ML, there are many interesting new developments that
  22 cannot be integrated into core TensorFlow (because their broad
  23 applicability is not yet clear, or it is mostly used by a smaller subset
  24 of the community).
  25 """
  26 
  27 import os
  28 import sys
  29 
  30 from datetime import datetime
  31 from setuptools import find_packages
  32 from setuptools import setup
  33 from setuptools.dist import Distribution
  34 from setuptools import Extension
  35 
  36 DOCLINES = __doc__.split("\n")
  37 
  38 TFA_NIGHTLY = "tfa-nightly"
  39 TFA_RELEASE = "tensorflow-addons"
  40 
  41 if "--nightly" in sys.argv:
  42     project_name = TFA_NIGHTLY
  43     nightly_idx = sys.argv.index("--nightly")
  44     sys.argv.pop(nightly_idx)
  45 else:
  46     project_name = TFA_RELEASE
  47 
  48 # Version
  49 version = {}
  50 base_dir = os.path.dirname(os.path.abspath(__file__))
  51 with open(os.path.join(base_dir, "tensorflow_addons", "version.py")) as fp:
  52     exec(fp.read(), version)
  53 
  54 if project_name == TFA_NIGHTLY:
  55     version["__version__"] += datetime.strftime(datetime.today(), "%Y%m%d")
  56 
  57 with open("requirements.txt") as f:
  58     required_pkgs = f.read().splitlines()
  59 
  60 # Manylinux2010 requires a patch for platlib
  61 if (
  62     sys.platform.startswith("linux")
  63     and os.environ.get("TF_ADDONS_NO_BUILD", "0") == "0"
  64 ):
  65     ext_modules = [Extension("_foo", ["stub.cc"])]
  66 else:
  67     ext_modules = []
  68 
  69 
  70 class BinaryDistribution(Distribution):
  71     """This class is needed in order to create OS specific wheels."""
  72 
  73     def has_ext_modules(self):
  74         return True
  75 
  76 
  77 setup(
  78     name=project_name,
  79     version=version["__version__"],
  80     description=DOCLINES[0],
  81     long_description="\n".join(DOCLINES[2:]),
  82     author="Google Inc.",
  83     author_email="opensource@google.com",
  84     packages=find_packages(),
  85     ext_modules=ext_modules,
  86     install_requires=required_pkgs,
  87     include_package_data=True,
  88     zip_safe=False,
  89     distclass=BinaryDistribution,
  90     classifiers=[
  91         "Development Status :: 4 - Beta",
  92         "Intended Audience :: Developers",
  93         "Intended Audience :: Education",
  94         "Intended Audience :: Science/Research",
  95         "License :: OSI Approved :: Apache Software License",
  96         "Programming Language :: Python :: 3.5",
  97         "Programming Language :: Python :: 3.6",
  98         "Programming Language :: Python :: 3.7",
  99         "Topic :: Scientific/Engineering :: Mathematics",
  100         "Topic :: Software Development :: Libraries :: Python Modules",
  101         "Topic :: Software Development :: Libraries",
  102     ],
  103     license="Apache 2.0",
  104     keywords="tensorflow addons machine learning",
  105 )
  106
  [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
  @@ -52,7 +52,7 @@
       exec(fp.read(), version)
   
   if project_name == TFA_NIGHTLY:
  -    version["__version__"] += datetime.strftime(datetime.today(), "%Y%m%d")
  +    version["__version__"] += datetime.now().strftime("%Y%m%d%H%M%S")
   
   with open("requirements.txt") as f:
       required_pkgs = f.read().splitlines()
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -52,7 +52,7 @@\n     exec(fp.read(), version)\n \n if project_name == TFA_NIGHTLY:\n-    version[\"__version__\"] += datetime.strftime(datetime.today(), \"%Y%m%d\")\n+    version[\"__version__\"] += datetime.now().strftime(\"%Y%m%d%H%M%S\")\n \n with open(\"requirements.txt\") as f:\n     required_pkgs = f.read().splitlines()\n", "issue": "Proposal: Upload the nightlies at each commit on the master branch\nWe already build the wheels already anyway. It's just missing the push to pypi. Yes/No?\n", "before_files": [{"content": "# Copyright 2019 The TensorFlow Authors. 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# ==============================================================================\n\"\"\"TensorFlow Addons.\n\nTensorFlow Addons is a repository of contributions that conform to well-\nestablished API patterns, but implement new functionality not available\nin core TensorFlow. TensorFlow natively supports a large number of\noperators, layers, metrics, losses, and optimizers. However, in a fast\nmoving field like ML, there are many interesting new developments that\ncannot be integrated into core TensorFlow (because their broad\napplicability is not yet clear, or it is mostly used by a smaller subset\nof the community).\n\"\"\"\n\nimport os\nimport sys\n\nfrom datetime import datetime\nfrom setuptools import find_packages\nfrom setuptools import setup\nfrom setuptools.dist import Distribution\nfrom setuptools import Extension\n\nDOCLINES = __doc__.split(\"\\n\")\n\nTFA_NIGHTLY = \"tfa-nightly\"\nTFA_RELEASE = \"tensorflow-addons\"\n\nif \"--nightly\" in sys.argv:\n    project_name = TFA_NIGHTLY\n    nightly_idx = sys.argv.index(\"--nightly\")\n    sys.argv.pop(nightly_idx)\nelse:\n    project_name = TFA_RELEASE\n\n# Version\nversion = {}\nbase_dir = os.path.dirname(os.path.abspath(__file__))\nwith open(os.path.join(base_dir, \"tensorflow_addons\", \"version.py\")) as fp:\n    exec(fp.read(), version)\n\nif project_name == TFA_NIGHTLY:\n    version[\"__version__\"] += datetime.strftime(datetime.today(), \"%Y%m%d\")\n\nwith open(\"requirements.txt\") as f:\n    required_pkgs = f.read().splitlines()\n\n# Manylinux2010 requires a patch for platlib\nif (\n    sys.platform.startswith(\"linux\")\n    and os.environ.get(\"TF_ADDONS_NO_BUILD\", \"0\") == \"0\"\n):\n    ext_modules = [Extension(\"_foo\", [\"stub.cc\"])]\nelse:\n    ext_modules = []\n\n\nclass BinaryDistribution(Distribution):\n    \"\"\"This class is needed in order to create OS specific wheels.\"\"\"\n\n    def has_ext_modules(self):\n        return True\n\n\nsetup(\n    name=project_name,\n    version=version[\"__version__\"],\n    description=DOCLINES[0],\n    long_description=\"\\n\".join(DOCLINES[2:]),\n    author=\"Google Inc.\",\n    author_email=\"opensource@google.com\",\n    packages=find_packages(),\n    ext_modules=ext_modules,\n    install_requires=required_pkgs,\n    include_package_data=True,\n    zip_safe=False,\n    distclass=BinaryDistribution,\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Topic :: Scientific/Engineering :: Mathematics\",\n        \"Topic :: Software Development :: Libraries :: Python Modules\",\n        \"Topic :: Software Development :: Libraries\",\n    ],\n    license=\"Apache 2.0\",\n    keywords=\"tensorflow addons machine learning\",\n)\n", "path": "setup.py"}]}