We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[FEAT] Exclude tests from the package distribution

Currently, the tests folder is shipped with the dist package. This shouldn't happen.

--- 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 # ----------------------------------------------------------------------------
2 # Copyright (C) 2021-2022 Deepchecks (https://www.deepchecks.com)
3 #
4 # This file is part of Deepchecks.
5 # Deepchecks is distributed under the terms of the GNU Affero General
6 # Public License (version 3 or later).
7 # You should have received a copy of the GNU Affero General Public License
8 # along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.
9 # ----------------------------------------------------------------------------
10 #
11 import typing as t
12 import pathlib
13 import setuptools
14 import re
15 from functools import lru_cache
16 
17 
18 DEEPCHECKS = "deepchecks"
19 SUPPORTED_PYTHON_VERSIONS = '>=3.6, <=3.10'
20 
21 SETUP_MODULE = pathlib.Path(__file__).absolute()
22 DEEPCHECKS_DIR = SETUP_MODULE.parent
23 LICENSE_FILE = DEEPCHECKS_DIR / "LICENSE" 
24 VERSION_FILE = DEEPCHECKS_DIR / "VERSION" 
25 DESCRIPTION_FILE = DEEPCHECKS_DIR / "DESCRIPTION.rst" 
26 
27 
28 SEMANTIC_VERSIONING_RE = re.compile(
29    r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)"
30    r"(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)"
31    r"(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))"
32    r"?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
33 )
34 
35 
36 PYTHON_VERSIONING_RE = re.compile(
37     r"^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*"
38     r"((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?"
39     r"(\.dev(0|[1-9][0-9]*))?$"
40 )
41 
42 
43 @lru_cache(maxsize=None)
44 def is_correct_version_string(value: str) -> bool:
45     match = PYTHON_VERSIONING_RE.match(value)
46     return match is not None
47 
48 
49 @lru_cache(maxsize=None)
50 def get_version_string() -> str:
51     if not (VERSION_FILE.exists() and VERSION_FILE.is_file()):
52         raise RuntimeError(
53             "Version file does not exist! "
54             f"(filepath: {str(VERSION_FILE)})")
55     else:
56         version = VERSION_FILE.open("r").readline()
57         if not is_correct_version_string(version):
58             raise RuntimeError(
59                 "Incorrect version string! "
60                 f"(filepath: {str(VERSION_FILE)})"
61             )
62         return version
63 
64 
65 @lru_cache(maxsize=None)
66 def get_description() -> t.Tuple[str, str]:
67     if not (DESCRIPTION_FILE.exists() and DESCRIPTION_FILE.is_file()):
68         raise RuntimeError(
69             "DESCRIPTION.rst file does not exist! "
70             f"(filepath: {str(DESCRIPTION_FILE)})"
71         )
72     else:
73         return (
74             "Package for validating your machine learning model and data", 
75             DESCRIPTION_FILE.open("r", encoding="utf8").read()
76         )
77 
78 
79 def read_requirements_file(path):
80     dependencies = []
81     dependencies_links = []
82     for line in path.open("r").readlines():
83         if "-f" in line or "--find-links" in line:
84             dependencies_links.append(
85                 line
86                 .replace("-f", "")
87                 .replace("--find-links", "")
88                 .strip()
89             )
90         else:
91             dependencies.append(line)
92     return dependencies, dependencies_links
93 
94 
95 @lru_cache(maxsize=None)
96 def read_requirements() -> t.Dict[str,t.List[str]]:
97     requirements_folder = DEEPCHECKS_DIR / "requirements"
98     
99     if not (requirements_folder.exists() and requirements_folder.is_dir()):
100         raise RuntimeError(
101             "Cannot find folder with requirements files."
102             f"(path: {str(requirements_folder)})"
103         )
104     else:
105         main, main_dep_links = read_requirements_file(requirements_folder / "requirements.txt")
106         vision, vision_dep_links = read_requirements_file(requirements_folder / "vision-requirements.txt")
107         nlp, nlp_dep_links = read_requirements_file(requirements_folder / "nlp-requirements.txt")
108 
109         return {
110             "dependency_links": main_dep_links + vision_dep_links,
111             "main": main,
112             "vision": vision,
113             # "nlp": nlp,
114         }
115 
116 
117 # =================================================================================
118 
119 VERSION = get_version_string()
120 short_desc, long_desc = get_description()
121 
122 requirements = read_requirements()
123 main_requirements = requirements.pop('main')
124 dependency_links = requirements.pop('dependency_links', [])
125 extra_requirements = requirements
126 
127 
128 setuptools.setup(
129     # -- description --------------------------------
130     name=DEEPCHECKS,
131     author='deepchecks',  
132     author_email='info@deepchecks.com', 
133     version=VERSION,
134     description=short_desc,
135     long_description=long_desc,
136     keywords = ['Software Development', 'Machine Learning'],
137     classifiers = [
138         'Intended Audience :: Developers',
139         'Intended Audience :: Science/Research',
140         'Topic :: Software Development',
141         'Topic :: Scientific/Engineering',
142         'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
143         'Programming Language :: Python :: 3',
144         'Programming Language :: Python :: 3.6',
145         'Programming Language :: Python :: 3.7',
146         'Programming Language :: Python :: 3.8',
147         'Programming Language :: Python :: 3.9',
148         'Programming Language :: Python :: 3.10',
149     ],
150     license_files=('LICENSE', ),
151     url = 'https://github.com/deepchecks/deepchecks',
152     download_url = "https://github.com/deepchecks/deepchecks/releases/download/{0}/deepchecks-{0}.tar.gz".format(VERSION),
153     project_urls={
154         'Documentation': 'https://docs.deepchecks.com',
155         'Bug Reports': 'https://github.com/deepchecks/deepchecks',
156         'Source': 'https://github.com/deepchecks/deepchecks',
157         'Contribute!': 'https://github.com/deepchecks/deepchecks/blob/master/CONTRIBUTING.md',
158     },
159     
160     # -- dependencies --------------------------------
161     packages=setuptools.find_packages(),
162     install_requires=main_requirements,
163     extras_require=extra_requirements,
164     dependency_links=dependency_links,
165     include_package_data=True,
166 )
167
```
--- 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()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -158,7 +158,7 @@
     },
     
     # -- dependencies --------------------------------
-    packages=setuptools.find_packages(),
+    packages=setuptools.find_packages(exclude=['tests', 'tests.*']),
     install_requires=main_requirements,
     extras_require=extra_requirements,
     dependency_links=dependency_links,

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -158,7 +158,7 @@\n     },\n     \n     # -- dependencies --------------------------------\n-    packages=setuptools.find_packages(),\n+    packages=setuptools.find_packages(exclude=['tests', 'tests.*']),\n     install_requires=main_requirements,\n     extras_require=extra_requirements,\n     dependency_links=dependency_links,\n", "issue": "[FEAT] Exclude tests from the package distribution\n\r\nCurrently, the tests folder is shipped with the dist package. This shouldn't happen.\n", "before_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021-2022 Deepchecks (https://www.deepchecks.com)\n#\n# This file is part of Deepchecks.\n# Deepchecks is distributed under the terms of the GNU Affero General\n# Public License (version 3 or later).\n# You should have received a copy of the GNU Affero General Public License\n# along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.\n# ----------------------------------------------------------------------------\n#\nimport typing as t\nimport pathlib\nimport setuptools\nimport re\nfrom functools import lru_cache\n\n\nDEEPCHECKS = \"deepchecks\"\nSUPPORTED_PYTHON_VERSIONS = '>=3.6, <=3.10'\n\nSETUP_MODULE = pathlib.Path(__file__).absolute()\nDEEPCHECKS_DIR = SETUP_MODULE.parent\nLICENSE_FILE = DEEPCHECKS_DIR / \"LICENSE\" \nVERSION_FILE = DEEPCHECKS_DIR / \"VERSION\" \nDESCRIPTION_FILE = DEEPCHECKS_DIR / \"DESCRIPTION.rst\" \n\n\nSEMANTIC_VERSIONING_RE = re.compile(\n   r\"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\"\n   r\"(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\"\n   r\"(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))\"\n   r\"?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\"\n)\n\n\nPYTHON_VERSIONING_RE = re.compile(\n    r\"^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\\.(0|[1-9][0-9]*))*\"\n    r\"((a|b|rc)(0|[1-9][0-9]*))?(\\.post(0|[1-9][0-9]*))?\"\n    r\"(\\.dev(0|[1-9][0-9]*))?$\"\n)\n\n\n@lru_cache(maxsize=None)\ndef is_correct_version_string(value: str) -> bool:\n    match = PYTHON_VERSIONING_RE.match(value)\n    return match is not None\n\n\n@lru_cache(maxsize=None)\ndef get_version_string() -> str:\n    if not (VERSION_FILE.exists() and VERSION_FILE.is_file()):\n        raise RuntimeError(\n            \"Version file does not exist! \"\n            f\"(filepath: {str(VERSION_FILE)})\")\n    else:\n        version = VERSION_FILE.open(\"r\").readline()\n        if not is_correct_version_string(version):\n            raise RuntimeError(\n                \"Incorrect version string! \"\n                f\"(filepath: {str(VERSION_FILE)})\"\n            )\n        return version\n\n\n@lru_cache(maxsize=None)\ndef get_description() -> t.Tuple[str, str]:\n    if not (DESCRIPTION_FILE.exists() and DESCRIPTION_FILE.is_file()):\n        raise RuntimeError(\n            \"DESCRIPTION.rst file does not exist! \"\n            f\"(filepath: {str(DESCRIPTION_FILE)})\"\n        )\n    else:\n        return (\n            \"Package for validating your machine learning model and data\", \n            DESCRIPTION_FILE.open(\"r\", encoding=\"utf8\").read()\n        )\n\n\ndef read_requirements_file(path):\n    dependencies = []\n    dependencies_links = []\n    for line in path.open(\"r\").readlines():\n        if \"-f\" in line or \"--find-links\" in line:\n            dependencies_links.append(\n                line\n                .replace(\"-f\", \"\")\n                .replace(\"--find-links\", \"\")\n                .strip()\n            )\n        else:\n            dependencies.append(line)\n    return dependencies, dependencies_links\n\n\n@lru_cache(maxsize=None)\ndef read_requirements() -> t.Dict[str,t.List[str]]:\n    requirements_folder = DEEPCHECKS_DIR / \"requirements\"\n    \n    if not (requirements_folder.exists() and requirements_folder.is_dir()):\n        raise RuntimeError(\n            \"Cannot find folder with requirements files.\"\n            f\"(path: {str(requirements_folder)})\"\n        )\n    else:\n        main, main_dep_links = read_requirements_file(requirements_folder / \"requirements.txt\")\n        vision, vision_dep_links = read_requirements_file(requirements_folder / \"vision-requirements.txt\")\n        nlp, nlp_dep_links = read_requirements_file(requirements_folder / \"nlp-requirements.txt\")\n\n        return {\n            \"dependency_links\": main_dep_links + vision_dep_links,\n            \"main\": main,\n            \"vision\": vision,\n            # \"nlp\": nlp,\n        }\n\n\n# =================================================================================\n\nVERSION = get_version_string()\nshort_desc, long_desc = get_description()\n\nrequirements = read_requirements()\nmain_requirements = requirements.pop('main')\ndependency_links = requirements.pop('dependency_links', [])\nextra_requirements = requirements\n\n\nsetuptools.setup(\n    # -- description --------------------------------\n    name=DEEPCHECKS,\n    author='deepchecks',  \n    author_email='info@deepchecks.com', \n    version=VERSION,\n    description=short_desc,\n    long_description=long_desc,\n    keywords = ['Software Development', 'Machine Learning'],\n    classifiers = [\n        'Intended Audience :: Developers',\n        'Intended Audience :: Science/Research',\n        'Topic :: Software Development',\n        'Topic :: Scientific/Engineering',\n        'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'Programming Language :: Python :: 3.10',\n    ],\n    license_files=('LICENSE', ),\n    url = 'https://github.com/deepchecks/deepchecks',\n    download_url = \"https://github.com/deepchecks/deepchecks/releases/download/{0}/deepchecks-{0}.tar.gz\".format(VERSION),\n    project_urls={\n        'Documentation': 'https://docs.deepchecks.com',\n        'Bug Reports': 'https://github.com/deepchecks/deepchecks',\n        'Source': 'https://github.com/deepchecks/deepchecks',\n        'Contribute!': 'https://github.com/deepchecks/deepchecks/blob/master/CONTRIBUTING.md',\n    },\n    \n    # -- dependencies --------------------------------\n    packages=setuptools.find_packages(),\n    install_requires=main_requirements,\n    extras_require=extra_requirements,\n    dependency_links=dependency_links,\n    include_package_data=True,\n)\n", "path": "setup.py"}], "after_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021-2022 Deepchecks (https://www.deepchecks.com)\n#\n# This file is part of Deepchecks.\n# Deepchecks is distributed under the terms of the GNU Affero General\n# Public License (version 3 or later).\n# You should have received a copy of the GNU Affero General Public License\n# along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.\n# ----------------------------------------------------------------------------\n#\nimport typing as t\nimport pathlib\nimport setuptools\nimport re\nfrom functools import lru_cache\n\n\nDEEPCHECKS = \"deepchecks\"\nSUPPORTED_PYTHON_VERSIONS = '>=3.6, <=3.10'\n\nSETUP_MODULE = pathlib.Path(__file__).absolute()\nDEEPCHECKS_DIR = SETUP_MODULE.parent\nLICENSE_FILE = DEEPCHECKS_DIR / \"LICENSE\" \nVERSION_FILE = DEEPCHECKS_DIR / \"VERSION\" \nDESCRIPTION_FILE = DEEPCHECKS_DIR / \"DESCRIPTION.rst\" \n\n\nSEMANTIC_VERSIONING_RE = re.compile(\n   r\"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\"\n   r\"(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\"\n   r\"(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))\"\n   r\"?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\"\n)\n\n\nPYTHON_VERSIONING_RE = re.compile(\n    r\"^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\\.(0|[1-9][0-9]*))*\"\n    r\"((a|b|rc)(0|[1-9][0-9]*))?(\\.post(0|[1-9][0-9]*))?\"\n    r\"(\\.dev(0|[1-9][0-9]*))?$\"\n)\n\n\n@lru_cache(maxsize=None)\ndef is_correct_version_string(value: str) -> bool:\n    match = PYTHON_VERSIONING_RE.match(value)\n    return match is not None\n\n\n@lru_cache(maxsize=None)\ndef get_version_string() -> str:\n    if not (VERSION_FILE.exists() and VERSION_FILE.is_file()):\n        raise RuntimeError(\n            \"Version file does not exist! \"\n            f\"(filepath: {str(VERSION_FILE)})\")\n    else:\n        version = VERSION_FILE.open(\"r\").readline()\n        if not is_correct_version_string(version):\n            raise RuntimeError(\n                \"Incorrect version string! \"\n                f\"(filepath: {str(VERSION_FILE)})\"\n            )\n        return version\n\n\n@lru_cache(maxsize=None)\ndef get_description() -> t.Tuple[str, str]:\n    if not (DESCRIPTION_FILE.exists() and DESCRIPTION_FILE.is_file()):\n        raise RuntimeError(\n            \"DESCRIPTION.rst file does not exist! \"\n            f\"(filepath: {str(DESCRIPTION_FILE)})\"\n        )\n    else:\n        return (\n            \"Package for validating your machine learning model and data\", \n            DESCRIPTION_FILE.open(\"r\", encoding=\"utf8\").read()\n        )\n\n\ndef read_requirements_file(path):\n    dependencies = []\n    dependencies_links = []\n    for line in path.open(\"r\").readlines():\n        if \"-f\" in line or \"--find-links\" in line:\n            dependencies_links.append(\n                line\n                .replace(\"-f\", \"\")\n                .replace(\"--find-links\", \"\")\n                .strip()\n            )\n        else:\n            dependencies.append(line)\n    return dependencies, dependencies_links\n\n\n@lru_cache(maxsize=None)\ndef read_requirements() -> t.Dict[str,t.List[str]]:\n    requirements_folder = DEEPCHECKS_DIR / \"requirements\"\n    \n    if not (requirements_folder.exists() and requirements_folder.is_dir()):\n        raise RuntimeError(\n            \"Cannot find folder with requirements files.\"\n            f\"(path: {str(requirements_folder)})\"\n        )\n    else:\n        main, main_dep_links = read_requirements_file(requirements_folder / \"requirements.txt\")\n        vision, vision_dep_links = read_requirements_file(requirements_folder / \"vision-requirements.txt\")\n        nlp, nlp_dep_links = read_requirements_file(requirements_folder / \"nlp-requirements.txt\")\n\n        return {\n            \"dependency_links\": main_dep_links + vision_dep_links,\n            \"main\": main,\n            \"vision\": vision,\n            # \"nlp\": nlp,\n        }\n\n\n# =================================================================================\n\nVERSION = get_version_string()\nshort_desc, long_desc = get_description()\n\nrequirements = read_requirements()\nmain_requirements = requirements.pop('main')\ndependency_links = requirements.pop('dependency_links', [])\nextra_requirements = requirements\n\n\nsetuptools.setup(\n    # -- description --------------------------------\n    name=DEEPCHECKS,\n    author='deepchecks',  \n    author_email='info@deepchecks.com', \n    version=VERSION,\n    description=short_desc,\n    long_description=long_desc,\n    keywords = ['Software Development', 'Machine Learning'],\n    classifiers = [\n        'Intended Audience :: Developers',\n        'Intended Audience :: Science/Research',\n        'Topic :: Software Development',\n        'Topic :: Scientific/Engineering',\n        'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'Programming Language :: Python :: 3.10',\n    ],\n    license_files=('LICENSE', ),\n    url = 'https://github.com/deepchecks/deepchecks',\n    download_url = \"https://github.com/deepchecks/deepchecks/releases/download/{0}/deepchecks-{0}.tar.gz\".format(VERSION),\n    project_urls={\n        'Documentation': 'https://docs.deepchecks.com',\n        'Bug Reports': 'https://github.com/deepchecks/deepchecks',\n        'Source': 'https://github.com/deepchecks/deepchecks',\n        'Contribute!': 'https://github.com/deepchecks/deepchecks/blob/master/CONTRIBUTING.md',\n    },\n    \n    # -- dependencies --------------------------------\n    packages=setuptools.find_packages(exclude=['tests', 'tests.*']),\n    install_requires=main_requirements,\n    extras_require=extra_requirements,\n    dependency_links=dependency_links,\n    include_package_data=True,\n)\n", "path": "setup.py"}]}