Skip to content

Commit 8fc4d99

Browse files
committed
Add warning about extensions
1 parent 1132cfb commit 8fc4d99

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,10 @@ def glob_cfiles(path, excludes):
273273
if len(user_sources) != 1:
274274
raise BuildError("User Modules are only allowed one Cython .pyx file")
275275

276-
cfilename = user_sources[0].split('/')[-1][:-4] + '.c'
276+
filename_string = user_sources[0].split('/')[-1][:-4]
277+
if filename_string is not module_name:
278+
raise BuildError("The Cython source file in {} must match the folder name - i.e. it must be {}.pyx".format(module_name, module_name))
279+
cfilename = filename_string + '.c'
277280
print(cfilename)
278281
user_sources += glob_cfiles(folder, excludes=[cfilename])
279282

0 commit comments

Comments
 (0)