We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Make the cythonize command line more useful
A couple of more common build options, such as `--numpy`, `--include_path`, `--libraries`, `--cflags`, `--ldflags` should be added to `cythonize` command line so that it can be used easily for the majority of building tasks. 

Setting up a `setup.py` script for every `pyx` file I need to write is really, really tedious, which put me off from cython for years before I finally tried it for the first time (and that was in IPython notebook with cython magic, so I still don't know how to write `setup.py`). I am sure that many beginners to cython are just scared of the complicated build process like me, and never have the chance to actually try it. Please make it more accessible.

The `%%cython` magic in IPython has much better sane defaults and useful command line options than the `cythonize` script.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `Cython/Build/Cythonize.py`
Content:
```
1 #!/usr/bin/env python
2 
3 from __future__ import absolute_import
4 
5 import os
6 import shutil
7 import tempfile
8 from distutils.core import setup
9 
10 from .Dependencies import cythonize, extended_iglob
11 from ..Utils import is_package_dir
12 from ..Compiler import Options
13 
14 try:
15     import multiprocessing
16     parallel_compiles = int(multiprocessing.cpu_count() * 1.5)
17 except ImportError:
18     multiprocessing = None
19     parallel_compiles = 0
20 
21 
22 class _FakePool(object):
23     def map_async(self, func, args):
24         try:
25             from itertools import imap
26         except ImportError:
27             imap=map
28         for _ in imap(func, args):
29             pass
30 
31     def close(self):
32         pass
33 
34     def terminate(self):
35         pass
36 
37     def join(self):
38         pass
39 
40 
41 def find_package_base(path):
42     base_dir, package_path = os.path.split(path)
43     while is_package_dir(base_dir):
44         base_dir, parent = os.path.split(base_dir)
45         package_path = '%s/%s' % (parent, package_path)
46     return base_dir, package_path
47 
48 
49 def cython_compile(path_pattern, options):
50     pool = None
51     all_paths = map(os.path.abspath, extended_iglob(path_pattern))
52     try:
53         for path in all_paths:
54             if options.build_inplace:
55                 base_dir = path
56                 while not os.path.isdir(base_dir) or is_package_dir(base_dir):
57                     base_dir = os.path.dirname(base_dir)
58             else:
59                 base_dir = None
60 
61             if os.path.isdir(path):
62                 # recursively compiling a package
63                 paths = [os.path.join(path, '**', '*.{py,pyx}')]
64             else:
65                 # assume it's a file(-like thing)
66                 paths = [path]
67 
68             ext_modules = cythonize(
69                 paths,
70                 nthreads=options.parallel,
71                 exclude_failures=options.keep_going,
72                 exclude=options.excludes,
73                 compiler_directives=options.directives,
74                 compile_time_env=options.compile_time_env,
75                 force=options.force,
76                 quiet=options.quiet,
77                 depfile=options.depfile,
78                 **options.options)
79 
80             if ext_modules and options.build:
81                 if len(ext_modules) > 1 and options.parallel > 1:
82                     if pool is None:
83                         try:
84                             pool = multiprocessing.Pool(options.parallel)
85                         except OSError:
86                             pool = _FakePool()
87                     pool.map_async(run_distutils, [
88                         (base_dir, [ext]) for ext in ext_modules])
89                 else:
90                     run_distutils((base_dir, ext_modules))
91     except:
92         if pool is not None:
93             pool.terminate()
94         raise
95     else:
96         if pool is not None:
97             pool.close()
98             pool.join()
99 
100 
101 def run_distutils(args):
102     base_dir, ext_modules = args
103     script_args = ['build_ext', '-i']
104     cwd = os.getcwd()
105     temp_dir = None
106     try:
107         if base_dir:
108             os.chdir(base_dir)
109             temp_dir = tempfile.mkdtemp(dir=base_dir)
110             script_args.extend(['--build-temp', temp_dir])
111         setup(
112             script_name='setup.py',
113             script_args=script_args,
114             ext_modules=ext_modules,
115         )
116     finally:
117         if base_dir:
118             os.chdir(cwd)
119             if temp_dir and os.path.isdir(temp_dir):
120                 shutil.rmtree(temp_dir)
121 
122 
123 def create_args_parser():
124     from argparse import ArgumentParser
125     from ..Compiler.CmdLine import ParseDirectivesAction, ParseOptionsAction, ParseCompileTimeEnvAction
126 
127     parser = ArgumentParser()
128 
129     parser.add_argument('-X', '--directive', metavar='NAME=VALUE,...',
130                       dest='directives', default={}, type=str,
131                       action=ParseDirectivesAction,
132                       help='set a compiler directive')
133     parser.add_argument('-E', '--compile-time-env', metavar='NAME=VALUE,...',
134                       dest='compile_time_env', default={}, type=str,
135                       action=ParseCompileTimeEnvAction,
136                       help='set a compile time environment variable')
137     parser.add_argument('-s', '--option', metavar='NAME=VALUE',
138                       dest='options', default={}, type=str,
139                       action=ParseOptionsAction,
140                       help='set a cythonize option')
141     parser.add_argument('-2', dest='language_level', action='store_const', const=2, default=None,
142                       help='use Python 2 syntax mode by default')
143     parser.add_argument('-3', dest='language_level', action='store_const', const=3,
144                       help='use Python 3 syntax mode by default')
145     parser.add_argument('--3str', dest='language_level', action='store_const', const='3str',
146                       help='use Python 3 syntax mode by default')
147     parser.add_argument('-a', '--annotate', action='store_const', const='default', dest='annotate',
148                       help='Produce a colorized HTML version of the source.')
149     parser.add_argument('--annotate-fullc', action='store_const', const='fullc', dest='annotate',
150                       help='Produce a colorized HTML version of the source '
151                            'which includes entire generated C/C++-code.')
152     parser.add_argument('-x', '--exclude', metavar='PATTERN', dest='excludes',
153                       action='append', default=[],
154                       help='exclude certain file patterns from the compilation')
155 
156     parser.add_argument('-b', '--build', dest='build', action='store_true', default=None,
157                       help='build extension modules using distutils')
158     parser.add_argument('-i', '--inplace', dest='build_inplace', action='store_true', default=None,
159                       help='build extension modules in place using distutils (implies -b)')
160     parser.add_argument('-j', '--parallel', dest='parallel', metavar='N',
161                       type=int, default=parallel_compiles,
162                       help=('run builds in N parallel jobs (default: %d)' %
163                             parallel_compiles or 1))
164     parser.add_argument('-f', '--force', dest='force', action='store_true', default=None,
165                       help='force recompilation')
166     parser.add_argument('-q', '--quiet', dest='quiet', action='store_true', default=None,
167                       help='be less verbose during compilation')
168 
169     parser.add_argument('--lenient', dest='lenient', action='store_true', default=None,
170                       help='increase Python compatibility by ignoring some compile time errors')
171     parser.add_argument('-k', '--keep-going', dest='keep_going', action='store_true', default=None,
172                       help='compile as much as possible, ignore compilation failures')
173     parser.add_argument('--no-docstrings', dest='no_docstrings', action='store_true', default=None,
174                       help='strip docstrings')
175     parser.add_argument('-M', '--depfile', action='store_true', help='produce depfiles for the sources')
176     parser.add_argument('sources', nargs='*')
177     return parser
178 
179 
180 def parse_args_raw(parser, args):
181     options, unknown = parser.parse_known_args(args)
182     sources = options.sources
183     # if positional arguments were interspersed
184     # some of them are in unknown
185     for option in unknown:
186         if option.startswith('-'):
187             parser.error("unknown option "+option)
188         else:
189             sources.append(option)
190     del options.sources
191     return (options, sources)
192 
193 
194 def parse_args(args):
195     parser = create_args_parser()
196     options, args = parse_args_raw(parser, args)
197 
198     if not args:
199         parser.error("no source files provided")
200     if options.build_inplace:
201         options.build = True
202     if multiprocessing is None:
203         options.parallel = 0
204     if options.language_level:
205         assert options.language_level in (2, 3, '3str')
206         options.options['language_level'] = options.language_level
207 
208     if options.lenient:
209         # increase Python compatibility by ignoring compile time errors
210         Options.error_on_unknown_names = False
211         Options.error_on_uninitialized = False
212 
213     if options.annotate:
214         Options.annotate = options.annotate
215 
216     if options.no_docstrings:
217         Options.docstrings = False
218 
219     return options, args
220 
221 
222 def main(args=None):
223     options, paths = parse_args(args)
224 
225     for path in paths:
226         cython_compile(path, options)
227 
228 
229 if __name__ == '__main__':
230     main()
231
```
--- 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/Cython/Build/Cythonize.py b/Cython/Build/Cythonize.py
--- a/Cython/Build/Cythonize.py
+++ b/Cython/Build/Cythonize.py
@@ -121,10 +121,18 @@
 
 
 def create_args_parser():
-    from argparse import ArgumentParser
+    from argparse import ArgumentParser, RawDescriptionHelpFormatter
     from ..Compiler.CmdLine import ParseDirectivesAction, ParseOptionsAction, ParseCompileTimeEnvAction
 
-    parser = ArgumentParser()
+    parser = ArgumentParser(
+        formatter_class=RawDescriptionHelpFormatter,
+        epilog="""\
+Environment variables:
+  CYTHON_FORCE_REGEN: if set to 1, forces cythonize to regenerate the output files regardless
+        of modification times and changes.
+  Environment variables accepted by setuptools are supported to configure the C compiler and build:
+  https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#compiler-and-linker-options"""
+    )
 
     parser.add_argument('-X', '--directive', metavar='NAME=VALUE,...',
                       dest='directives', default={}, type=str,

{"golden_diff": "diff --git a/Cython/Build/Cythonize.py b/Cython/Build/Cythonize.py\n--- a/Cython/Build/Cythonize.py\n+++ b/Cython/Build/Cythonize.py\n@@ -121,10 +121,18 @@\n \n \n def create_args_parser():\n-    from argparse import ArgumentParser\n+    from argparse import ArgumentParser, RawDescriptionHelpFormatter\n     from ..Compiler.CmdLine import ParseDirectivesAction, ParseOptionsAction, ParseCompileTimeEnvAction\n \n-    parser = ArgumentParser()\n+    parser = ArgumentParser(\n+        formatter_class=RawDescriptionHelpFormatter,\n+        epilog=\"\"\"\\\n+Environment variables:\n+  CYTHON_FORCE_REGEN: if set to 1, forces cythonize to regenerate the output files regardless\n+        of modification times and changes.\n+  Environment variables accepted by setuptools are supported to configure the C compiler and build:\n+  https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#compiler-and-linker-options\"\"\"\n+    )\n \n     parser.add_argument('-X', '--directive', metavar='NAME=VALUE,...',\n                       dest='directives', default={}, type=str,\n", "issue": "Make the cythonize command line more useful\nA couple of more common build options, such as `--numpy`, `--include_path`, `--libraries`, `--cflags`, `--ldflags` should be added to `cythonize` command line so that it can be used easily for the majority of building tasks. \r\n\r\nSetting up a `setup.py` script for every `pyx` file I need to write is really, really tedious, which put me off from cython for years before I finally tried it for the first time (and that was in IPython notebook with cython magic, so I still don't know how to write `setup.py`). I am sure that many beginners to cython are just scared of the complicated build process like me, and never have the chance to actually try it. Please make it more accessible.\r\n\r\nThe `%%cython` magic in IPython has much better sane defaults and useful command line options than the `cythonize` script.\n", "before_files": [{"content": "#!/usr/bin/env python\n\nfrom __future__ import absolute_import\n\nimport os\nimport shutil\nimport tempfile\nfrom distutils.core import setup\n\nfrom .Dependencies import cythonize, extended_iglob\nfrom ..Utils import is_package_dir\nfrom ..Compiler import Options\n\ntry:\n    import multiprocessing\n    parallel_compiles = int(multiprocessing.cpu_count() * 1.5)\nexcept ImportError:\n    multiprocessing = None\n    parallel_compiles = 0\n\n\nclass _FakePool(object):\n    def map_async(self, func, args):\n        try:\n            from itertools import imap\n        except ImportError:\n            imap=map\n        for _ in imap(func, args):\n            pass\n\n    def close(self):\n        pass\n\n    def terminate(self):\n        pass\n\n    def join(self):\n        pass\n\n\ndef find_package_base(path):\n    base_dir, package_path = os.path.split(path)\n    while is_package_dir(base_dir):\n        base_dir, parent = os.path.split(base_dir)\n        package_path = '%s/%s' % (parent, package_path)\n    return base_dir, package_path\n\n\ndef cython_compile(path_pattern, options):\n    pool = None\n    all_paths = map(os.path.abspath, extended_iglob(path_pattern))\n    try:\n        for path in all_paths:\n            if options.build_inplace:\n                base_dir = path\n                while not os.path.isdir(base_dir) or is_package_dir(base_dir):\n                    base_dir = os.path.dirname(base_dir)\n            else:\n                base_dir = None\n\n            if os.path.isdir(path):\n                # recursively compiling a package\n                paths = [os.path.join(path, '**', '*.{py,pyx}')]\n            else:\n                # assume it's a file(-like thing)\n                paths = [path]\n\n            ext_modules = cythonize(\n                paths,\n                nthreads=options.parallel,\n                exclude_failures=options.keep_going,\n                exclude=options.excludes,\n                compiler_directives=options.directives,\n                compile_time_env=options.compile_time_env,\n                force=options.force,\n                quiet=options.quiet,\n                depfile=options.depfile,\n                **options.options)\n\n            if ext_modules and options.build:\n                if len(ext_modules) > 1 and options.parallel > 1:\n                    if pool is None:\n                        try:\n                            pool = multiprocessing.Pool(options.parallel)\n                        except OSError:\n                            pool = _FakePool()\n                    pool.map_async(run_distutils, [\n                        (base_dir, [ext]) for ext in ext_modules])\n                else:\n                    run_distutils((base_dir, ext_modules))\n    except:\n        if pool is not None:\n            pool.terminate()\n        raise\n    else:\n        if pool is not None:\n            pool.close()\n            pool.join()\n\n\ndef run_distutils(args):\n    base_dir, ext_modules = args\n    script_args = ['build_ext', '-i']\n    cwd = os.getcwd()\n    temp_dir = None\n    try:\n        if base_dir:\n            os.chdir(base_dir)\n            temp_dir = tempfile.mkdtemp(dir=base_dir)\n            script_args.extend(['--build-temp', temp_dir])\n        setup(\n            script_name='setup.py',\n            script_args=script_args,\n            ext_modules=ext_modules,\n        )\n    finally:\n        if base_dir:\n            os.chdir(cwd)\n            if temp_dir and os.path.isdir(temp_dir):\n                shutil.rmtree(temp_dir)\n\n\ndef create_args_parser():\n    from argparse import ArgumentParser\n    from ..Compiler.CmdLine import ParseDirectivesAction, ParseOptionsAction, ParseCompileTimeEnvAction\n\n    parser = ArgumentParser()\n\n    parser.add_argument('-X', '--directive', metavar='NAME=VALUE,...',\n                      dest='directives', default={}, type=str,\n                      action=ParseDirectivesAction,\n                      help='set a compiler directive')\n    parser.add_argument('-E', '--compile-time-env', metavar='NAME=VALUE,...',\n                      dest='compile_time_env', default={}, type=str,\n                      action=ParseCompileTimeEnvAction,\n                      help='set a compile time environment variable')\n    parser.add_argument('-s', '--option', metavar='NAME=VALUE',\n                      dest='options', default={}, type=str,\n                      action=ParseOptionsAction,\n                      help='set a cythonize option')\n    parser.add_argument('-2', dest='language_level', action='store_const', const=2, default=None,\n                      help='use Python 2 syntax mode by default')\n    parser.add_argument('-3', dest='language_level', action='store_const', const=3,\n                      help='use Python 3 syntax mode by default')\n    parser.add_argument('--3str', dest='language_level', action='store_const', const='3str',\n                      help='use Python 3 syntax mode by default')\n    parser.add_argument('-a', '--annotate', action='store_const', const='default', dest='annotate',\n                      help='Produce a colorized HTML version of the source.')\n    parser.add_argument('--annotate-fullc', action='store_const', const='fullc', dest='annotate',\n                      help='Produce a colorized HTML version of the source '\n                           'which includes entire generated C/C++-code.')\n    parser.add_argument('-x', '--exclude', metavar='PATTERN', dest='excludes',\n                      action='append', default=[],\n                      help='exclude certain file patterns from the compilation')\n\n    parser.add_argument('-b', '--build', dest='build', action='store_true', default=None,\n                      help='build extension modules using distutils')\n    parser.add_argument('-i', '--inplace', dest='build_inplace', action='store_true', default=None,\n                      help='build extension modules in place using distutils (implies -b)')\n    parser.add_argument('-j', '--parallel', dest='parallel', metavar='N',\n                      type=int, default=parallel_compiles,\n                      help=('run builds in N parallel jobs (default: %d)' %\n                            parallel_compiles or 1))\n    parser.add_argument('-f', '--force', dest='force', action='store_true', default=None,\n                      help='force recompilation')\n    parser.add_argument('-q', '--quiet', dest='quiet', action='store_true', default=None,\n                      help='be less verbose during compilation')\n\n    parser.add_argument('--lenient', dest='lenient', action='store_true', default=None,\n                      help='increase Python compatibility by ignoring some compile time errors')\n    parser.add_argument('-k', '--keep-going', dest='keep_going', action='store_true', default=None,\n                      help='compile as much as possible, ignore compilation failures')\n    parser.add_argument('--no-docstrings', dest='no_docstrings', action='store_true', default=None,\n                      help='strip docstrings')\n    parser.add_argument('-M', '--depfile', action='store_true', help='produce depfiles for the sources')\n    parser.add_argument('sources', nargs='*')\n    return parser\n\n\ndef parse_args_raw(parser, args):\n    options, unknown = parser.parse_known_args(args)\n    sources = options.sources\n    # if positional arguments were interspersed\n    # some of them are in unknown\n    for option in unknown:\n        if option.startswith('-'):\n            parser.error(\"unknown option \"+option)\n        else:\n            sources.append(option)\n    del options.sources\n    return (options, sources)\n\n\ndef parse_args(args):\n    parser = create_args_parser()\n    options, args = parse_args_raw(parser, args)\n\n    if not args:\n        parser.error(\"no source files provided\")\n    if options.build_inplace:\n        options.build = True\n    if multiprocessing is None:\n        options.parallel = 0\n    if options.language_level:\n        assert options.language_level in (2, 3, '3str')\n        options.options['language_level'] = options.language_level\n\n    if options.lenient:\n        # increase Python compatibility by ignoring compile time errors\n        Options.error_on_unknown_names = False\n        Options.error_on_uninitialized = False\n\n    if options.annotate:\n        Options.annotate = options.annotate\n\n    if options.no_docstrings:\n        Options.docstrings = False\n\n    return options, args\n\n\ndef main(args=None):\n    options, paths = parse_args(args)\n\n    for path in paths:\n        cython_compile(path, options)\n\n\nif __name__ == '__main__':\n    main()\n", "path": "Cython/Build/Cythonize.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nfrom __future__ import absolute_import\n\nimport os\nimport shutil\nimport tempfile\nfrom distutils.core import setup\n\nfrom .Dependencies import cythonize, extended_iglob\nfrom ..Utils import is_package_dir\nfrom ..Compiler import Options\n\ntry:\n    import multiprocessing\n    parallel_compiles = int(multiprocessing.cpu_count() * 1.5)\nexcept ImportError:\n    multiprocessing = None\n    parallel_compiles = 0\n\n\nclass _FakePool(object):\n    def map_async(self, func, args):\n        try:\n            from itertools import imap\n        except ImportError:\n            imap=map\n        for _ in imap(func, args):\n            pass\n\n    def close(self):\n        pass\n\n    def terminate(self):\n        pass\n\n    def join(self):\n        pass\n\n\ndef find_package_base(path):\n    base_dir, package_path = os.path.split(path)\n    while is_package_dir(base_dir):\n        base_dir, parent = os.path.split(base_dir)\n        package_path = '%s/%s' % (parent, package_path)\n    return base_dir, package_path\n\n\ndef cython_compile(path_pattern, options):\n    pool = None\n    all_paths = map(os.path.abspath, extended_iglob(path_pattern))\n    try:\n        for path in all_paths:\n            if options.build_inplace:\n                base_dir = path\n                while not os.path.isdir(base_dir) or is_package_dir(base_dir):\n                    base_dir = os.path.dirname(base_dir)\n            else:\n                base_dir = None\n\n            if os.path.isdir(path):\n                # recursively compiling a package\n                paths = [os.path.join(path, '**', '*.{py,pyx}')]\n            else:\n                # assume it's a file(-like thing)\n                paths = [path]\n\n            ext_modules = cythonize(\n                paths,\n                nthreads=options.parallel,\n                exclude_failures=options.keep_going,\n                exclude=options.excludes,\n                compiler_directives=options.directives,\n                compile_time_env=options.compile_time_env,\n                force=options.force,\n                quiet=options.quiet,\n                depfile=options.depfile,\n                **options.options)\n\n            if ext_modules and options.build:\n                if len(ext_modules) > 1 and options.parallel > 1:\n                    if pool is None:\n                        try:\n                            pool = multiprocessing.Pool(options.parallel)\n                        except OSError:\n                            pool = _FakePool()\n                    pool.map_async(run_distutils, [\n                        (base_dir, [ext]) for ext in ext_modules])\n                else:\n                    run_distutils((base_dir, ext_modules))\n    except:\n        if pool is not None:\n            pool.terminate()\n        raise\n    else:\n        if pool is not None:\n            pool.close()\n            pool.join()\n\n\ndef run_distutils(args):\n    base_dir, ext_modules = args\n    script_args = ['build_ext', '-i']\n    cwd = os.getcwd()\n    temp_dir = None\n    try:\n        if base_dir:\n            os.chdir(base_dir)\n            temp_dir = tempfile.mkdtemp(dir=base_dir)\n            script_args.extend(['--build-temp', temp_dir])\n        setup(\n            script_name='setup.py',\n            script_args=script_args,\n            ext_modules=ext_modules,\n        )\n    finally:\n        if base_dir:\n            os.chdir(cwd)\n            if temp_dir and os.path.isdir(temp_dir):\n                shutil.rmtree(temp_dir)\n\n\ndef create_args_parser():\n    from argparse import ArgumentParser, RawDescriptionHelpFormatter\n    from ..Compiler.CmdLine import ParseDirectivesAction, ParseOptionsAction, ParseCompileTimeEnvAction\n\n    parser = ArgumentParser(\n        formatter_class=RawDescriptionHelpFormatter,\n        epilog=\"\"\"\\\nEnvironment variables:\n  CYTHON_FORCE_REGEN: if set to 1, forces cythonize to regenerate the output files regardless\n        of modification times and changes.\n  Environment variables accepted by setuptools are supported to configure the C compiler and build:\n  https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#compiler-and-linker-options\"\"\"\n    )\n\n    parser.add_argument('-X', '--directive', metavar='NAME=VALUE,...',\n                      dest='directives', default={}, type=str,\n                      action=ParseDirectivesAction,\n                      help='set a compiler directive')\n    parser.add_argument('-E', '--compile-time-env', metavar='NAME=VALUE,...',\n                      dest='compile_time_env', default={}, type=str,\n                      action=ParseCompileTimeEnvAction,\n                      help='set a compile time environment variable')\n    parser.add_argument('-s', '--option', metavar='NAME=VALUE',\n                      dest='options', default={}, type=str,\n                      action=ParseOptionsAction,\n                      help='set a cythonize option')\n    parser.add_argument('-2', dest='language_level', action='store_const', const=2, default=None,\n                      help='use Python 2 syntax mode by default')\n    parser.add_argument('-3', dest='language_level', action='store_const', const=3,\n                      help='use Python 3 syntax mode by default')\n    parser.add_argument('--3str', dest='language_level', action='store_const', const='3str',\n                      help='use Python 3 syntax mode by default')\n    parser.add_argument('-a', '--annotate', action='store_const', const='default', dest='annotate',\n                      help='Produce a colorized HTML version of the source.')\n    parser.add_argument('--annotate-fullc', action='store_const', const='fullc', dest='annotate',\n                      help='Produce a colorized HTML version of the source '\n                           'which includes entire generated C/C++-code.')\n    parser.add_argument('-x', '--exclude', metavar='PATTERN', dest='excludes',\n                      action='append', default=[],\n                      help='exclude certain file patterns from the compilation')\n\n    parser.add_argument('-b', '--build', dest='build', action='store_true', default=None,\n                      help='build extension modules using distutils')\n    parser.add_argument('-i', '--inplace', dest='build_inplace', action='store_true', default=None,\n                      help='build extension modules in place using distutils (implies -b)')\n    parser.add_argument('-j', '--parallel', dest='parallel', metavar='N',\n                      type=int, default=parallel_compiles,\n                      help=('run builds in N parallel jobs (default: %d)' %\n                            parallel_compiles or 1))\n    parser.add_argument('-f', '--force', dest='force', action='store_true', default=None,\n                      help='force recompilation')\n    parser.add_argument('-q', '--quiet', dest='quiet', action='store_true', default=None,\n                      help='be less verbose during compilation')\n\n    parser.add_argument('--lenient', dest='lenient', action='store_true', default=None,\n                      help='increase Python compatibility by ignoring some compile time errors')\n    parser.add_argument('-k', '--keep-going', dest='keep_going', action='store_true', default=None,\n                      help='compile as much as possible, ignore compilation failures')\n    parser.add_argument('--no-docstrings', dest='no_docstrings', action='store_true', default=None,\n                      help='strip docstrings')\n    parser.add_argument('-M', '--depfile', action='store_true', help='produce depfiles for the sources')\n    parser.add_argument('sources', nargs='*')\n    return parser\n\n\ndef parse_args_raw(parser, args):\n    options, unknown = parser.parse_known_args(args)\n    sources = options.sources\n    # if positional arguments were interspersed\n    # some of them are in unknown\n    for option in unknown:\n        if option.startswith('-'):\n            parser.error(\"unknown option \"+option)\n        else:\n            sources.append(option)\n    del options.sources\n    return (options, sources)\n\n\ndef parse_args(args):\n    parser = create_args_parser()\n    options, args = parse_args_raw(parser, args)\n\n    if not args:\n        parser.error(\"no source files provided\")\n    if options.build_inplace:\n        options.build = True\n    if multiprocessing is None:\n        options.parallel = 0\n    if options.language_level:\n        assert options.language_level in (2, 3, '3str')\n        options.options['language_level'] = options.language_level\n\n    if options.lenient:\n        # increase Python compatibility by ignoring compile time errors\n        Options.error_on_unknown_names = False\n        Options.error_on_uninitialized = False\n\n    if options.annotate:\n        Options.annotate = options.annotate\n\n    if options.no_docstrings:\n        Options.docstrings = False\n\n    return options, args\n\n\ndef main(args=None):\n    options, paths = parse_args(args)\n\n    for path in paths:\n        cython_compile(path, options)\n\n\nif __name__ == '__main__':\n    main()\n", "path": "Cython/Build/Cythonize.py"}]}