prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Use of future functionality
  ### Description of the bug
  
  The `shutil.copytree` argument [`dirs_exist_ok`](https://docs.python.org/3/library/shutil.html#shutil.copytree) is only available in Python version 3.8+ but nf-core tool still support Python 3.7
  
  https://github.com/nf-core/tools/blob/b5400d84d307343353b6ab09aad204231f74fb0e/nf_core/modules/lint/module_changes.py#L28
  
  Two options: drop Python 3.7 support or change that code.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `nf_core/modules/lint/module_changes.py`
  Content:
  ```
  1 """
  2 Check whether the content of a module has changed compared to the original repository
  3 """
  4 import shutil
  5 import tempfile
  6 from pathlib import Path
  7 
  8 from nf_core.modules.modules_differ import ModulesDiffer
  9 
  10 
  11 def module_changes(module_lint_object, module):
  12     """
  13     Checks whether installed nf-core modules have changed compared to the
  14     original repository
  15 
  16     Downloads the ``main.nf`` and ``meta.yml`` files for every module
  17     and compares them to the local copies
  18 
  19     If the module has a commit SHA entry in the ``modules.json``, the file content is
  20     compared against the files in the remote at this SHA.
  21 
  22     Only runs when linting a pipeline, not the modules repository
  23     """
  24     if module.is_patched:
  25         # If the module is patched, we need to apply
  26         # the patch in reverse before comparing with the remote
  27         tempdir = Path(tempfile.mkdtemp())
  28         shutil.copytree(module.module_dir, tempdir, dirs_exist_ok=True)
  29         try:
  30             new_lines = ModulesDiffer.try_apply_patch(
  31                 module.module_name, module_lint_object.modules_repo.fullname, module.patch_path, tempdir, reverse=True
  32             )
  33             for file, lines in new_lines.items():
  34                 with open(tempdir / file, "w") as fh:
  35                     fh.writelines(lines)
  36         except LookupError:
  37             # This error is already reported by module_patch, so just return
  38             return
  39     else:
  40         tempdir = module.module_dir
  41 
  42     for f, same in module_lint_object.modules_repo.module_files_identical(
  43         module.module_name, tempdir, module.git_sha
  44     ).items():
  45         if same:
  46             module.passed.append(
  47                 (
  48                     "check_local_copy",
  49                     "Local copy of module up to date",
  50                     f"{Path(module.module_dir, f)}",
  51                 )
  52             )
  53         else:
  54             module.failed.append(
  55                 (
  56                     "check_local_copy",
  57                     "Local copy of module does not match remote",
  58                     f"{Path(module.module_dir, f)}",
  59                 )
  60             )
  61
  ```
  --- 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/nf_core/modules/lint/module_changes.py b/nf_core/modules/lint/module_changes.py
  --- a/nf_core/modules/lint/module_changes.py
  +++ b/nf_core/modules/lint/module_changes.py
  @@ -25,7 +25,7 @@
           # If the module is patched, we need to apply
           # the patch in reverse before comparing with the remote
           tempdir = Path(tempfile.mkdtemp())
  -        shutil.copytree(module.module_dir, tempdir, dirs_exist_ok=True)
  +        shutil.copytree(module.module_dir, tempdir)
           try:
               new_lines = ModulesDiffer.try_apply_patch(
                   module.module_name, module_lint_object.modules_repo.fullname, module.patch_path, tempdir, reverse=True
  
verification_info: {"golden_diff": "diff --git a/nf_core/modules/lint/module_changes.py b/nf_core/modules/lint/module_changes.py\n--- a/nf_core/modules/lint/module_changes.py\n+++ b/nf_core/modules/lint/module_changes.py\n@@ -25,7 +25,7 @@\n         # If the module is patched, we need to apply\n         # the patch in reverse before comparing with the remote\n         tempdir = Path(tempfile.mkdtemp())\n-        shutil.copytree(module.module_dir, tempdir, dirs_exist_ok=True)\n+        shutil.copytree(module.module_dir, tempdir)\n         try:\n             new_lines = ModulesDiffer.try_apply_patch(\n                 module.module_name, module_lint_object.modules_repo.fullname, module.patch_path, tempdir, reverse=True\n", "issue": "Use of future functionality\n### Description of the bug\r\n\r\nThe `shutil.copytree` argument [`dirs_exist_ok`](https://docs.python.org/3/library/shutil.html#shutil.copytree) is only available in Python version 3.8+ but nf-core tool still support Python 3.7\r\n\r\nhttps://github.com/nf-core/tools/blob/b5400d84d307343353b6ab09aad204231f74fb0e/nf_core/modules/lint/module_changes.py#L28\r\n\r\nTwo options: drop Python 3.7 support or change that code.\r\n\n", "before_files": [{"content": "\"\"\"\nCheck whether the content of a module has changed compared to the original repository\n\"\"\"\nimport shutil\nimport tempfile\nfrom pathlib import Path\n\nfrom nf_core.modules.modules_differ import ModulesDiffer\n\n\ndef module_changes(module_lint_object, module):\n    \"\"\"\n    Checks whether installed nf-core modules have changed compared to the\n    original repository\n\n    Downloads the ``main.nf`` and ``meta.yml`` files for every module\n    and compares them to the local copies\n\n    If the module has a commit SHA entry in the ``modules.json``, the file content is\n    compared against the files in the remote at this SHA.\n\n    Only runs when linting a pipeline, not the modules repository\n    \"\"\"\n    if module.is_patched:\n        # If the module is patched, we need to apply\n        # the patch in reverse before comparing with the remote\n        tempdir = Path(tempfile.mkdtemp())\n        shutil.copytree(module.module_dir, tempdir, dirs_exist_ok=True)\n        try:\n            new_lines = ModulesDiffer.try_apply_patch(\n                module.module_name, module_lint_object.modules_repo.fullname, module.patch_path, tempdir, reverse=True\n            )\n            for file, lines in new_lines.items():\n                with open(tempdir / file, \"w\") as fh:\n                    fh.writelines(lines)\n        except LookupError:\n            # This error is already reported by module_patch, so just return\n            return\n    else:\n        tempdir = module.module_dir\n\n    for f, same in module_lint_object.modules_repo.module_files_identical(\n        module.module_name, tempdir, module.git_sha\n    ).items():\n        if same:\n            module.passed.append(\n                (\n                    \"check_local_copy\",\n                    \"Local copy of module up to date\",\n                    f\"{Path(module.module_dir, f)}\",\n                )\n            )\n        else:\n            module.failed.append(\n                (\n                    \"check_local_copy\",\n                    \"Local copy of module does not match remote\",\n                    f\"{Path(module.module_dir, f)}\",\n                )\n            )\n", "path": "nf_core/modules/lint/module_changes.py"}], "after_files": [{"content": "\"\"\"\nCheck whether the content of a module has changed compared to the original repository\n\"\"\"\nimport shutil\nimport tempfile\nfrom pathlib import Path\n\nfrom nf_core.modules.modules_differ import ModulesDiffer\n\n\ndef module_changes(module_lint_object, module):\n    \"\"\"\n    Checks whether installed nf-core modules have changed compared to the\n    original repository\n\n    Downloads the ``main.nf`` and ``meta.yml`` files for every module\n    and compares them to the local copies\n\n    If the module has a commit SHA entry in the ``modules.json``, the file content is\n    compared against the files in the remote at this SHA.\n\n    Only runs when linting a pipeline, not the modules repository\n    \"\"\"\n    if module.is_patched:\n        # If the module is patched, we need to apply\n        # the patch in reverse before comparing with the remote\n        tempdir = Path(tempfile.mkdtemp())\n        shutil.copytree(module.module_dir, tempdir)\n        try:\n            new_lines = ModulesDiffer.try_apply_patch(\n                module.module_name, module_lint_object.modules_repo.fullname, module.patch_path, tempdir, reverse=True\n            )\n            for file, lines in new_lines.items():\n                with open(tempdir / file, \"w\") as fh:\n                    fh.writelines(lines)\n        except LookupError:\n            # This error is already reported by module_patch, so just return\n            return\n    else:\n        tempdir = module.module_dir\n\n    for f, same in module_lint_object.modules_repo.module_files_identical(\n        module.module_name, tempdir, module.git_sha\n    ).items():\n        if same:\n            module.passed.append(\n                (\n                    \"check_local_copy\",\n                    \"Local copy of module up to date\",\n                    f\"{Path(module.module_dir, f)}\",\n                )\n            )\n        else:\n            module.failed.append(\n                (\n                    \"check_local_copy\",\n                    \"Local copy of module does not match remote\",\n                    f\"{Path(module.module_dir, f)}\",\n                )\n            )\n", "path": "nf_core/modules/lint/module_changes.py"}]}