prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Fix translations in package
  The compilemessages step for geotrek and mapentity is missing somewhere
  
  </issue>
  <code>
  [start of setup.py]
  1 #!/usr/bin/python3
  2 import os
  3 import distutils.command.build
  4 from setuptools import setup, find_packages
  5 
  6 here = os.path.abspath(os.path.dirname(__file__))
  7 
  8 
  9 class BuildCommand(distutils.command.build.build):
  10     def run(self):
  11         print("before")
  12         distutils.command.build.build.run(self)
  13         print("after")
  14         from django.core.management import call_command
  15         curdir = os.getcwd()
  16         os.chdir(os.path.join(curdir, 'geotrek'))
  17         call_command('compilemessages')
  18         os.chdir(os.path.join(curdir, 'mapentity'))
  19         call_command('compilemessages')
  20         os.chdir(curdir)
  21 
  22 
  23 setup(
  24     name='geotrek',
  25     version=open(os.path.join(here, 'VERSION')).read().strip(),
  26     author='Makina Corpus',
  27     author_email='geobi@makina-corpus.com',
  28     url='http://makina-corpus.com',
  29     description="Geotrek",
  30     long_description=(open(os.path.join(here, 'README.rst')).read() + '\n\n'
  31                       + open(os.path.join(here, 'docs', 'changelog.rst')).read()),
  32     scripts=['manage.py'],
  33     install_requires=[
  34         # pinned by requirements.txt
  35         'psycopg2',
  36         'docutils',
  37         'GDAL',
  38         'Pillow',
  39         'easy-thumbnails',
  40         'simplekml',
  41         'pygal',
  42         'django-extended-choices',
  43         'django-multiselectfield',
  44         'geojson',
  45         'tif2geojson',
  46         'pytz',
  47         'djangorestframework-gis',
  48         'drf-dynamic-fields',
  49         'django-rest-swagger',
  50         'django-embed-video',
  51         'xlrd',
  52         'landez',
  53         'redis',
  54         'celery',
  55         'django-celery-results',
  56         'requests[security]',
  57         'drf-extensions',
  58         'django-colorfield',
  59         'factory_boy',
  60     ],
  61     cmdclass={"build": BuildCommand},
  62     include_package_data=True,
  63     license='BSD, see LICENSE file.',
  64     packages=find_packages(),
  65     classifiers=['Natural Language :: English',
  66                  'Environment :: Web Environment',
  67                  'Framework :: Django',
  68                  'Development Status :: 5 - Production/Stable',
  69                  'Programming Language :: Python :: 2.7'],
  70 )
  71
  [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
  @@ -1,23 +1,24 @@
   #!/usr/bin/python3
   import os
   import distutils.command.build
  +from pathlib import Path
   from setuptools import setup, find_packages
  +from shutil import copy
   
   here = os.path.abspath(os.path.dirname(__file__))
   
   
   class BuildCommand(distutils.command.build.build):
       def run(self):
  -        print("before")
           distutils.command.build.build.run(self)
  -        print("after")
           from django.core.management import call_command
           curdir = os.getcwd()
  -        os.chdir(os.path.join(curdir, 'geotrek'))
  -        call_command('compilemessages')
  -        os.chdir(os.path.join(curdir, 'mapentity'))
  -        call_command('compilemessages')
  -        os.chdir(curdir)
  +        for subdir in ('geotrek', 'mapentity'):
  +            os.chdir(subdir)
  +            call_command('compilemessages')
  +            for path in Path('.').rglob('*.mo'):
  +                copy(path, os.path.join(curdir, self.build_lib, subdir, path))
  +            os.chdir(curdir)
   
   
   setup(
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -1,23 +1,24 @@\n #!/usr/bin/python3\n import os\n import distutils.command.build\n+from pathlib import Path\n from setuptools import setup, find_packages\n+from shutil import copy\n \n here = os.path.abspath(os.path.dirname(__file__))\n \n \n class BuildCommand(distutils.command.build.build):\n     def run(self):\n-        print(\"before\")\n         distutils.command.build.build.run(self)\n-        print(\"after\")\n         from django.core.management import call_command\n         curdir = os.getcwd()\n-        os.chdir(os.path.join(curdir, 'geotrek'))\n-        call_command('compilemessages')\n-        os.chdir(os.path.join(curdir, 'mapentity'))\n-        call_command('compilemessages')\n-        os.chdir(curdir)\n+        for subdir in ('geotrek', 'mapentity'):\n+            os.chdir(subdir)\n+            call_command('compilemessages')\n+            for path in Path('.').rglob('*.mo'):\n+                copy(path, os.path.join(curdir, self.build_lib, subdir, path))\n+            os.chdir(curdir)\n \n \n setup(\n", "issue": "Fix translations in package\nThe compilemessages step for geotrek and mapentity is missing somewhere\n", "before_files": [{"content": "#!/usr/bin/python3\nimport os\nimport distutils.command.build\nfrom setuptools import setup, find_packages\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\n\nclass BuildCommand(distutils.command.build.build):\n    def run(self):\n        print(\"before\")\n        distutils.command.build.build.run(self)\n        print(\"after\")\n        from django.core.management import call_command\n        curdir = os.getcwd()\n        os.chdir(os.path.join(curdir, 'geotrek'))\n        call_command('compilemessages')\n        os.chdir(os.path.join(curdir, 'mapentity'))\n        call_command('compilemessages')\n        os.chdir(curdir)\n\n\nsetup(\n    name='geotrek',\n    version=open(os.path.join(here, 'VERSION')).read().strip(),\n    author='Makina Corpus',\n    author_email='geobi@makina-corpus.com',\n    url='http://makina-corpus.com',\n    description=\"Geotrek\",\n    long_description=(open(os.path.join(here, 'README.rst')).read() + '\\n\\n'\n                      + open(os.path.join(here, 'docs', 'changelog.rst')).read()),\n    scripts=['manage.py'],\n    install_requires=[\n        # pinned by requirements.txt\n        'psycopg2',\n        'docutils',\n        'GDAL',\n        'Pillow',\n        'easy-thumbnails',\n        'simplekml',\n        'pygal',\n        'django-extended-choices',\n        'django-multiselectfield',\n        'geojson',\n        'tif2geojson',\n        'pytz',\n        'djangorestframework-gis',\n        'drf-dynamic-fields',\n        'django-rest-swagger',\n        'django-embed-video',\n        'xlrd',\n        'landez',\n        'redis',\n        'celery',\n        'django-celery-results',\n        'requests[security]',\n        'drf-extensions',\n        'django-colorfield',\n        'factory_boy',\n    ],\n    cmdclass={\"build\": BuildCommand},\n    include_package_data=True,\n    license='BSD, see LICENSE file.',\n    packages=find_packages(),\n    classifiers=['Natural Language :: English',\n                 'Environment :: Web Environment',\n                 'Framework :: Django',\n                 'Development Status :: 5 - Production/Stable',\n                 'Programming Language :: Python :: 2.7'],\n)\n", "path": "setup.py"}]}