We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Include a PEP 561 marker file
# Feature Request

Hi,

The new version 0.19 has improved typing support which is great, but looks like it doesn't work out of the box. I had similar problems as described in #245 , but after adding the installation to MYPYPATH it works fine.

I think a PEP 561 marker file `py.typed` should be added so that tools like mypy can utilize the inline type information without any configuration. Reading mypy docs looks like there is a downside that `zip_safe` must be disabled for this.

https://mypy.readthedocs.io/en/latest/installed_packages.html
https://www.python.org/dev/peps/pep-0561/
Include a PEP 561 marker file
# Feature Request

Hi,

The new version 0.19 has improved typing support which is great, but looks like it doesn't work out of the box. I had similar problems as described in #245 , but after adding the installation to MYPYPATH it works fine.

I think a PEP 561 marker file `py.typed` should be added so that tools like mypy can utilize the inline type information without any configuration. Reading mypy docs looks like there is a downside that `zip_safe` must be disabled for this.

https://mypy.readthedocs.io/en/latest/installed_packages.html
https://www.python.org/dev/peps/pep-0561/

--- 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 re
2 from importlib.machinery import SourceFileLoader
3 from pathlib import Path
4 from setuptools import setup
5 
6 
7 class ReplaceLinks:
8     def __init__(self):
9         self.links = set()
10 
11     def replace_issues(self, m):
12         id = m.group(1)
13         self.links.add(f'.. _#{id}: https://github.com/samuelcolvin/pydantic/issues/{id}')
14         return f'`#{id}`_'
15 
16     def replace_users(self, m):
17         name = m.group(2)
18         self.links.add(f'.. _@{name}: https://github.com/{name}')
19         return f'{m.group(1)}`@{name}`_'
20 
21     def extra(self):
22         return '\n\n' + '\n'.join(self.links) + '\n'
23 
24 
25 description = 'Data validation and settings management using python 3.6 type hinting'
26 THIS_DIR = Path(__file__).resolve().parent
27 try:
28     history = THIS_DIR.joinpath('HISTORY.rst').read_text()
29 
30     replacer = ReplaceLinks()
31     history = re.sub(r'#(\d+)', replacer.replace_issues, history)
32     history = re.sub(r'( +)@(\w+)', replacer.replace_users, history, flags=re.I)
33     history = re.sub(r'@@', '@', history)
34     history += replacer.extra()
35 
36     long_description = '\n\n'.join([THIS_DIR.joinpath('README.rst').read_text(), history])
37 except FileNotFoundError:
38     long_description = description + '.\n\nSee https://pydantic-docs.helpmanual.io/ for documentation.'
39 
40 # avoid loading the package before requirements are installed:
41 version = SourceFileLoader('version', 'pydantic/version.py').load_module()
42 
43 setup(
44     name='pydantic',
45     version=str(version.VERSION),
46     description=description,
47     long_description=long_description,
48     classifiers=[
49         'Development Status :: 5 - Production/Stable',
50         'Programming Language :: Python',
51         'Programming Language :: Python :: 3',
52         'Programming Language :: Python :: 3 :: Only',
53         'Programming Language :: Python :: 3.6',
54         'Programming Language :: Python :: 3.7',
55         'Intended Audience :: Developers',
56         'Intended Audience :: Information Technology',
57         'Intended Audience :: System Administrators',
58         'License :: OSI Approved :: MIT License',
59         'Operating System :: Unix',
60         'Operating System :: POSIX :: Linux',
61         'Environment :: Console',
62         'Environment :: MacOS X',
63         'Topic :: Software Development :: Libraries :: Python Modules',
64         'Topic :: Internet',
65     ],
66     author='Samuel Colvin',
67     author_email='s@muelcolvin.com',
68     url='https://github.com/samuelcolvin/pydantic',
69     license='MIT',
70     packages=['pydantic'],
71     python_requires='>=3.6',
72     zip_safe=True,
73     install_requires=[
74         'dataclasses>=0.6;python_version<"3.7"'
75     ],
76     extras_require={
77         'ujson': ['ujson>=1.35'],
78         'email': ['email-validator>=1.0.3'],
79     }
80 )
81
```
--- 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
@@ -68,8 +68,9 @@
     url='https://github.com/samuelcolvin/pydantic',
     license='MIT',
     packages=['pydantic'],
+    package_data={'pydantic': ['py.typed']},
     python_requires='>=3.6',
-    zip_safe=True,
+    zip_safe=False,  # https://mypy.readthedocs.io/en/latest/installed_packages.html
     install_requires=[
         'dataclasses>=0.6;python_version<"3.7"'
     ],

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -68,8 +68,9 @@\n     url='https://github.com/samuelcolvin/pydantic',\n     license='MIT',\n     packages=['pydantic'],\n+    package_data={'pydantic': ['py.typed']},\n     python_requires='>=3.6',\n-    zip_safe=True,\n+    zip_safe=False,  # https://mypy.readthedocs.io/en/latest/installed_packages.html\n     install_requires=[\n         'dataclasses>=0.6;python_version<\"3.7\"'\n     ],\n", "issue": "Include a PEP 561 marker file\n# Feature Request\r\n\r\nHi,\r\n\r\nThe new version 0.19 has improved typing support which is great, but looks like it doesn't work out of the box. I had similar problems as described in #245 , but after adding the installation to MYPYPATH it works fine.\r\n\r\nI think a PEP 561 marker file `py.typed` should be added so that tools like mypy can utilize the inline type information without any configuration. Reading mypy docs looks like there is a downside that `zip_safe` must be disabled for this.\r\n\r\nhttps://mypy.readthedocs.io/en/latest/installed_packages.html\r\nhttps://www.python.org/dev/peps/pep-0561/\nInclude a PEP 561 marker file\n# Feature Request\r\n\r\nHi,\r\n\r\nThe new version 0.19 has improved typing support which is great, but looks like it doesn't work out of the box. I had similar problems as described in #245 , but after adding the installation to MYPYPATH it works fine.\r\n\r\nI think a PEP 561 marker file `py.typed` should be added so that tools like mypy can utilize the inline type information without any configuration. Reading mypy docs looks like there is a downside that `zip_safe` must be disabled for this.\r\n\r\nhttps://mypy.readthedocs.io/en/latest/installed_packages.html\r\nhttps://www.python.org/dev/peps/pep-0561/\n", "before_files": [{"content": "import re\nfrom importlib.machinery import SourceFileLoader\nfrom pathlib import Path\nfrom setuptools import setup\n\n\nclass ReplaceLinks:\n    def __init__(self):\n        self.links = set()\n\n    def replace_issues(self, m):\n        id = m.group(1)\n        self.links.add(f'.. _#{id}: https://github.com/samuelcolvin/pydantic/issues/{id}')\n        return f'`#{id}`_'\n\n    def replace_users(self, m):\n        name = m.group(2)\n        self.links.add(f'.. _@{name}: https://github.com/{name}')\n        return f'{m.group(1)}`@{name}`_'\n\n    def extra(self):\n        return '\\n\\n' + '\\n'.join(self.links) + '\\n'\n\n\ndescription = 'Data validation and settings management using python 3.6 type hinting'\nTHIS_DIR = Path(__file__).resolve().parent\ntry:\n    history = THIS_DIR.joinpath('HISTORY.rst').read_text()\n\n    replacer = ReplaceLinks()\n    history = re.sub(r'#(\\d+)', replacer.replace_issues, history)\n    history = re.sub(r'( +)@(\\w+)', replacer.replace_users, history, flags=re.I)\n    history = re.sub(r'@@', '@', history)\n    history += replacer.extra()\n\n    long_description = '\\n\\n'.join([THIS_DIR.joinpath('README.rst').read_text(), history])\nexcept FileNotFoundError:\n    long_description = description + '.\\n\\nSee https://pydantic-docs.helpmanual.io/ for documentation.'\n\n# avoid loading the package before requirements are installed:\nversion = SourceFileLoader('version', 'pydantic/version.py').load_module()\n\nsetup(\n    name='pydantic',\n    version=str(version.VERSION),\n    description=description,\n    long_description=long_description,\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3 :: Only',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Intended Audience :: Developers',\n        'Intended Audience :: Information Technology',\n        'Intended Audience :: System Administrators',\n        'License :: OSI Approved :: MIT License',\n        'Operating System :: Unix',\n        'Operating System :: POSIX :: Linux',\n        'Environment :: Console',\n        'Environment :: MacOS X',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n        'Topic :: Internet',\n    ],\n    author='Samuel Colvin',\n    author_email='s@muelcolvin.com',\n    url='https://github.com/samuelcolvin/pydantic',\n    license='MIT',\n    packages=['pydantic'],\n    python_requires='>=3.6',\n    zip_safe=True,\n    install_requires=[\n        'dataclasses>=0.6;python_version<\"3.7\"'\n    ],\n    extras_require={\n        'ujson': ['ujson>=1.35'],\n        'email': ['email-validator>=1.0.3'],\n    }\n)\n", "path": "setup.py"}], "after_files": [{"content": "import re\nfrom importlib.machinery import SourceFileLoader\nfrom pathlib import Path\nfrom setuptools import setup\n\n\nclass ReplaceLinks:\n    def __init__(self):\n        self.links = set()\n\n    def replace_issues(self, m):\n        id = m.group(1)\n        self.links.add(f'.. _#{id}: https://github.com/samuelcolvin/pydantic/issues/{id}')\n        return f'`#{id}`_'\n\n    def replace_users(self, m):\n        name = m.group(2)\n        self.links.add(f'.. _@{name}: https://github.com/{name}')\n        return f'{m.group(1)}`@{name}`_'\n\n    def extra(self):\n        return '\\n\\n' + '\\n'.join(self.links) + '\\n'\n\n\ndescription = 'Data validation and settings management using python 3.6 type hinting'\nTHIS_DIR = Path(__file__).resolve().parent\ntry:\n    history = THIS_DIR.joinpath('HISTORY.rst').read_text()\n\n    replacer = ReplaceLinks()\n    history = re.sub(r'#(\\d+)', replacer.replace_issues, history)\n    history = re.sub(r'( +)@(\\w+)', replacer.replace_users, history, flags=re.I)\n    history = re.sub(r'@@', '@', history)\n    history += replacer.extra()\n\n    long_description = '\\n\\n'.join([THIS_DIR.joinpath('README.rst').read_text(), history])\nexcept FileNotFoundError:\n    long_description = description + '.\\n\\nSee https://pydantic-docs.helpmanual.io/ for documentation.'\n\n# avoid loading the package before requirements are installed:\nversion = SourceFileLoader('version', 'pydantic/version.py').load_module()\n\nsetup(\n    name='pydantic',\n    version=str(version.VERSION),\n    description=description,\n    long_description=long_description,\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3 :: Only',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Intended Audience :: Developers',\n        'Intended Audience :: Information Technology',\n        'Intended Audience :: System Administrators',\n        'License :: OSI Approved :: MIT License',\n        'Operating System :: Unix',\n        'Operating System :: POSIX :: Linux',\n        'Environment :: Console',\n        'Environment :: MacOS X',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n        'Topic :: Internet',\n    ],\n    author='Samuel Colvin',\n    author_email='s@muelcolvin.com',\n    url='https://github.com/samuelcolvin/pydantic',\n    license='MIT',\n    packages=['pydantic'],\n    package_data={'pydantic': ['py.typed']},\n    python_requires='>=3.6',\n    zip_safe=False,  # https://mypy.readthedocs.io/en/latest/installed_packages.html\n    install_requires=[\n        'dataclasses>=0.6;python_version<\"3.7\"'\n    ],\n    extras_require={\n        'ujson': ['ujson>=1.35'],\n        'email': ['email-validator>=1.0.3'],\n    }\n)\n", "path": "setup.py"}]}