We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[BUG] Unable to run `Cythonize.py`
### Describe the bug

I tried to run `Cythonize.py` but it failed because of relative imports in file:
```
Traceback (most recent call last):
  File "/tmp/cython/Cython/Build/Cythonize.py", line 10, in <module>
    from .Dependencies import cythonize, extended_iglob
ImportError: attempted relative import with no known parent package
```

### Code to reproduce the behaviour:

```bash
# download repo
cd /tmp/
git clone https://github.com/cython/cython.git

# make file runable
cd /tmp/cython/Cython/Build/
chmod +x Cythonize.py

# run file
./Cythonize.py
```

### Expected behaviour

`Cythonize.py` has the shebang so I expected it to be executable.

### OS

Linux

### Python version

3.10.12

### Cython version

main branch from git

### Additional context

_No response_

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

{"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@@ -1,5 +1,3 @@\n-#!/usr/bin/env python\n-\n from __future__ import absolute_import, print_function\n \n import os\n", "issue": "[BUG] Unable to run `Cythonize.py`\n### Describe the bug\n\nI tried to run `Cythonize.py` but it failed because of relative imports in file:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/tmp/cython/Cython/Build/Cythonize.py\", line 10, in <module>\r\n    from .Dependencies import cythonize, extended_iglob\r\nImportError: attempted relative import with no known parent package\r\n```\n\n### Code to reproduce the behaviour:\n\n```bash\r\n# download repo\r\ncd /tmp/\r\ngit clone https://github.com/cython/cython.git\r\n\r\n# make file runable\r\ncd /tmp/cython/Cython/Build/\r\nchmod +x Cythonize.py\r\n\r\n# run file\r\n./Cythonize.py\r\n```\n\n### Expected behaviour\n\n`Cythonize.py` has the shebang so I expected it to be executable.\n\n### OS\n\nLinux\n\n### Python version\n\n3.10.12\n\n### Cython version\n\nmain branch from git\n\n### Additional context\n\n_No response_\n", "before_files": [{"content": "#!/usr/bin/env python\n\nfrom __future__ import absolute_import, print_function\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\ndef cython_compile(path_pattern, options):\n    all_paths = map(os.path.abspath, extended_iglob(path_pattern))\n    _cython_compile_files(all_paths, options)\n\ndef _cython_compile_files(all_paths, options):\n    pool = None\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    all_paths = []\n    for path in paths:\n        expanded_path = [os.path.abspath(p) for p in extended_iglob(path)]\n        if not expanded_path:\n            import sys\n            print(\"{}: No such file or directory: '{}'\".format(sys.argv[0], path), file=sys.stderr)\n            sys.exit(1)\n        all_paths.extend(expanded_path)\n    _cython_compile_files(all_paths, options)\n\n\nif __name__ == '__main__':\n    main()\n", "path": "Cython/Build/Cythonize.py"}], "after_files": [{"content": "from __future__ import absolute_import, print_function\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\ndef cython_compile(path_pattern, options):\n    all_paths = map(os.path.abspath, extended_iglob(path_pattern))\n    _cython_compile_files(all_paths, options)\n\ndef _cython_compile_files(all_paths, options):\n    pool = None\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    all_paths = []\n    for path in paths:\n        expanded_path = [os.path.abspath(p) for p in extended_iglob(path)]\n        if not expanded_path:\n            import sys\n            print(\"{}: No such file or directory: '{}'\".format(sys.argv[0], path), file=sys.stderr)\n            sys.exit(1)\n        all_paths.extend(expanded_path)\n    _cython_compile_files(all_paths, options)\n\n\nif __name__ == '__main__':\n    main()\n", "path": "Cython/Build/Cythonize.py"}]}