We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
if a package name shadows internal context members, terrible things happen
### Describe the bug
If you run `dbt compile`, `dbt run`, you may get a message like this back:
```
Encountered an error:
'function' object has no attribute 'update' 
```

I think we can all agree that this is a very bad error message!

### Steps To Reproduce
1) Name your project the same as any built-in default dbt function `source`, `ref`, `log`, ...
2) `dbt compile`

Various built-in context members might result in similar messages with `function` replaced by another type (also bad) or even silently corrupt dbt internal behavior (much worse)

### Expected behavior
A clear and concise description of what you expected to happen.

I expect dbt to give me a good error message. Something like `package names may not shadow builtin context members: "log" is not a valid value for package name` is probably fine. This will be annoying when we add new things to contexts and users upgrade, but basically nothing will be as annoying as the current behavior.

### Screenshots and log output
There's a big long stack trace in the debug log that points to the culprit (see `Additional context` for more on that), but nothing else useful.

### System information
**Which database are you using dbt with?**
- [X] postgres
- [X] redshift
- [X] bigquery
- [X] snowflake
- [X] other (specify: Any!)


**The output of `dbt --version`:**
Any >= 0.13.0

**The operating system you're using:**
Any

**The output of `python --version`:**
Any

### Additional context
Some thoughts on fixing this:
 - this error comes up in `dbt.context.common._add_macro_map` via  `_add_macros`
 - Any fix for this has to handle dependencies as well as the root project
 - The current structure of `modify_generated_context`, which is what calls `_add_macros`, and `generate_model` (which calls `modify_generated_context`) make this not very straightforward, as we'll also want to explicitly blacklist the following keywords that aren't in the context yet at `_add_macros` time: `write`, `render`, `var`, `context`, `this`, `pre_hooks`, `post_hooks`, `sql`.
 - Maybe we should generate a reserved keywords list somewhere else in dbt and use that. If we did that, we could spit this information out before doing context generation, which means we could do it during `dbt debug`/`dbt ls`/similar as well, which seems like a big upside.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `core/dbt/contracts/project.py`
Content:
```
1 from dbt.contracts.util import Replaceable, Mergeable
2 from dbt.logger import GLOBAL_LOGGER as logger  # noqa
3 from dbt import tracking
4 from dbt.ui import printer
5 # from dbt.utils import JSONEncoder
6 
7 from hologram import JsonSchemaMixin
8 from hologram.helpers import HyphenatedJsonSchemaMixin, register_pattern, \
9     ExtensibleJsonSchemaMixin
10 
11 from dataclasses import dataclass, field
12 from typing import Optional, List, Dict, Union, Any, NewType
13 
14 PIN_PACKAGE_URL = 'https://docs.getdbt.com/docs/package-management#section-specifying-package-versions' # noqa
15 DEFAULT_SEND_ANONYMOUS_USAGE_STATS = True
16 DEFAULT_USE_COLORS = True
17 
18 
19 Name = NewType('Name', str)
20 register_pattern(Name, r'^[^\d\W]\w*\Z')
21 
22 # this does not support the full semver (does not allow a trailing -fooXYZ) and
23 # is not restrictive enough for full semver, (allows '1.0'). But it's like
24 # 'semver lite'.
25 SemverString = NewType('SemverString', str)
26 register_pattern(
27     SemverString,
28     r'^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(\.(?:0|[1-9]\d*))?$',
29 )
30 
31 
32 @dataclass
33 class Quoting(JsonSchemaMixin, Mergeable):
34     identifier: Optional[bool]
35     schema: Optional[bool]
36     database: Optional[bool]
37     project: Optional[bool]
38 
39 
40 @dataclass
41 class Package(Replaceable, HyphenatedJsonSchemaMixin):
42     pass
43 
44 
45 @dataclass
46 class LocalPackage(Package):
47     local: str
48 
49 
50 @dataclass
51 class GitPackage(Package):
52     git: str
53     revision: Optional[str]
54     warn_unpinned: Optional[bool] = None
55 
56 
57 @dataclass
58 class RegistryPackage(Package):
59     package: str
60     version: Union[str, List[str]]
61 
62 
63 PackageSpec = Union[LocalPackage, GitPackage, RegistryPackage]
64 
65 
66 @dataclass
67 class PackageConfig(JsonSchemaMixin, Replaceable):
68     packages: List[PackageSpec]
69 
70 
71 @dataclass
72 class ProjectPackageMetadata:
73     name: str
74     packages: List[PackageSpec]
75 
76     @classmethod
77     def from_project(cls, project):
78         return cls(name=project.project_name,
79                    packages=project.packages.packages)
80 
81 
82 @dataclass
83 class Downloads(ExtensibleJsonSchemaMixin, Replaceable):
84     tarball: str
85 
86 
87 @dataclass
88 class RegistryPackageMetadata(
89     ExtensibleJsonSchemaMixin,
90     ProjectPackageMetadata,
91 ):
92     downloads: Downloads
93 
94 
95 @dataclass
96 class Project(HyphenatedJsonSchemaMixin, Replaceable):
97     name: Name
98     version: Union[SemverString, float]
99     project_root: Optional[str]
100     source_paths: Optional[List[str]]
101     macro_paths: Optional[List[str]]
102     data_paths: Optional[List[str]]
103     test_paths: Optional[List[str]]
104     analysis_paths: Optional[List[str]]
105     docs_paths: Optional[List[str]]
106     target_path: Optional[str]
107     snapshot_paths: Optional[List[str]]
108     clean_targets: Optional[List[str]]
109     profile: Optional[str]
110     log_path: Optional[str]
111     modules_path: Optional[str]
112     quoting: Optional[Quoting]
113     on_run_start: Optional[List[str]] = field(default_factory=list)
114     on_run_end: Optional[List[str]] = field(default_factory=list)
115     require_dbt_version: Optional[Union[List[str], str]] = None
116     models: Dict[str, Any] = field(default_factory=dict)
117     seeds: Dict[str, Any] = field(default_factory=dict)
118     packages: List[PackageSpec] = field(default_factory=list)
119 
120 
121 @dataclass
122 class UserConfig(ExtensibleJsonSchemaMixin, Replaceable):
123     send_anonymous_usage_stats: bool = DEFAULT_SEND_ANONYMOUS_USAGE_STATS
124     use_colors: bool = DEFAULT_USE_COLORS
125     printer_width: Optional[int] = None
126 
127     def set_values(self, cookie_dir):
128         if self.send_anonymous_usage_stats:
129             tracking.initialize_tracking(cookie_dir)
130         else:
131             tracking.do_not_track()
132 
133         if self.use_colors:
134             printer.use_colors()
135 
136         if self.printer_width:
137             printer.printer_width(self.printer_width)
138 
139 
140 @dataclass
141 class ProfileConfig(HyphenatedJsonSchemaMixin, Replaceable):
142     profile_name: str = field(metadata={'preserve_underscore': True})
143     target_name: str = field(metadata={'preserve_underscore': True})
144     config: UserConfig
145     threads: int
146     # TODO: make this a dynamic union of some kind?
147     credentials: Optional[Dict[str, Any]]
148 
149 
150 @dataclass
151 class ConfiguredQuoting(JsonSchemaMixin, Replaceable):
152     identifier: bool
153     schema: bool
154     database: Optional[bool]
155     project: Optional[bool]
156 
157 
158 @dataclass
159 class Configuration(Project, ProfileConfig):
160     cli_vars: Dict[str, Any] = field(
161         default_factory=dict,
162         metadata={'preserve_underscore': True},
163     )
164     quoting: Optional[ConfiguredQuoting] = None
165 
166 
167 @dataclass
168 class ProjectList(JsonSchemaMixin):
169     projects: Dict[str, Project]
170
```
--- 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/core/dbt/contracts/project.py b/core/dbt/contracts/project.py
--- a/core/dbt/contracts/project.py
+++ b/core/dbt/contracts/project.py
@@ -2,9 +2,8 @@
 from dbt.logger import GLOBAL_LOGGER as logger  # noqa
 from dbt import tracking
 from dbt.ui import printer
-# from dbt.utils import JSONEncoder
 
-from hologram import JsonSchemaMixin
+from hologram import JsonSchemaMixin, ValidationError
 from hologram.helpers import HyphenatedJsonSchemaMixin, register_pattern, \
     ExtensibleJsonSchemaMixin
 
@@ -92,24 +91,66 @@
     downloads: Downloads
 
 
+# A list of all the reserved words that packages may not have as names.
+BANNED_PROJECT_NAMES = {
+    '_sql_results',
+    'adapter',
+    'api',
+    'column',
+    'config',
+    'context',
+    'database',
+    'env',
+    'env_var',
+    'exceptions',
+    'execute',
+    'flags',
+    'fromjson',
+    'graph',
+    'invocation_id',
+    'load_agate_table',
+    'load_result',
+    'log',
+    'model',
+    'modules',
+    'post_hooks',
+    'pre_hooks',
+    'ref',
+    'render',
+    'return',
+    'run_started_at',
+    'schema',
+    'source',
+    'sql',
+    'sql_now',
+    'store_result',
+    'target',
+    'this',
+    'tojson',
+    'try_or_compiler_error',
+    'var',
+    'write',
+}
+
+
 @dataclass
 class Project(HyphenatedJsonSchemaMixin, Replaceable):
     name: Name
     version: Union[SemverString, float]
-    project_root: Optional[str]
-    source_paths: Optional[List[str]]
-    macro_paths: Optional[List[str]]
-    data_paths: Optional[List[str]]
-    test_paths: Optional[List[str]]
-    analysis_paths: Optional[List[str]]
-    docs_paths: Optional[List[str]]
-    target_path: Optional[str]
-    snapshot_paths: Optional[List[str]]
-    clean_targets: Optional[List[str]]
-    profile: Optional[str]
-    log_path: Optional[str]
-    modules_path: Optional[str]
-    quoting: Optional[Quoting]
+    project_root: Optional[str] = None
+    source_paths: Optional[List[str]] = None
+    macro_paths: Optional[List[str]] = None
+    data_paths: Optional[List[str]] = None
+    test_paths: Optional[List[str]] = None
+    analysis_paths: Optional[List[str]] = None
+    docs_paths: Optional[List[str]] = None
+    target_path: Optional[str] = None
+    snapshot_paths: Optional[List[str]] = None
+    clean_targets: Optional[List[str]] = None
+    profile: Optional[str] = None
+    log_path: Optional[str] = None
+    modules_path: Optional[str] = None
+    quoting: Optional[Quoting] = None
     on_run_start: Optional[List[str]] = field(default_factory=list)
     on_run_end: Optional[List[str]] = field(default_factory=list)
     require_dbt_version: Optional[Union[List[str], str]] = None
@@ -117,6 +158,16 @@
     seeds: Dict[str, Any] = field(default_factory=dict)
     packages: List[PackageSpec] = field(default_factory=list)
 
+    @classmethod
+    def from_dict(cls, data, validate=True):
+        result = super().from_dict(data, validate=validate)
+        if result.name in BANNED_PROJECT_NAMES:
+            raise ValidationError(
+                'Invalid project name: {} is a reserved word'
+                .format(result.name)
+            )
+        return result
+
 
 @dataclass
 class UserConfig(ExtensibleJsonSchemaMixin, Replaceable):

{"golden_diff": "diff --git a/core/dbt/contracts/project.py b/core/dbt/contracts/project.py\n--- a/core/dbt/contracts/project.py\n+++ b/core/dbt/contracts/project.py\n@@ -2,9 +2,8 @@\n from dbt.logger import GLOBAL_LOGGER as logger  # noqa\n from dbt import tracking\n from dbt.ui import printer\n-# from dbt.utils import JSONEncoder\n \n-from hologram import JsonSchemaMixin\n+from hologram import JsonSchemaMixin, ValidationError\n from hologram.helpers import HyphenatedJsonSchemaMixin, register_pattern, \\\n     ExtensibleJsonSchemaMixin\n \n@@ -92,24 +91,66 @@\n     downloads: Downloads\n \n \n+# A list of all the reserved words that packages may not have as names.\n+BANNED_PROJECT_NAMES = {\n+    '_sql_results',\n+    'adapter',\n+    'api',\n+    'column',\n+    'config',\n+    'context',\n+    'database',\n+    'env',\n+    'env_var',\n+    'exceptions',\n+    'execute',\n+    'flags',\n+    'fromjson',\n+    'graph',\n+    'invocation_id',\n+    'load_agate_table',\n+    'load_result',\n+    'log',\n+    'model',\n+    'modules',\n+    'post_hooks',\n+    'pre_hooks',\n+    'ref',\n+    'render',\n+    'return',\n+    'run_started_at',\n+    'schema',\n+    'source',\n+    'sql',\n+    'sql_now',\n+    'store_result',\n+    'target',\n+    'this',\n+    'tojson',\n+    'try_or_compiler_error',\n+    'var',\n+    'write',\n+}\n+\n+\n @dataclass\n class Project(HyphenatedJsonSchemaMixin, Replaceable):\n     name: Name\n     version: Union[SemverString, float]\n-    project_root: Optional[str]\n-    source_paths: Optional[List[str]]\n-    macro_paths: Optional[List[str]]\n-    data_paths: Optional[List[str]]\n-    test_paths: Optional[List[str]]\n-    analysis_paths: Optional[List[str]]\n-    docs_paths: Optional[List[str]]\n-    target_path: Optional[str]\n-    snapshot_paths: Optional[List[str]]\n-    clean_targets: Optional[List[str]]\n-    profile: Optional[str]\n-    log_path: Optional[str]\n-    modules_path: Optional[str]\n-    quoting: Optional[Quoting]\n+    project_root: Optional[str] = None\n+    source_paths: Optional[List[str]] = None\n+    macro_paths: Optional[List[str]] = None\n+    data_paths: Optional[List[str]] = None\n+    test_paths: Optional[List[str]] = None\n+    analysis_paths: Optional[List[str]] = None\n+    docs_paths: Optional[List[str]] = None\n+    target_path: Optional[str] = None\n+    snapshot_paths: Optional[List[str]] = None\n+    clean_targets: Optional[List[str]] = None\n+    profile: Optional[str] = None\n+    log_path: Optional[str] = None\n+    modules_path: Optional[str] = None\n+    quoting: Optional[Quoting] = None\n     on_run_start: Optional[List[str]] = field(default_factory=list)\n     on_run_end: Optional[List[str]] = field(default_factory=list)\n     require_dbt_version: Optional[Union[List[str], str]] = None\n@@ -117,6 +158,16 @@\n     seeds: Dict[str, Any] = field(default_factory=dict)\n     packages: List[PackageSpec] = field(default_factory=list)\n \n+    @classmethod\n+    def from_dict(cls, data, validate=True):\n+        result = super().from_dict(data, validate=validate)\n+        if result.name in BANNED_PROJECT_NAMES:\n+            raise ValidationError(\n+                'Invalid project name: {} is a reserved word'\n+                .format(result.name)\n+            )\n+        return result\n+\n \n @dataclass\n class UserConfig(ExtensibleJsonSchemaMixin, Replaceable):\n", "issue": "if a package name shadows internal context members, terrible things happen\n### Describe the bug\r\nIf you run `dbt compile`, `dbt run`, you may get a message like this back:\r\n```\r\nEncountered an error:\r\n'function' object has no attribute 'update' \r\n```\r\n\r\nI think we can all agree that this is a very bad error message!\r\n\r\n### Steps To Reproduce\r\n1) Name your project the same as any built-in default dbt function `source`, `ref`, `log`, ...\r\n2) `dbt compile`\r\n\r\nVarious built-in context members might result in similar messages with `function` replaced by another type (also bad) or even silently corrupt dbt internal behavior (much worse)\r\n\r\n### Expected behavior\r\nA clear and concise description of what you expected to happen.\r\n\r\nI expect dbt to give me a good error message. Something like `package names may not shadow builtin context members: \"log\" is not a valid value for package name` is probably fine. This will be annoying when we add new things to contexts and users upgrade, but basically nothing will be as annoying as the current behavior.\r\n\r\n### Screenshots and log output\r\nThere's a big long stack trace in the debug log that points to the culprit (see `Additional context` for more on that), but nothing else useful.\r\n\r\n### System information\r\n**Which database are you using dbt with?**\r\n- [X] postgres\r\n- [X] redshift\r\n- [X] bigquery\r\n- [X] snowflake\r\n- [X] other (specify: Any!)\r\n\r\n\r\n**The output of `dbt --version`:**\r\nAny >= 0.13.0\r\n\r\n**The operating system you're using:**\r\nAny\r\n\r\n**The output of `python --version`:**\r\nAny\r\n\r\n### Additional context\r\nSome thoughts on fixing this:\r\n - this error comes up in `dbt.context.common._add_macro_map` via  `_add_macros`\r\n - Any fix for this has to handle dependencies as well as the root project\r\n - The current structure of `modify_generated_context`, which is what calls `_add_macros`, and `generate_model` (which calls `modify_generated_context`) make this not very straightforward, as we'll also want to explicitly blacklist the following keywords that aren't in the context yet at `_add_macros` time: `write`, `render`, `var`, `context`, `this`, `pre_hooks`, `post_hooks`, `sql`.\r\n - Maybe we should generate a reserved keywords list somewhere else in dbt and use that. If we did that, we could spit this information out before doing context generation, which means we could do it during `dbt debug`/`dbt ls`/similar as well, which seems like a big upside.\r\n\n", "before_files": [{"content": "from dbt.contracts.util import Replaceable, Mergeable\nfrom dbt.logger import GLOBAL_LOGGER as logger  # noqa\nfrom dbt import tracking\nfrom dbt.ui import printer\n# from dbt.utils import JSONEncoder\n\nfrom hologram import JsonSchemaMixin\nfrom hologram.helpers import HyphenatedJsonSchemaMixin, register_pattern, \\\n    ExtensibleJsonSchemaMixin\n\nfrom dataclasses import dataclass, field\nfrom typing import Optional, List, Dict, Union, Any, NewType\n\nPIN_PACKAGE_URL = 'https://docs.getdbt.com/docs/package-management#section-specifying-package-versions' # noqa\nDEFAULT_SEND_ANONYMOUS_USAGE_STATS = True\nDEFAULT_USE_COLORS = True\n\n\nName = NewType('Name', str)\nregister_pattern(Name, r'^[^\\d\\W]\\w*\\Z')\n\n# this does not support the full semver (does not allow a trailing -fooXYZ) and\n# is not restrictive enough for full semver, (allows '1.0'). But it's like\n# 'semver lite'.\nSemverString = NewType('SemverString', str)\nregister_pattern(\n    SemverString,\n    r'^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(\\.(?:0|[1-9]\\d*))?$',\n)\n\n\n@dataclass\nclass Quoting(JsonSchemaMixin, Mergeable):\n    identifier: Optional[bool]\n    schema: Optional[bool]\n    database: Optional[bool]\n    project: Optional[bool]\n\n\n@dataclass\nclass Package(Replaceable, HyphenatedJsonSchemaMixin):\n    pass\n\n\n@dataclass\nclass LocalPackage(Package):\n    local: str\n\n\n@dataclass\nclass GitPackage(Package):\n    git: str\n    revision: Optional[str]\n    warn_unpinned: Optional[bool] = None\n\n\n@dataclass\nclass RegistryPackage(Package):\n    package: str\n    version: Union[str, List[str]]\n\n\nPackageSpec = Union[LocalPackage, GitPackage, RegistryPackage]\n\n\n@dataclass\nclass PackageConfig(JsonSchemaMixin, Replaceable):\n    packages: List[PackageSpec]\n\n\n@dataclass\nclass ProjectPackageMetadata:\n    name: str\n    packages: List[PackageSpec]\n\n    @classmethod\n    def from_project(cls, project):\n        return cls(name=project.project_name,\n                   packages=project.packages.packages)\n\n\n@dataclass\nclass Downloads(ExtensibleJsonSchemaMixin, Replaceable):\n    tarball: str\n\n\n@dataclass\nclass RegistryPackageMetadata(\n    ExtensibleJsonSchemaMixin,\n    ProjectPackageMetadata,\n):\n    downloads: Downloads\n\n\n@dataclass\nclass Project(HyphenatedJsonSchemaMixin, Replaceable):\n    name: Name\n    version: Union[SemverString, float]\n    project_root: Optional[str]\n    source_paths: Optional[List[str]]\n    macro_paths: Optional[List[str]]\n    data_paths: Optional[List[str]]\n    test_paths: Optional[List[str]]\n    analysis_paths: Optional[List[str]]\n    docs_paths: Optional[List[str]]\n    target_path: Optional[str]\n    snapshot_paths: Optional[List[str]]\n    clean_targets: Optional[List[str]]\n    profile: Optional[str]\n    log_path: Optional[str]\n    modules_path: Optional[str]\n    quoting: Optional[Quoting]\n    on_run_start: Optional[List[str]] = field(default_factory=list)\n    on_run_end: Optional[List[str]] = field(default_factory=list)\n    require_dbt_version: Optional[Union[List[str], str]] = None\n    models: Dict[str, Any] = field(default_factory=dict)\n    seeds: Dict[str, Any] = field(default_factory=dict)\n    packages: List[PackageSpec] = field(default_factory=list)\n\n\n@dataclass\nclass UserConfig(ExtensibleJsonSchemaMixin, Replaceable):\n    send_anonymous_usage_stats: bool = DEFAULT_SEND_ANONYMOUS_USAGE_STATS\n    use_colors: bool = DEFAULT_USE_COLORS\n    printer_width: Optional[int] = None\n\n    def set_values(self, cookie_dir):\n        if self.send_anonymous_usage_stats:\n            tracking.initialize_tracking(cookie_dir)\n        else:\n            tracking.do_not_track()\n\n        if self.use_colors:\n            printer.use_colors()\n\n        if self.printer_width:\n            printer.printer_width(self.printer_width)\n\n\n@dataclass\nclass ProfileConfig(HyphenatedJsonSchemaMixin, Replaceable):\n    profile_name: str = field(metadata={'preserve_underscore': True})\n    target_name: str = field(metadata={'preserve_underscore': True})\n    config: UserConfig\n    threads: int\n    # TODO: make this a dynamic union of some kind?\n    credentials: Optional[Dict[str, Any]]\n\n\n@dataclass\nclass ConfiguredQuoting(JsonSchemaMixin, Replaceable):\n    identifier: bool\n    schema: bool\n    database: Optional[bool]\n    project: Optional[bool]\n\n\n@dataclass\nclass Configuration(Project, ProfileConfig):\n    cli_vars: Dict[str, Any] = field(\n        default_factory=dict,\n        metadata={'preserve_underscore': True},\n    )\n    quoting: Optional[ConfiguredQuoting] = None\n\n\n@dataclass\nclass ProjectList(JsonSchemaMixin):\n    projects: Dict[str, Project]\n", "path": "core/dbt/contracts/project.py"}], "after_files": [{"content": "from dbt.contracts.util import Replaceable, Mergeable\nfrom dbt.logger import GLOBAL_LOGGER as logger  # noqa\nfrom dbt import tracking\nfrom dbt.ui import printer\n\nfrom hologram import JsonSchemaMixin, ValidationError\nfrom hologram.helpers import HyphenatedJsonSchemaMixin, register_pattern, \\\n    ExtensibleJsonSchemaMixin\n\nfrom dataclasses import dataclass, field\nfrom typing import Optional, List, Dict, Union, Any, NewType\n\nPIN_PACKAGE_URL = 'https://docs.getdbt.com/docs/package-management#section-specifying-package-versions' # noqa\nDEFAULT_SEND_ANONYMOUS_USAGE_STATS = True\nDEFAULT_USE_COLORS = True\n\n\nName = NewType('Name', str)\nregister_pattern(Name, r'^[^\\d\\W]\\w*\\Z')\n\n# this does not support the full semver (does not allow a trailing -fooXYZ) and\n# is not restrictive enough for full semver, (allows '1.0'). But it's like\n# 'semver lite'.\nSemverString = NewType('SemverString', str)\nregister_pattern(\n    SemverString,\n    r'^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(\\.(?:0|[1-9]\\d*))?$',\n)\n\n\n@dataclass\nclass Quoting(JsonSchemaMixin, Mergeable):\n    identifier: Optional[bool]\n    schema: Optional[bool]\n    database: Optional[bool]\n    project: Optional[bool]\n\n\n@dataclass\nclass Package(Replaceable, HyphenatedJsonSchemaMixin):\n    pass\n\n\n@dataclass\nclass LocalPackage(Package):\n    local: str\n\n\n@dataclass\nclass GitPackage(Package):\n    git: str\n    revision: Optional[str]\n    warn_unpinned: Optional[bool] = None\n\n\n@dataclass\nclass RegistryPackage(Package):\n    package: str\n    version: Union[str, List[str]]\n\n\nPackageSpec = Union[LocalPackage, GitPackage, RegistryPackage]\n\n\n@dataclass\nclass PackageConfig(JsonSchemaMixin, Replaceable):\n    packages: List[PackageSpec]\n\n\n@dataclass\nclass ProjectPackageMetadata:\n    name: str\n    packages: List[PackageSpec]\n\n    @classmethod\n    def from_project(cls, project):\n        return cls(name=project.project_name,\n                   packages=project.packages.packages)\n\n\n@dataclass\nclass Downloads(ExtensibleJsonSchemaMixin, Replaceable):\n    tarball: str\n\n\n@dataclass\nclass RegistryPackageMetadata(\n    ExtensibleJsonSchemaMixin,\n    ProjectPackageMetadata,\n):\n    downloads: Downloads\n\n\n# A list of all the reserved words that packages may not have as names.\nBANNED_PROJECT_NAMES = {\n    '_sql_results',\n    'adapter',\n    'api',\n    'column',\n    'config',\n    'context',\n    'database',\n    'env',\n    'env_var',\n    'exceptions',\n    'execute',\n    'flags',\n    'fromjson',\n    'graph',\n    'invocation_id',\n    'load_agate_table',\n    'load_result',\n    'log',\n    'model',\n    'modules',\n    'post_hooks',\n    'pre_hooks',\n    'ref',\n    'render',\n    'return',\n    'run_started_at',\n    'schema',\n    'source',\n    'sql',\n    'sql_now',\n    'store_result',\n    'target',\n    'this',\n    'tojson',\n    'try_or_compiler_error',\n    'var',\n    'write',\n}\n\n\n@dataclass\nclass Project(HyphenatedJsonSchemaMixin, Replaceable):\n    name: Name\n    version: Union[SemverString, float]\n    project_root: Optional[str] = None\n    source_paths: Optional[List[str]] = None\n    macro_paths: Optional[List[str]] = None\n    data_paths: Optional[List[str]] = None\n    test_paths: Optional[List[str]] = None\n    analysis_paths: Optional[List[str]] = None\n    docs_paths: Optional[List[str]] = None\n    target_path: Optional[str] = None\n    snapshot_paths: Optional[List[str]] = None\n    clean_targets: Optional[List[str]] = None\n    profile: Optional[str] = None\n    log_path: Optional[str] = None\n    modules_path: Optional[str] = None\n    quoting: Optional[Quoting] = None\n    on_run_start: Optional[List[str]] = field(default_factory=list)\n    on_run_end: Optional[List[str]] = field(default_factory=list)\n    require_dbt_version: Optional[Union[List[str], str]] = None\n    models: Dict[str, Any] = field(default_factory=dict)\n    seeds: Dict[str, Any] = field(default_factory=dict)\n    packages: List[PackageSpec] = field(default_factory=list)\n\n    @classmethod\n    def from_dict(cls, data, validate=True):\n        result = super().from_dict(data, validate=validate)\n        if result.name in BANNED_PROJECT_NAMES:\n            raise ValidationError(\n                'Invalid project name: {} is a reserved word'\n                .format(result.name)\n            )\n        return result\n\n\n@dataclass\nclass UserConfig(ExtensibleJsonSchemaMixin, Replaceable):\n    send_anonymous_usage_stats: bool = DEFAULT_SEND_ANONYMOUS_USAGE_STATS\n    use_colors: bool = DEFAULT_USE_COLORS\n    printer_width: Optional[int] = None\n\n    def set_values(self, cookie_dir):\n        if self.send_anonymous_usage_stats:\n            tracking.initialize_tracking(cookie_dir)\n        else:\n            tracking.do_not_track()\n\n        if self.use_colors:\n            printer.use_colors()\n\n        if self.printer_width:\n            printer.printer_width(self.printer_width)\n\n\n@dataclass\nclass ProfileConfig(HyphenatedJsonSchemaMixin, Replaceable):\n    profile_name: str = field(metadata={'preserve_underscore': True})\n    target_name: str = field(metadata={'preserve_underscore': True})\n    config: UserConfig\n    threads: int\n    # TODO: make this a dynamic union of some kind?\n    credentials: Optional[Dict[str, Any]]\n\n\n@dataclass\nclass ConfiguredQuoting(JsonSchemaMixin, Replaceable):\n    identifier: bool\n    schema: bool\n    database: Optional[bool]\n    project: Optional[bool]\n\n\n@dataclass\nclass Configuration(Project, ProfileConfig):\n    cli_vars: Dict[str, Any] = field(\n        default_factory=dict,\n        metadata={'preserve_underscore': True},\n    )\n    quoting: Optional[ConfiguredQuoting] = None\n\n\n@dataclass\nclass ProjectList(JsonSchemaMixin):\n    projects: Dict[str, Project]\n", "path": "core/dbt/contracts/project.py"}]}