We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Tests folder published in version 2.3.201
The wheel of version 2.3.201 contains the tests folder and pollutes the site-packages even though setup.py excludes it explicitly.

--- 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 #!/usr/bin/env python
2 import json
3 import logging
4 import os
5 from importlib import util
6 from os import path
7 from pathlib import Path
8 
9 from setuptools import setup, find_packages
10 from setuptools.command.build_py import build_py
11 
12 
13 class PreBuildCommand(build_py):
14     """Pre-build command"""
15 
16     def transform_graph_yaml_to_json(self) -> None:
17         """Transforms YAML graph checks to JSON and copies them to build/lib"""
18 
19         import yaml  # can't be top-level, because it needs to be first installed via 'setup_requires'
20 
21         graph_check_paths = (
22             "checkov/*/checks/graph_checks",
23         )
24         build_path = Path(self.build_lib)
25         src_path = Path()
26 
27         for graph_check_path in graph_check_paths:
28             for yaml_file in src_path.glob(f"{graph_check_path}/**/*.yaml"):
29                 json_file = (build_path / yaml_file).with_suffix(".json")
30                 self.mkpath(str(json_file.parent))
31                 json_file.write_text(json.dumps(yaml.safe_load(yaml_file.read_text())))
32 
33     def run(self) -> None:
34         self.execute(self.transform_graph_yaml_to_json, ())
35         build_py.run(self)
36 
37 
38 # read the contents of your README file
39 this_directory = path.abspath(path.dirname(__file__))
40 with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
41     long_description = f.read()
42 
43 logger = logging.getLogger(__name__)
44 spec = util.spec_from_file_location(
45     "checkov.version", os.path.join("checkov", "version.py")
46 )
47 # noinspection PyUnresolvedReferences
48 mod = util.module_from_spec(spec)
49 spec.loader.exec_module(mod)  # type: ignore
50 version = mod.version  # type: ignore
51 
52 setup(
53     cmdclass={
54         'build_py': PreBuildCommand,
55     },
56     setup_requires=[
57         "pyyaml",
58     ],
59     extras_require={
60         "dev": [
61             "pytest==5.3.1",
62             "coverage==5.5",
63             "coverage-badge",
64             "GitPython==3.1.7",
65             "bandit",
66             "jsonschema",
67         ]
68     },
69     install_requires=[
70         "bc-python-hcl2==0.3.51",
71         "bc-detect-secrets==1.4.21",
72         "bc-jsonpath-ng==1.5.9",
73         "deep-merge",
74         "tabulate",
75         "colorama",
76         "termcolor",
77         "junit-xml>=1.9",
78         "dpath==2.1.3",
79         "pyyaml>=5.4.1",
80         "boto3>=1.17",
81         "gitpython",
82         "jmespath",
83         "tqdm",
84         "update-checker",
85         "semantic-version",
86         "packaging",
87         "cloudsplaining>=0.4.3",
88         "networkx<2.7",
89         "igraph",
90         "dockerfile-parse",
91         "docker",
92         "configargparse",
93         "argcomplete",
94         "policyuniverse",
95         "typing-extensions>=4.1.0",
96         "importlib-metadata>=0.12",
97         "cachetools",
98         "cyclonedx-python-lib>=2.4.0,<4.0.0",
99         "packageurl-python",
100         "click>=8.0.0",
101         "aiohttp",
102         "aiodns",
103         "aiomultiprocess",
104         "jsonschema<5.0.0,>=4.6.0",
105         "prettytable>=3.0.0",
106         "pycep-parser==0.3.9",
107         "charset-normalizer",
108         "pyston-autoload==2.3.5; python_version < '3.11' and (sys_platform == 'linux' or sys_platform == 'darwin') and platform_machine == 'x86_64' and implementation_name == 'cpython'",
109         "pyston==2.3.5; python_version < '3.11' and (sys_platform == 'linux' or sys_platform == 'darwin') and platform_machine == 'x86_64' and implementation_name == 'cpython'",
110         "schema",
111         "requests>=2.27.0",
112         "yarl",
113         "openai",
114     ],
115     dependency_links=[],  # keep it empty, needed for pipenv-setup
116     license="Apache License 2.0",
117     name="checkov",
118     version=version,
119     python_requires=">=3.7",
120     description="Infrastructure as code static analysis",
121     author="bridgecrew",
122     author_email="meet@bridgecrew.io",
123     url="https://github.com/bridgecrewio/checkov",
124     packages=find_packages(exclude=[
125         "dogfood_tests*",
126         "integration_tests*",
127         "performance_tests*"
128         "tests*",
129     ]),
130     include_package_data=True,
131     package_data={
132         "checkov": ["py.typed"],
133         "checkov.common.util.templates": ["*.jinja2"],
134         "checkov.ansible.checks.graph_checks": ["**/*.json"],
135         "checkov.arm.checks.graph_checks": ["**/*.json"],
136         "checkov.bicep.checks.graph_checks": ["**/*.json"],
137         "checkov.cloudformation.checks.graph_checks": ["**/*.json"],
138         "checkov.dockerfile.checks.graph_checks": ["**/*.json"],
139         "checkov.github_actions.checks.graph_checks": ["**/*.json"],
140         "checkov.kubernetes.checks.graph_checks": ["**/*.json"],
141         "checkov.terraform.checks.graph_checks": ["**/*.json"],
142     },
143     scripts=["bin/checkov", "bin/checkov.cmd"],
144     long_description=long_description,
145     long_description_content_type="text/markdown",
146     classifiers=[
147         "Environment :: Console",
148         "Intended Audience :: Developers",
149         "Intended Audience :: System Administrators",
150         "License :: OSI Approved :: Apache Software License",
151         "Programming Language :: Python :: 3 :: Only",
152         "Programming Language :: Python :: 3.7",
153         "Programming Language :: Python :: 3.8",
154         "Programming Language :: Python :: 3.9",
155         "Programming Language :: Python :: 3.10",
156         "Programming Language :: Python :: 3.11",
157         "Topic :: Security",
158         "Topic :: Software Development :: Build Tools",
159         "Typing :: Typed",
160     ],
161 )
162
```
--- 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
@@ -123,8 +123,9 @@
     url="https://github.com/bridgecrewio/checkov",
     packages=find_packages(exclude=[
         "dogfood_tests*",
+        "flake8_plugins*",
         "integration_tests*",
-        "performance_tests*"
+        "performance_tests*",
         "tests*",
     ]),
     include_package_data=True,

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -123,8 +123,9 @@\n     url=\"https://github.com/bridgecrewio/checkov\",\n     packages=find_packages(exclude=[\n         \"dogfood_tests*\",\n+        \"flake8_plugins*\",\n         \"integration_tests*\",\n-        \"performance_tests*\"\n+        \"performance_tests*\",\n         \"tests*\",\n     ]),\n     include_package_data=True,\n", "issue": "Tests folder published in version 2.3.201\nThe wheel of version 2.3.201 contains the tests folder and pollutes the site-packages even though setup.py excludes it explicitly.\n", "before_files": [{"content": "#!/usr/bin/env python\nimport json\nimport logging\nimport os\nfrom importlib import util\nfrom os import path\nfrom pathlib import Path\n\nfrom setuptools import setup, find_packages\nfrom setuptools.command.build_py import build_py\n\n\nclass PreBuildCommand(build_py):\n    \"\"\"Pre-build command\"\"\"\n\n    def transform_graph_yaml_to_json(self) -> None:\n        \"\"\"Transforms YAML graph checks to JSON and copies them to build/lib\"\"\"\n\n        import yaml  # can't be top-level, because it needs to be first installed via 'setup_requires'\n\n        graph_check_paths = (\n            \"checkov/*/checks/graph_checks\",\n        )\n        build_path = Path(self.build_lib)\n        src_path = Path()\n\n        for graph_check_path in graph_check_paths:\n            for yaml_file in src_path.glob(f\"{graph_check_path}/**/*.yaml\"):\n                json_file = (build_path / yaml_file).with_suffix(\".json\")\n                self.mkpath(str(json_file.parent))\n                json_file.write_text(json.dumps(yaml.safe_load(yaml_file.read_text())))\n\n    def run(self) -> None:\n        self.execute(self.transform_graph_yaml_to_json, ())\n        build_py.run(self)\n\n\n# read the contents of your README file\nthis_directory = path.abspath(path.dirname(__file__))\nwith open(path.join(this_directory, \"README.md\"), encoding=\"utf-8\") as f:\n    long_description = f.read()\n\nlogger = logging.getLogger(__name__)\nspec = util.spec_from_file_location(\n    \"checkov.version\", os.path.join(\"checkov\", \"version.py\")\n)\n# noinspection PyUnresolvedReferences\nmod = util.module_from_spec(spec)\nspec.loader.exec_module(mod)  # type: ignore\nversion = mod.version  # type: ignore\n\nsetup(\n    cmdclass={\n        'build_py': PreBuildCommand,\n    },\n    setup_requires=[\n        \"pyyaml\",\n    ],\n    extras_require={\n        \"dev\": [\n            \"pytest==5.3.1\",\n            \"coverage==5.5\",\n            \"coverage-badge\",\n            \"GitPython==3.1.7\",\n            \"bandit\",\n            \"jsonschema\",\n        ]\n    },\n    install_requires=[\n        \"bc-python-hcl2==0.3.51\",\n        \"bc-detect-secrets==1.4.21\",\n        \"bc-jsonpath-ng==1.5.9\",\n        \"deep-merge\",\n        \"tabulate\",\n        \"colorama\",\n        \"termcolor\",\n        \"junit-xml>=1.9\",\n        \"dpath==2.1.3\",\n        \"pyyaml>=5.4.1\",\n        \"boto3>=1.17\",\n        \"gitpython\",\n        \"jmespath\",\n        \"tqdm\",\n        \"update-checker\",\n        \"semantic-version\",\n        \"packaging\",\n        \"cloudsplaining>=0.4.3\",\n        \"networkx<2.7\",\n        \"igraph\",\n        \"dockerfile-parse\",\n        \"docker\",\n        \"configargparse\",\n        \"argcomplete\",\n        \"policyuniverse\",\n        \"typing-extensions>=4.1.0\",\n        \"importlib-metadata>=0.12\",\n        \"cachetools\",\n        \"cyclonedx-python-lib>=2.4.0,<4.0.0\",\n        \"packageurl-python\",\n        \"click>=8.0.0\",\n        \"aiohttp\",\n        \"aiodns\",\n        \"aiomultiprocess\",\n        \"jsonschema<5.0.0,>=4.6.0\",\n        \"prettytable>=3.0.0\",\n        \"pycep-parser==0.3.9\",\n        \"charset-normalizer\",\n        \"pyston-autoload==2.3.5; python_version < '3.11' and (sys_platform == 'linux' or sys_platform == 'darwin') and platform_machine == 'x86_64' and implementation_name == 'cpython'\",\n        \"pyston==2.3.5; python_version < '3.11' and (sys_platform == 'linux' or sys_platform == 'darwin') and platform_machine == 'x86_64' and implementation_name == 'cpython'\",\n        \"schema\",\n        \"requests>=2.27.0\",\n        \"yarl\",\n        \"openai\",\n    ],\n    dependency_links=[],  # keep it empty, needed for pipenv-setup\n    license=\"Apache License 2.0\",\n    name=\"checkov\",\n    version=version,\n    python_requires=\">=3.7\",\n    description=\"Infrastructure as code static analysis\",\n    author=\"bridgecrew\",\n    author_email=\"meet@bridgecrew.io\",\n    url=\"https://github.com/bridgecrewio/checkov\",\n    packages=find_packages(exclude=[\n        \"dogfood_tests*\",\n        \"integration_tests*\",\n        \"performance_tests*\"\n        \"tests*\",\n    ]),\n    include_package_data=True,\n    package_data={\n        \"checkov\": [\"py.typed\"],\n        \"checkov.common.util.templates\": [\"*.jinja2\"],\n        \"checkov.ansible.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.arm.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.bicep.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.cloudformation.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.dockerfile.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.github_actions.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.kubernetes.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.terraform.checks.graph_checks\": [\"**/*.json\"],\n    },\n    scripts=[\"bin/checkov\", \"bin/checkov.cmd\"],\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    classifiers=[\n        \"Environment :: Console\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: System Administrators\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Programming Language :: Python :: 3 :: Only\",\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        \"Programming Language :: Python :: 3.11\",\n        \"Topic :: Security\",\n        \"Topic :: Software Development :: Build Tools\",\n        \"Typing :: Typed\",\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\nimport json\nimport logging\nimport os\nfrom importlib import util\nfrom os import path\nfrom pathlib import Path\n\nfrom setuptools import setup, find_packages\nfrom setuptools.command.build_py import build_py\n\n\nclass PreBuildCommand(build_py):\n    \"\"\"Pre-build command\"\"\"\n\n    def transform_graph_yaml_to_json(self) -> None:\n        \"\"\"Transforms YAML graph checks to JSON and copies them to build/lib\"\"\"\n\n        import yaml  # can't be top-level, because it needs to be first installed via 'setup_requires'\n\n        graph_check_paths = (\n            \"checkov/*/checks/graph_checks\",\n        )\n        build_path = Path(self.build_lib)\n        src_path = Path()\n\n        for graph_check_path in graph_check_paths:\n            for yaml_file in src_path.glob(f\"{graph_check_path}/**/*.yaml\"):\n                json_file = (build_path / yaml_file).with_suffix(\".json\")\n                self.mkpath(str(json_file.parent))\n                json_file.write_text(json.dumps(yaml.safe_load(yaml_file.read_text())))\n\n    def run(self) -> None:\n        self.execute(self.transform_graph_yaml_to_json, ())\n        build_py.run(self)\n\n\n# read the contents of your README file\nthis_directory = path.abspath(path.dirname(__file__))\nwith open(path.join(this_directory, \"README.md\"), encoding=\"utf-8\") as f:\n    long_description = f.read()\n\nlogger = logging.getLogger(__name__)\nspec = util.spec_from_file_location(\n    \"checkov.version\", os.path.join(\"checkov\", \"version.py\")\n)\n# noinspection PyUnresolvedReferences\nmod = util.module_from_spec(spec)\nspec.loader.exec_module(mod)  # type: ignore\nversion = mod.version  # type: ignore\n\nsetup(\n    cmdclass={\n        'build_py': PreBuildCommand,\n    },\n    setup_requires=[\n        \"pyyaml\",\n    ],\n    extras_require={\n        \"dev\": [\n            \"pytest==5.3.1\",\n            \"coverage==5.5\",\n            \"coverage-badge\",\n            \"GitPython==3.1.7\",\n            \"bandit\",\n            \"jsonschema\",\n        ]\n    },\n    install_requires=[\n        \"bc-python-hcl2==0.3.51\",\n        \"bc-detect-secrets==1.4.21\",\n        \"bc-jsonpath-ng==1.5.9\",\n        \"deep-merge\",\n        \"tabulate\",\n        \"colorama\",\n        \"termcolor\",\n        \"junit-xml>=1.9\",\n        \"dpath==2.1.3\",\n        \"pyyaml>=5.4.1\",\n        \"boto3>=1.17\",\n        \"gitpython\",\n        \"jmespath\",\n        \"tqdm\",\n        \"update-checker\",\n        \"semantic-version\",\n        \"packaging\",\n        \"cloudsplaining>=0.4.3\",\n        \"networkx<2.7\",\n        \"igraph\",\n        \"dockerfile-parse\",\n        \"docker\",\n        \"configargparse\",\n        \"argcomplete\",\n        \"policyuniverse\",\n        \"typing-extensions>=4.1.0\",\n        \"importlib-metadata>=0.12\",\n        \"cachetools\",\n        \"cyclonedx-python-lib>=2.4.0,<4.0.0\",\n        \"packageurl-python\",\n        \"click>=8.0.0\",\n        \"aiohttp\",\n        \"aiodns\",\n        \"aiomultiprocess\",\n        \"jsonschema<5.0.0,>=4.6.0\",\n        \"prettytable>=3.0.0\",\n        \"pycep-parser==0.3.9\",\n        \"charset-normalizer\",\n        \"pyston-autoload==2.3.5; python_version < '3.11' and (sys_platform == 'linux' or sys_platform == 'darwin') and platform_machine == 'x86_64' and implementation_name == 'cpython'\",\n        \"pyston==2.3.5; python_version < '3.11' and (sys_platform == 'linux' or sys_platform == 'darwin') and platform_machine == 'x86_64' and implementation_name == 'cpython'\",\n        \"schema\",\n        \"requests>=2.27.0\",\n        \"yarl\",\n        \"openai\",\n    ],\n    dependency_links=[],  # keep it empty, needed for pipenv-setup\n    license=\"Apache License 2.0\",\n    name=\"checkov\",\n    version=version,\n    python_requires=\">=3.7\",\n    description=\"Infrastructure as code static analysis\",\n    author=\"bridgecrew\",\n    author_email=\"meet@bridgecrew.io\",\n    url=\"https://github.com/bridgecrewio/checkov\",\n    packages=find_packages(exclude=[\n        \"dogfood_tests*\",\n        \"flake8_plugins*\",\n        \"integration_tests*\",\n        \"performance_tests*\",\n        \"tests*\",\n    ]),\n    include_package_data=True,\n    package_data={\n        \"checkov\": [\"py.typed\"],\n        \"checkov.common.util.templates\": [\"*.jinja2\"],\n        \"checkov.ansible.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.arm.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.bicep.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.cloudformation.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.dockerfile.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.github_actions.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.kubernetes.checks.graph_checks\": [\"**/*.json\"],\n        \"checkov.terraform.checks.graph_checks\": [\"**/*.json\"],\n    },\n    scripts=[\"bin/checkov\", \"bin/checkov.cmd\"],\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    classifiers=[\n        \"Environment :: Console\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: System Administrators\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Programming Language :: Python :: 3 :: Only\",\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        \"Programming Language :: Python :: 3.11\",\n        \"Topic :: Security\",\n        \"Topic :: Software Development :: Build Tools\",\n        \"Typing :: Typed\",\n    ],\n)\n", "path": "setup.py"}]}