Skip to content

Commit f7c3bfc

Browse files
committed
Refactor set up for inclusion of submodules
1 parent b8be99b commit f7c3bfc

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

setup.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,24 @@
6363
compiler_directives['linetrace'] = True
6464

6565

66-
ext_modules = [
67-
Extension(
68-
"flint._flint", ["src/flint/pyflint.pyx"],
69-
libraries=libraries,
70-
library_dirs=default_lib_dirs,
71-
include_dirs=default_include_dirs,
72-
define_macros=define_macros,
73-
),
74-
Extension(
75-
"flint.flint_base.flint_context",
76-
["src/flint/flint_base/flint_context.pyx"],
77-
libraries=libraries,
78-
library_dirs=default_lib_dirs,
79-
include_dirs=default_include_dirs,
80-
define_macros=define_macros,
81-
),
66+
ext_files = [
67+
("flint._flint", ["src/flint/pyflint.pyx"]), # Main Module
68+
# Submodules
69+
("flint.flint_base.flint_context", ["src/flint/flint_base/flint_context.pyx"]),
8270
]
8371

72+
ext_options = {
73+
"libraries" : libraries,
74+
"library_dirs" : default_lib_dirs,
75+
"include_dirs" : default_include_dirs,
76+
"define_macros" : define_macros,
77+
}
78+
79+
ext_modules = []
80+
for mod_name, src_files in ext_files:
81+
ext = Extension(mod_name, src_files, **ext_options)
82+
ext_modules.append(ext)
83+
8484
for e in ext_modules:
8585
e.cython_directives = {"embedsignature": True}
8686

0 commit comments

Comments
 (0)