Last active
September 3, 2015 13:57
Revisions
-
Leonardo Rossetti renamed this gist
Sep 3, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Leonardo Rossetti revised this gist
Sep 2, 2015 . 1 changed file with 3 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,5 @@ # -*- coding: utf-8 -*- #source: https://github.com/cython/cython/wiki/PackageHierarchy import sys, os from distutils.core import setup, Extension @@ -33,13 +23,13 @@ def scandir(dir, files=[]): return files def make_extension(ext_name): ext_path = ext_name.replace('.', os.path.sep) + '.pyx' options = { 'extra_compile_args': compile_args, 'extra_link_args': link_args } return Extension(ext_name, [ext_path], **options) ext_names = scandir(package_dir) -
Leonardo Rossetti revised this gist
Sep 2, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def make_extension(extName): return Extension(extName, [extPath], **options) ext_names = scandir(package_dir) extensions = [make_extension(name) for name in ext_names] options = { 'name': package_name, -
Leonardo Rossetti revised this gist
Sep 2, 2015 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,15 @@ # -*- coding: utf-8 -*- #source: https://github.com/cython/cython/wiki/PackageHierarchy ''' gd/ __init__.py hello.pxd hello.pyx greetings/ __init__.py en.pxd en.pyx ''' import sys, os from distutils.core import setup, Extension -
Leonardo Rossetti revised this gist
Sep 2, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- #source: https://github.com/cython/cython/wiki/PackageHierarchy import sys, os from distutils.core import setup, Extension from Cython.Distutils import build_ext -
Leonardo Rossetti revised this gist
Sep 2, 2015 . No changes.There are no files selected for viewing
-
Leonardo Rossetti created this gist
Sep 2, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ # -*- coding: utf-8 -*- import sys, os from distutils.core import setup, Extension from Cython.Distutils import build_ext package_name = 'gd' package_dir = 'gd' packages = ['gd', 'gd.greetings'] compile_args = ['-Wall'] link_args = ['-g'] def scandir(dir, files=[]): for file in os.listdir(dir): path = os.path.join(dir, file) if os.path.isfile(path) and path.endswith('.pyx'): files.append(path.replace(os.path.sep, '.')[:-4]) elif os.path.isdir(path): scandir(path, files) return files def make_extension(extName): extPath = extName.replace('.', os.path.sep) + '.pyx' options = { 'extra_compile_args': compile_args, 'extra_link_args': link_args } return Extension(extName, [extPath], **options) ext_names = scandir('gd') extensions = [make_extension(name) for name in ext_names] options = { 'name': package_name, 'packages': packages, 'ext_modules': extensions, 'cmdclass': {'build_ext': build_ext} } setup(**options)