We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
mypy stub files
mypy throws an error when ddtrace is in use:

![image](https://user-images.githubusercontent.com/284476/58525411-a7ff0c00-8199-11e9-8bcb-770aeeeda3fb.png)


It would be nice if this library could ship with stub files or be put on https://github.com/python/typeshed. I'm not sure how to do that yet but maybe someone here is.

More info from mypy side here https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports

--- 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 import os
2 import platform
3 import sys
4 
5 from setuptools import setup, find_packages, Extension
6 from setuptools.command.test import test as TestCommand
7 
8 # ORDER MATTERS
9 # Import this after setuptools or it will fail
10 from Cython.Build import cythonize  # noqa: I100
11 import Cython.Distutils
12 
13 
14 HERE = os.path.dirname(os.path.abspath(__file__))
15 
16 
17 def load_module_from_project_file(mod_name, fname):
18     """
19     Helper used to load a module from a file in this project
20 
21     DEV: Loading this way will by-pass loading all parent modules
22          e.g. importing `ddtrace.vendor.psutil.setup` will load `ddtrace/__init__.py`
23          which has side effects like loading the tracer
24     """
25     fpath = os.path.join(HERE, fname)
26 
27     if sys.version_info >= (3, 5):
28         import importlib.util
29 
30         spec = importlib.util.spec_from_file_location(mod_name, fpath)
31         mod = importlib.util.module_from_spec(spec)
32         spec.loader.exec_module(mod)
33         return mod
34     elif sys.version_info >= (3, 3):
35         from importlib.machinery import SourceFileLoader
36 
37         return SourceFileLoader(mod_name, fpath).load_module()
38     else:
39         import imp
40 
41         return imp.load_source(mod_name, fpath)
42 
43 
44 class Tox(TestCommand):
45 
46     user_options = [("tox-args=", "a", "Arguments to pass to tox")]
47 
48     def initialize_options(self):
49         TestCommand.initialize_options(self)
50         self.tox_args = None
51 
52     def finalize_options(self):
53         TestCommand.finalize_options(self)
54         self.test_args = []
55         self.test_suite = True
56 
57     def run_tests(self):
58         # import here, cause outside the eggs aren't loaded
59         import tox
60         import shlex
61 
62         args = self.tox_args
63         if args:
64             args = shlex.split(self.tox_args)
65         errno = tox.cmdline(args=args)
66         sys.exit(errno)
67 
68 
69 long_description = """
70 # dd-trace-py
71 
72 `ddtrace` is Datadog's tracing library for Python.  It is used to trace requests
73 as they flow across web servers, databases and microservices so that developers
74 have great visibility into bottlenecks and troublesome requests.
75 
76 ## Getting Started
77 
78 For a basic product overview, installation and quick start, check out our
79 [setup documentation][setup docs].
80 
81 For more advanced usage and configuration, check out our [API
82 documentation][api docs].
83 
84 For descriptions of terminology used in APM, take a look at the [official
85 documentation][visualization docs].
86 
87 [setup docs]: https://docs.datadoghq.com/tracing/setup/python/
88 [api docs]: https://ddtrace.readthedocs.io/
89 [visualization docs]: https://docs.datadoghq.com/tracing/visualization/
90 """
91 
92 
93 def get_exts_for(name):
94     try:
95         mod = load_module_from_project_file(
96             "ddtrace.vendor.{}.setup".format(name), "ddtrace/vendor/{}/setup.py".format(name)
97         )
98         return mod.get_extensions()
99     except Exception as e:
100         print("WARNING: Failed to load %s extensions, skipping: %s" % (name, e))
101         return []
102 
103 
104 if sys.byteorder == "big":
105     encoding_macros = [("__BIG_ENDIAN__", "1")]
106 else:
107     encoding_macros = [("__LITTLE_ENDIAN__", "1")]
108 
109 
110 if platform.system() == "Windows":
111     encoding_libraries = ["ws2_32"]
112     extra_compile_args = []
113     debug_compile_args = []
114 else:
115     encoding_libraries = []
116     extra_compile_args = ["-DPy_BUILD_CORE"]
117     if "DD_COMPILE_DEBUG" in os.environ:
118         if platform.system() == "Linux":
119             debug_compile_args = ["-g", "-O0", "-Werror", "-Wall", "-Wextra", "-Wpedantic", "-fanalyzer"]
120         else:
121             debug_compile_args = [
122                 "-g",
123                 "-O0",
124                 "-Werror",
125                 "-Wall",
126                 "-Wextra",
127                 "-Wpedantic",
128                 # Cython is not deprecation-proof
129                 "-Wno-deprecated-declarations",
130             ]
131     else:
132         debug_compile_args = []
133 
134 
135 if sys.version_info[:2] >= (3, 4):
136     ext_modules = [
137         Extension(
138             "ddtrace.profiling.collector._memalloc",
139             sources=[
140                 "ddtrace/profiling/collector/_memalloc.c",
141                 "ddtrace/profiling/collector/_memalloc_tb.c",
142                 "ddtrace/profiling/collector/_memalloc_heap.c",
143             ],
144             extra_compile_args=debug_compile_args,
145         ),
146     ]
147 else:
148     ext_modules = []
149 
150 setup(
151     name="ddtrace",
152     description="Datadog tracing code",
153     url="https://github.com/DataDog/dd-trace-py",
154     author="Datadog, Inc.",
155     author_email="dev@datadoghq.com",
156     long_description=long_description,
157     long_description_content_type="text/markdown",
158     license="BSD",
159     packages=find_packages(exclude=["tests*"]),
160     py_modules=["ddtrace_gevent_check"],
161     python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
162     # enum34 is an enum backport for earlier versions of python
163     # funcsigs backport required for vendored debtcollector
164     install_requires=[
165         "enum34; python_version<'3.4'",
166         "funcsigs>=1.0.0; python_version=='2.7'",
167         "typing; python_version<'3.5'",
168         "packaging>=17.1",
169         "protobuf>=3",
170         "tenacity>=5",
171         "attrs>=19.2.0",
172         "six>=1.12.0",
173         "pep562; python_version<'3.7'",
174     ],
175     extras_require={
176         # users can include opentracing by having:
177         # install_requires=['ddtrace[opentracing]', ...]
178         "opentracing": ["opentracing>=2.0.0"],
179     },
180     # plugin tox
181     tests_require=["tox", "flake8"],
182     cmdclass={"test": Tox},
183     entry_points={
184         "console_scripts": [
185             "ddtrace-run = ddtrace.commands.ddtrace_run:main",
186         ],
187         "pytest11": ["ddtrace = ddtrace.contrib.pytest.plugin"],
188         "gevent.plugins.monkey.did_patch_all": [
189             "ddtrace_gevent_check = ddtrace_gevent_check:gevent_patch_all",
190         ],
191     },
192     classifiers=[
193         "Programming Language :: Python",
194         "Programming Language :: Python :: 2.7",
195         "Programming Language :: Python :: 3.5",
196         "Programming Language :: Python :: 3.6",
197         "Programming Language :: Python :: 3.7",
198         "Programming Language :: Python :: 3.8",
199         "Programming Language :: Python :: 3.9",
200     ],
201     use_scm_version=True,
202     setup_requires=["setuptools_scm[toml]>=4", "cython"],
203     ext_modules=ext_modules
204     + cythonize(
205         [
206             Cython.Distutils.Extension(
207                 "ddtrace.internal._rand",
208                 sources=["ddtrace/internal/_rand.pyx"],
209                 language="c",
210             ),
211             Extension(
212                 "ddtrace.internal._encoding",
213                 ["ddtrace/internal/_encoding.pyx"],
214                 include_dirs=["."],
215                 libraries=encoding_libraries,
216                 define_macros=encoding_macros,
217             ),
218             Cython.Distutils.Extension(
219                 "ddtrace.profiling.collector.stack",
220                 sources=["ddtrace/profiling/collector/stack.pyx"],
221                 language="c",
222                 extra_compile_args=extra_compile_args,
223             ),
224             Cython.Distutils.Extension(
225                 "ddtrace.profiling.collector._traceback",
226                 sources=["ddtrace/profiling/collector/_traceback.pyx"],
227                 language="c",
228             ),
229             Cython.Distutils.Extension(
230                 "ddtrace.profiling.collector._threading",
231                 sources=["ddtrace/profiling/collector/_threading.pyx"],
232                 language="c",
233             ),
234             Cython.Distutils.Extension(
235                 "ddtrace.profiling.exporter.pprof",
236                 sources=["ddtrace/profiling/exporter/pprof.pyx"],
237                 language="c",
238             ),
239             Cython.Distutils.Extension(
240                 "ddtrace.profiling._build",
241                 sources=["ddtrace/profiling/_build.pyx"],
242                 language="c",
243             ),
244         ],
245         compile_time_env={
246             "PY_MAJOR_VERSION": sys.version_info.major,
247             "PY_MINOR_VERSION": sys.version_info.minor,
248             "PY_MICRO_VERSION": sys.version_info.micro,
249         },
250         force=True,
251     )
252     + get_exts_for("wrapt")
253     + get_exts_for("psutil"),
254 )
255
```
--- 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
@@ -157,8 +157,10 @@
     long_description_content_type="text/markdown",
     license="BSD",
     packages=find_packages(exclude=["tests*"]),
+    package_data={"ddtrace": ["py.typed"]},
     py_modules=["ddtrace_gevent_check"],
     python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
+    zip_safe=False,
     # enum34 is an enum backport for earlier versions of python
     # funcsigs backport required for vendored debtcollector
     install_requires=[

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -157,8 +157,10 @@\n     long_description_content_type=\"text/markdown\",\n     license=\"BSD\",\n     packages=find_packages(exclude=[\"tests*\"]),\n+    package_data={\"ddtrace\": [\"py.typed\"]},\n     py_modules=[\"ddtrace_gevent_check\"],\n     python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*\",\n+    zip_safe=False,\n     # enum34 is an enum backport for earlier versions of python\n     # funcsigs backport required for vendored debtcollector\n     install_requires=[\n", "issue": "mypy stub files\nmypy throws an error when ddtrace is in use:\r\n\r\n![image](https://user-images.githubusercontent.com/284476/58525411-a7ff0c00-8199-11e9-8bcb-770aeeeda3fb.png)\r\n\r\n\r\nIt would be nice if this library could ship with stub files or be put on https://github.com/python/typeshed. I'm not sure how to do that yet but maybe someone here is.\r\n\r\nMore info from mypy side here https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports\n", "before_files": [{"content": "import os\nimport platform\nimport sys\n\nfrom setuptools import setup, find_packages, Extension\nfrom setuptools.command.test import test as TestCommand\n\n# ORDER MATTERS\n# Import this after setuptools or it will fail\nfrom Cython.Build import cythonize  # noqa: I100\nimport Cython.Distutils\n\n\nHERE = os.path.dirname(os.path.abspath(__file__))\n\n\ndef load_module_from_project_file(mod_name, fname):\n    \"\"\"\n    Helper used to load a module from a file in this project\n\n    DEV: Loading this way will by-pass loading all parent modules\n         e.g. importing `ddtrace.vendor.psutil.setup` will load `ddtrace/__init__.py`\n         which has side effects like loading the tracer\n    \"\"\"\n    fpath = os.path.join(HERE, fname)\n\n    if sys.version_info >= (3, 5):\n        import importlib.util\n\n        spec = importlib.util.spec_from_file_location(mod_name, fpath)\n        mod = importlib.util.module_from_spec(spec)\n        spec.loader.exec_module(mod)\n        return mod\n    elif sys.version_info >= (3, 3):\n        from importlib.machinery import SourceFileLoader\n\n        return SourceFileLoader(mod_name, fpath).load_module()\n    else:\n        import imp\n\n        return imp.load_source(mod_name, fpath)\n\n\nclass Tox(TestCommand):\n\n    user_options = [(\"tox-args=\", \"a\", \"Arguments to pass to tox\")]\n\n    def initialize_options(self):\n        TestCommand.initialize_options(self)\n        self.tox_args = None\n\n    def finalize_options(self):\n        TestCommand.finalize_options(self)\n        self.test_args = []\n        self.test_suite = True\n\n    def run_tests(self):\n        # import here, cause outside the eggs aren't loaded\n        import tox\n        import shlex\n\n        args = self.tox_args\n        if args:\n            args = shlex.split(self.tox_args)\n        errno = tox.cmdline(args=args)\n        sys.exit(errno)\n\n\nlong_description = \"\"\"\n# dd-trace-py\n\n`ddtrace` is Datadog's tracing library for Python.  It is used to trace requests\nas they flow across web servers, databases and microservices so that developers\nhave great visibility into bottlenecks and troublesome requests.\n\n## Getting Started\n\nFor a basic product overview, installation and quick start, check out our\n[setup documentation][setup docs].\n\nFor more advanced usage and configuration, check out our [API\ndocumentation][api docs].\n\nFor descriptions of terminology used in APM, take a look at the [official\ndocumentation][visualization docs].\n\n[setup docs]: https://docs.datadoghq.com/tracing/setup/python/\n[api docs]: https://ddtrace.readthedocs.io/\n[visualization docs]: https://docs.datadoghq.com/tracing/visualization/\n\"\"\"\n\n\ndef get_exts_for(name):\n    try:\n        mod = load_module_from_project_file(\n            \"ddtrace.vendor.{}.setup\".format(name), \"ddtrace/vendor/{}/setup.py\".format(name)\n        )\n        return mod.get_extensions()\n    except Exception as e:\n        print(\"WARNING: Failed to load %s extensions, skipping: %s\" % (name, e))\n        return []\n\n\nif sys.byteorder == \"big\":\n    encoding_macros = [(\"__BIG_ENDIAN__\", \"1\")]\nelse:\n    encoding_macros = [(\"__LITTLE_ENDIAN__\", \"1\")]\n\n\nif platform.system() == \"Windows\":\n    encoding_libraries = [\"ws2_32\"]\n    extra_compile_args = []\n    debug_compile_args = []\nelse:\n    encoding_libraries = []\n    extra_compile_args = [\"-DPy_BUILD_CORE\"]\n    if \"DD_COMPILE_DEBUG\" in os.environ:\n        if platform.system() == \"Linux\":\n            debug_compile_args = [\"-g\", \"-O0\", \"-Werror\", \"-Wall\", \"-Wextra\", \"-Wpedantic\", \"-fanalyzer\"]\n        else:\n            debug_compile_args = [\n                \"-g\",\n                \"-O0\",\n                \"-Werror\",\n                \"-Wall\",\n                \"-Wextra\",\n                \"-Wpedantic\",\n                # Cython is not deprecation-proof\n                \"-Wno-deprecated-declarations\",\n            ]\n    else:\n        debug_compile_args = []\n\n\nif sys.version_info[:2] >= (3, 4):\n    ext_modules = [\n        Extension(\n            \"ddtrace.profiling.collector._memalloc\",\n            sources=[\n                \"ddtrace/profiling/collector/_memalloc.c\",\n                \"ddtrace/profiling/collector/_memalloc_tb.c\",\n                \"ddtrace/profiling/collector/_memalloc_heap.c\",\n            ],\n            extra_compile_args=debug_compile_args,\n        ),\n    ]\nelse:\n    ext_modules = []\n\nsetup(\n    name=\"ddtrace\",\n    description=\"Datadog tracing code\",\n    url=\"https://github.com/DataDog/dd-trace-py\",\n    author=\"Datadog, Inc.\",\n    author_email=\"dev@datadoghq.com\",\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    license=\"BSD\",\n    packages=find_packages(exclude=[\"tests*\"]),\n    py_modules=[\"ddtrace_gevent_check\"],\n    python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*\",\n    # enum34 is an enum backport for earlier versions of python\n    # funcsigs backport required for vendored debtcollector\n    install_requires=[\n        \"enum34; python_version<'3.4'\",\n        \"funcsigs>=1.0.0; python_version=='2.7'\",\n        \"typing; python_version<'3.5'\",\n        \"packaging>=17.1\",\n        \"protobuf>=3\",\n        \"tenacity>=5\",\n        \"attrs>=19.2.0\",\n        \"six>=1.12.0\",\n        \"pep562; python_version<'3.7'\",\n    ],\n    extras_require={\n        # users can include opentracing by having:\n        # install_requires=['ddtrace[opentracing]', ...]\n        \"opentracing\": [\"opentracing>=2.0.0\"],\n    },\n    # plugin tox\n    tests_require=[\"tox\", \"flake8\"],\n    cmdclass={\"test\": Tox},\n    entry_points={\n        \"console_scripts\": [\n            \"ddtrace-run = ddtrace.commands.ddtrace_run:main\",\n        ],\n        \"pytest11\": [\"ddtrace = ddtrace.contrib.pytest.plugin\"],\n        \"gevent.plugins.monkey.did_patch_all\": [\n            \"ddtrace_gevent_check = ddtrace_gevent_check:gevent_patch_all\",\n        ],\n    },\n    classifiers=[\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3.5\",\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    ],\n    use_scm_version=True,\n    setup_requires=[\"setuptools_scm[toml]>=4\", \"cython\"],\n    ext_modules=ext_modules\n    + cythonize(\n        [\n            Cython.Distutils.Extension(\n                \"ddtrace.internal._rand\",\n                sources=[\"ddtrace/internal/_rand.pyx\"],\n                language=\"c\",\n            ),\n            Extension(\n                \"ddtrace.internal._encoding\",\n                [\"ddtrace/internal/_encoding.pyx\"],\n                include_dirs=[\".\"],\n                libraries=encoding_libraries,\n                define_macros=encoding_macros,\n            ),\n            Cython.Distutils.Extension(\n                \"ddtrace.profiling.collector.stack\",\n                sources=[\"ddtrace/profiling/collector/stack.pyx\"],\n                language=\"c\",\n                extra_compile_args=extra_compile_args,\n            ),\n            Cython.Distutils.Extension(\n                \"ddtrace.profiling.collector._traceback\",\n                sources=[\"ddtrace/profiling/collector/_traceback.pyx\"],\n                language=\"c\",\n            ),\n            Cython.Distutils.Extension(\n                \"ddtrace.profiling.collector._threading\",\n                sources=[\"ddtrace/profiling/collector/_threading.pyx\"],\n                language=\"c\",\n            ),\n            Cython.Distutils.Extension(\n                \"ddtrace.profiling.exporter.pprof\",\n                sources=[\"ddtrace/profiling/exporter/pprof.pyx\"],\n                language=\"c\",\n            ),\n            Cython.Distutils.Extension(\n                \"ddtrace.profiling._build\",\n                sources=[\"ddtrace/profiling/_build.pyx\"],\n                language=\"c\",\n            ),\n        ],\n        compile_time_env={\n            \"PY_MAJOR_VERSION\": sys.version_info.major,\n            \"PY_MINOR_VERSION\": sys.version_info.minor,\n            \"PY_MICRO_VERSION\": sys.version_info.micro,\n        },\n        force=True,\n    )\n    + get_exts_for(\"wrapt\")\n    + get_exts_for(\"psutil\"),\n)\n", "path": "setup.py"}], "after_files": [{"content": "import os\nimport platform\nimport sys\n\nfrom setuptools import setup, find_packages, Extension\nfrom setuptools.command.test import test as TestCommand\n\n# ORDER MATTERS\n# Import this after setuptools or it will fail\nfrom Cython.Build import cythonize  # noqa: I100\nimport Cython.Distutils\n\n\nHERE = os.path.dirname(os.path.abspath(__file__))\n\n\ndef load_module_from_project_file(mod_name, fname):\n    \"\"\"\n    Helper used to load a module from a file in this project\n\n    DEV: Loading this way will by-pass loading all parent modules\n         e.g. importing `ddtrace.vendor.psutil.setup` will load `ddtrace/__init__.py`\n         which has side effects like loading the tracer\n    \"\"\"\n    fpath = os.path.join(HERE, fname)\n\n    if sys.version_info >= (3, 5):\n        import importlib.util\n\n        spec = importlib.util.spec_from_file_location(mod_name, fpath)\n        mod = importlib.util.module_from_spec(spec)\n        spec.loader.exec_module(mod)\n        return mod\n    elif sys.version_info >= (3, 3):\n        from importlib.machinery import SourceFileLoader\n\n        return SourceFileLoader(mod_name, fpath).load_module()\n    else:\n        import imp\n\n        return imp.load_source(mod_name, fpath)\n\n\nclass Tox(TestCommand):\n\n    user_options = [(\"tox-args=\", \"a\", \"Arguments to pass to tox\")]\n\n    def initialize_options(self):\n        TestCommand.initialize_options(self)\n        self.tox_args = None\n\n    def finalize_options(self):\n        TestCommand.finalize_options(self)\n        self.test_args = []\n        self.test_suite = True\n\n    def run_tests(self):\n        # import here, cause outside the eggs aren't loaded\n        import tox\n        import shlex\n\n        args = self.tox_args\n        if args:\n            args = shlex.split(self.tox_args)\n        errno = tox.cmdline(args=args)\n        sys.exit(errno)\n\n\nlong_description = \"\"\"\n# dd-trace-py\n\n`ddtrace` is Datadog's tracing library for Python.  It is used to trace requests\nas they flow across web servers, databases and microservices so that developers\nhave great visibility into bottlenecks and troublesome requests.\n\n## Getting Started\n\nFor a basic product overview, installation and quick start, check out our\n[setup documentation][setup docs].\n\nFor more advanced usage and configuration, check out our [API\ndocumentation][api docs].\n\nFor descriptions of terminology used in APM, take a look at the [official\ndocumentation][visualization docs].\n\n[setup docs]: https://docs.datadoghq.com/tracing/setup/python/\n[api docs]: https://ddtrace.readthedocs.io/\n[visualization docs]: https://docs.datadoghq.com/tracing/visualization/\n\"\"\"\n\n\ndef get_exts_for(name):\n    try:\n        mod = load_module_from_project_file(\n            \"ddtrace.vendor.{}.setup\".format(name), \"ddtrace/vendor/{}/setup.py\".format(name)\n        )\n        return mod.get_extensions()\n    except Exception as e:\n        print(\"WARNING: Failed to load %s extensions, skipping: %s\" % (name, e))\n        return []\n\n\nif sys.byteorder == \"big\":\n    encoding_macros = [(\"__BIG_ENDIAN__\", \"1\")]\nelse:\n    encoding_macros = [(\"__LITTLE_ENDIAN__\", \"1\")]\n\n\nif platform.system() == \"Windows\":\n    encoding_libraries = [\"ws2_32\"]\n    extra_compile_args = []\n    debug_compile_args = []\nelse:\n    encoding_libraries = []\n    extra_compile_args = [\"-DPy_BUILD_CORE\"]\n    if \"DD_COMPILE_DEBUG\" in os.environ:\n        if platform.system() == \"Linux\":\n            debug_compile_args = [\"-g\", \"-O0\", \"-Werror\", \"-Wall\", \"-Wextra\", \"-Wpedantic\", \"-fanalyzer\"]\n        else:\n            debug_compile_args = [\n                \"-g\",\n                \"-O0\",\n                \"-Werror\",\n                \"-Wall\",\n                \"-Wextra\",\n                \"-Wpedantic\",\n                # Cython is not deprecation-proof\n                \"-Wno-deprecated-declarations\",\n            ]\n    else:\n        debug_compile_args = []\n\n\nif sys.version_info[:2] >= (3, 4):\n    ext_modules = [\n        Extension(\n            \"ddtrace.profiling.collector._memalloc\",\n            sources=[\n                \"ddtrace/profiling/collector/_memalloc.c\",\n                \"ddtrace/profiling/collector/_memalloc_tb.c\",\n                \"ddtrace/profiling/collector/_memalloc_heap.c\",\n            ],\n            extra_compile_args=debug_compile_args,\n        ),\n    ]\nelse:\n    ext_modules = []\n\nsetup(\n    name=\"ddtrace\",\n    description=\"Datadog tracing code\",\n    url=\"https://github.com/DataDog/dd-trace-py\",\n    author=\"Datadog, Inc.\",\n    author_email=\"dev@datadoghq.com\",\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    license=\"BSD\",\n    packages=find_packages(exclude=[\"tests*\"]),\n    package_data={\"ddtrace\": [\"py.typed\"]},\n    py_modules=[\"ddtrace_gevent_check\"],\n    python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*\",\n    zip_safe=False,\n    # enum34 is an enum backport for earlier versions of python\n    # funcsigs backport required for vendored debtcollector\n    install_requires=[\n        \"enum34; python_version<'3.4'\",\n        \"funcsigs>=1.0.0; python_version=='2.7'\",\n        \"typing; python_version<'3.5'\",\n        \"packaging>=17.1\",\n        \"protobuf>=3\",\n        \"tenacity>=5\",\n        \"attrs>=19.2.0\",\n        \"six>=1.12.0\",\n        \"pep562; python_version<'3.7'\",\n    ],\n    extras_require={\n        # users can include opentracing by having:\n        # install_requires=['ddtrace[opentracing]', ...]\n        \"opentracing\": [\"opentracing>=2.0.0\"],\n    },\n    # plugin tox\n    tests_require=[\"tox\", \"flake8\"],\n    cmdclass={\"test\": Tox},\n    entry_points={\n        \"console_scripts\": [\n            \"ddtrace-run = ddtrace.commands.ddtrace_run:main\",\n        ],\n        \"pytest11\": [\"ddtrace = ddtrace.contrib.pytest.plugin\"],\n        \"gevent.plugins.monkey.did_patch_all\": [\n            \"ddtrace_gevent_check = ddtrace_gevent_check:gevent_patch_all\",\n        ],\n    },\n    classifiers=[\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3.5\",\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    ],\n    use_scm_version=True,\n    setup_requires=[\"setuptools_scm[toml]>=4\", \"cython\"],\n    ext_modules=ext_modules\n    + cythonize(\n        [\n            Cython.Distutils.Extension(\n                \"ddtrace.internal._rand\",\n                sources=[\"ddtrace/internal/_rand.pyx\"],\n                language=\"c\",\n            ),\n            Extension(\n                \"ddtrace.internal._encoding\",\n                [\"ddtrace/internal/_encoding.pyx\"],\n                include_dirs=[\".\"],\n                libraries=encoding_libraries,\n                define_macros=encoding_macros,\n            ),\n            Cython.Distutils.Extension(\n                \"ddtrace.profiling.collector.stack\",\n                sources=[\"ddtrace/profiling/collector/stack.pyx\"],\n                language=\"c\",\n                extra_compile_args=extra_compile_args,\n            ),\n            Cython.Distutils.Extension(\n                \"ddtrace.profiling.collector._traceback\",\n                sources=[\"ddtrace/profiling/collector/_traceback.pyx\"],\n                language=\"c\",\n            ),\n            Cython.Distutils.Extension(\n                \"ddtrace.profiling.collector._threading\",\n                sources=[\"ddtrace/profiling/collector/_threading.pyx\"],\n                language=\"c\",\n            ),\n            Cython.Distutils.Extension(\n                \"ddtrace.profiling.exporter.pprof\",\n                sources=[\"ddtrace/profiling/exporter/pprof.pyx\"],\n                language=\"c\",\n            ),\n            Cython.Distutils.Extension(\n                \"ddtrace.profiling._build\",\n                sources=[\"ddtrace/profiling/_build.pyx\"],\n                language=\"c\",\n            ),\n        ],\n        compile_time_env={\n            \"PY_MAJOR_VERSION\": sys.version_info.major,\n            \"PY_MINOR_VERSION\": sys.version_info.minor,\n            \"PY_MICRO_VERSION\": sys.version_info.micro,\n        },\n        force=True,\n    )\n    + get_exts_for(\"wrapt\")\n    + get_exts_for(\"psutil\"),\n)\n", "path": "setup.py"}]}