(self)
| 107 | self._initialized = True |
| 108 | |
| 109 | def build_extensions(self): |
| 110 | mod_parser, mod_url_parser = self.distribution.ext_modules |
| 111 | if self.use_system_llhttp: |
| 112 | mod_parser.libraries.append('llhttp') |
| 113 | |
| 114 | if sys.platform == 'darwin' and \ |
| 115 | os.path.exists('/opt/local/include'): |
| 116 | # Support macports on Mac OS X. |
| 117 | mod_parser.include_dirs.append('/opt/local/include') |
| 118 | else: |
| 119 | mod_parser.include_dirs.append( |
| 120 | str(ROOT / 'vendor' / 'llhttp' / 'include')) |
| 121 | mod_parser.include_dirs.append( |
| 122 | str(ROOT / 'vendor' / 'llhttp' / 'src')) |
| 123 | mod_parser.sources.append('vendor/llhttp/src/api.c') |
| 124 | mod_parser.sources.append('vendor/llhttp/src/http.c') |
| 125 | mod_parser.sources.append('vendor/llhttp/src/llhttp.c') |
| 126 | |
| 127 | if self.use_system_http_parser: |
| 128 | mod_url_parser.libraries.append('http_parser') |
| 129 | |
| 130 | if sys.platform == 'darwin' and \ |
| 131 | os.path.exists('/opt/local/include'): |
| 132 | # Support macports on Mac OS X. |
| 133 | mod_url_parser.include_dirs.append('/opt/local/include') |
| 134 | else: |
| 135 | mod_url_parser.include_dirs.append( |
| 136 | str(ROOT / 'vendor' / 'http-parser')) |
| 137 | mod_url_parser.sources.append( |
| 138 | 'vendor/http-parser/http_parser.c') |
| 139 | |
| 140 | super().build_extensions() |
| 141 | |
| 142 | |
| 143 | with open(str(ROOT / 'httptools' / '_version.py')) as f: |
nothing calls this directly
no outgoing calls
no test coverage detected