I'm tyring to cythonize lots of py files in a loop function it goes something like:
from setuptools.command.build_ext import build_ext as _build_ext
for module in moduleList:
setuptools.setup(cmdclass={"build_ext": _build_ext},
ext_modules=cythonize(module[1])
#or
#ext_modules=cythonize(
# Extension(module[0],sources=[module[1]])
),
)
All I get is
usage: build_clean.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: build_clean.py --help [cmd1 cmd2 ...]
or: build_clean.py --help-commands
or: build_clean.py cmd --help
error: no commands supplied
What am I doing wrong here ? :- (
EDIT :
I have a feeling I'm missing the "explanation" of the issue so let me give it another go...
I have "BUILD" script that does tuff like this :
copyFile(xx,yy)
copyFile(yy,dd)
copeFile()
fileArr = []
for dir,fol,fil in os.walk(path):
for file in fil:
fileArr.append((fil,dir+"/"+file))
more work
more stuff
more lalala
for entry in fileArr :
setup(name="lets cythonize",
ext_modules=cythonize(Extension(entry[0],sources=[entry[1]]))
))
print("Job done yay")
I have to encapsulate half of the script in
myScript = """
import setuptools
for file in entryList:
setup(name="lets cythonize",
ext_modules=cythonize(Extension(entry[0],sources=[entry[1]]))
))
etc etc
"""
f = open(path,"w")
f.write(myScript)
f.close()
subprocess.call("env/python",path,"build_ext")
And thats what frustrating, I cant just "run" it from ide. It has to be run from cmd/terminal/etc...
question from:
https://stackoverflow.com/questions/65874475/cant-run-setup-cythonize-from-python-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…