Skip to content

Commit 329e6de

Browse files
committed
Fix setup.py to properly exclude Cython generated sources for user modules.
1 parent 6f21b8d commit 329e6de

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,19 @@ def glob_cfiles(path, excludes):
266266

267267
for folder in glob.glob(os.path.join(USER_DIR, '*/')):
268268
module_name = folder.split('/')[-2]
269-
print(folder.split('/'))
270269
print('Found User Module: {}'.format(module_name))
271270
user_sources = glob.glob(folder + '/*.pyx')
272271
print('\tFound Cython sources: {}'.format(user_sources))
272+
273273
if len(user_sources) != 1:
274274
raise BuildError("User Modules are only allowed one Cython .pyx file")
275-
user_sources += glob_cfiles(folder, excludes=user_sources)
275+
276+
cfilename = user_sources[0].split('/')[-1][:-4] + '.c'
277+
print(cfilename)
278+
user_sources += glob_cfiles(folder, excludes=[cfilename])
279+
280+
print(user_sources)
281+
276282
ext_modules.append(
277283
Extension("fidimag.extensions.user.{}".format(module_name),
278284
sources=user_sources,

0 commit comments

Comments
 (0)