Skip to content

Instantly share code, notes, and snippets.

@akmamun
Created March 27, 2019 09:51
Show Gist options
  • Select an option

  • Save akmamun/52d8d3b5c34691e070bd5b2d62f1380d to your computer and use it in GitHub Desktop.

Select an option

Save akmamun/52d8d3b5c34691e070bd5b2d62f1380d to your computer and use it in GitHub Desktop.

Revisions

  1. akmamun created this gist Mar 27, 2019.
    20 changes: 20 additions & 0 deletions compile.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    from distutils.core import setup
    from distutils.extension import Extension
    from Cython.Distutils import build_ext
    from Cython.Build import cythonize


    ext_modules = [
    Extension("test", ["test.py"]),
    ]

    setup(
    name='Test Compile',
    cmdclass={'build_ext': build_ext},
    ext_modules=cythonize(ext_modules,
    compiler_directives={'always_allow_keywords': True}, # 'always_allow_keywords' for avoid flask error
    )

    )
    # than call
    # add a main.py where flask app is call and run main.py