Skip to content

Commit

Permalink
Merge pull request #2130 from Ericgig/annotate_setup
Browse files Browse the repository at this point in the history
Add annotate cython files options when installing the module
  • Loading branch information
Ericgig committed Mar 24, 2023
2 parents fbadfe8 + 1751699 commit ab6a0d7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def process_options():
options = _determine_user_arguments(options)
options = _determine_version(options)
options = _determine_compilation_options(options)
options = _determine_cythonize_options(options)
return options


Expand Down Expand Up @@ -131,6 +132,17 @@ def _determine_compilation_options(options):
return options


def _determine_cythonize_options(options):
options["annotate"] = False
if "--annotate" in sys.argv:
options["annotate"] = True
sys.argv.remove("--annotate")
if "-a" in sys.argv:
options["annotate"] = True
sys.argv.remove("-a")
return options


def _determine_version(options):
"""
Adds the 'short_version', 'version' and 'release' options.
Expand Down Expand Up @@ -269,7 +281,7 @@ def create_extension_modules(options):
extra_compile_args=options['cflags'],
extra_link_args=options['ldflags'],
language='c++'))
return cythonize(out)
return cythonize(out, annotate=options["annotate"])


def print_epilogue():
Expand Down

0 comments on commit ab6a0d7

Please sign in to comment.